Getting token from an address
-
13 ianuarie 2012 21:35
Hi!
I'm trying to get the symbol information for an address I got from .NET callstack.
I read that symbols can be resolved using ISymUnmanagedReader, but it only get a token as input for its "GetMethod" function.
Can I somehow get the matching token to the address I have so I can use that "GetMethod" function?Or: is there another way to do this?
thanks :)
Toate mesajele
-
14 ianuarie 2012 06:34
ISymUnmanagedReader is for getting data from a symbol store; for that I always interpreted that to mean an assembly (and pdb file if it existed).
How did you get the address that you wish to get the type/method for? Are you using a profiler or a debugger?
-
14 ianuarie 2012 08:31
I'm using the debugging API.
I'm doing something like:
ICorDebugChain* chain = NULL;
ICorDebugFrame* frame = NULL;
ICorDebugFunction* function = NULL;
ICorDebugCode* code = NULL;
thread->GetActiveChain(&chain);
chain->GetActiveFrame(&frame);
frame->GeFunction(&func);
function->GetCode(&code);
CORDB_ADDRESS address = 0;
code->GetAddress(&address);
I know I can get here the token, But I need to save just my addresses.
And I DO want to get the symbols from the PDB file. Do I need to use the "ISymUnmanagedReader" or there is another way?
-
16 ianuarie 2012 06:19Proprietar
You can get the token from the ICorDebugFrame or the ICorDebugFunction. Using ISymUnmanagedReader is fine.
Jon
- Marcat ca răspuns de Jon LangdonOwner 21 ianuarie 2012 19:39
-
21 ianuarie 2012 21:27ok, thanks :)