Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find symbol(s) at or near a given memory address ? (using Visual Studio 2010)

While debugging Windows application, I wanted to find out if it is possible to locate symbols at a given memory location (and how). This will be the reverse operation of typing a symbol in the "Memory" window, which will translate the symbol to its address. But not the other way around.

It is super easy on VxWorks shell, and possible with Linux gdb. Should be possible on VS.

Thanks.

like image 849
FractalSpace Avatar asked Jul 24 '12 15:07

FractalSpace


People also ask

How do I see symbols in Visual Studio?

In Visual Studio, open Tools > Options > Debugging > Symbols (or Debug > Options > Symbols).

How do I find the Memory address in Visual Studio?

To get the address do the following: Start debugging your app (or with a dump, after clicking Debug with Managed Code) Go to Debug > Windows > Memory, select Memory 1, Memory 2, Memory 3, or Memory 4 (Community version only has one Memory window).

How do I trace code in Visual Studio?

Begin code stepping by selecting F10 or F11. Doing so allows you to quickly find the entry point of your app. You can then continue to press step commands to navigate through the code. Run to a specific location or function, for example, by setting a breakpoint and starting your app.


2 Answers

If you are lucky and you know the exact address, but do not know the symbol name, try to write the address into the Watch window, and the VS will find the symbol. E.g.

(void *)0x6F63E248  -> 0x6f63e248 {My.dll!TMyString<char,CMyMemHeap>  *s_psMyAppNameAbbr}   void *
like image 109
József Sárosi Avatar answered Nov 12 '22 19:11

József Sárosi


When using windbg to debug, command "ln Address" will help you check the symbols near the target address, hope that will help you.

like image 37
Stuart Gerry Avatar answered Nov 12 '22 19:11

Stuart Gerry