News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Source debug MASM32 exe with latest Windbg

Started by madhur_ahuja, December 03, 2010, 08:47:58 AM

Previous topic - Next topic

madhur_ahuja

Has anyone been able to source debug .exe generated with Ml.exe and link.exe with Windbg. I am not able to do it.

And yes I have compiled with /Zi and linked with /DEBUGTYPE:CV and /DEBUG option.

japheth

Quote from: madhur_ahuja on December 03, 2010, 08:47:58 AM
Has anyone been able to source debug .exe generated with Ml.exe and link.exe with Windbg. I am not able to do it.

Yes.

See:


(color depth was reduced to 16)

Quote
And yes I have compiled with /Zi and linked with /DEBUGTYPE:CV and /DEBUG option.

That's ok. /DEBUGTYPE:CV probably isn't needed.

madhur_ahuja

Thanks, DEBUGTYPE by default is CV, so thats not a culprit.

Did you do something else ? I even set the symbol path and source file path to the location containing my source, pdb files and executables.

Does it matter if you ave x86 or x64 version of WinDbg ? I am running Win 2008 x64 but assembling against 32 bit ml.exe and link.exe

ToutEnMasm


You must have also the windows symbols in C:\WINDOWS\Symbols
They can be downloaded from msdn
http://www.microsoft.com/whdc/devtools/debugging/default.mspx

madhur_ahuja

Are the windows symbols really necessary ? Can I point to the symbol server instead of downloading ?

japheth

Quote from: madhur_ahuja on December 03, 2010, 09:19:45 AM
Are the windows symbols really necessary ? Can I point to the symbol server instead of downloading ?

No (the windows symbols aren't necessary) and Yes (point to the symbol server instead of downloading).

However, when starting WinDbg, it will stop somewhere inside kernel. This is a very early point of execution, where dll entry points  ("LibMain") aren't executed yet.

To reach the source of your program, you'll have to enter a "G <startsymbol>" in WinDbg's command line. <startsymbol> is the name of the symbol behind the END directive.

ToutEnMasm

Quote
Access to Windows symbol files. If you have access to the Internet while debugging, you can set your debugger's symbol path to point to the Windows symbol server. If you do not have access to the Internet while debugging, you can download symbols in advance from the Microsoft website.
If you choose the internet line you have to add one option to the command line
Quote
-c ".sympath+ SRV*C:\WINDOWS\Symbols*http://msdl.microsoft.com/download/symbols"

It is needed you have them with one or the two soluces



sinsi

For the Windows symbols, set an environment variable like:

_NT_SYMBOL_PATH=srv*c:\asm\symbols*http://msdl.microsoft.com/download/symbols;cache*c:\asm\symbols

Of course, change c:\asm\symbols to wherever you want them to go.
This lets you keep copies instead of downloading all the time.
Light travels faster than sound, that's why some people seem bright until you hear them.

madhur_ahuja