News:

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

Following source in Windbg

Started by AParsons, November 06, 2011, 07:30:07 PM

Previous topic - Next topic

AParsons

Hi,

I don't seem to be able to get windbg to show its current position in the source code.

I have compiled with:
ml bones.asm /Zi /Zd /c /coff /Cp /nologo
(Microsoft (R) Macro Assembler Version 10.00.40219.01)

Then linked with:
link /SUBSYSTEM:WINDOWS /DEBUG /PDB:bones.pdb bones.obj
(Microsoft (R) Incremental Linker Version 10.00.40219.01)

Set windows XP environment path to:
set _NT_ALT_SYMBOL_PATH=c:\temp\bones
set _NT_SYMBOL_PATH=srv*c:\symbols*http://msdl.microsoft.com/download/symbols

In Windbg: (6.12.0002.633 X86)
File->Symbol File Path (Looks the same as the Environment variables)

In the start of my code I have:
.
.
.
start:
       int 3      ; required for WinDbg debugger
.

I then load the exe, I see in the command window:

7c90120e cc              int     3

I use lm in the command window, I see that the PDB is loaded, but sometimes I need to .reload /f (not sure why I have to do this, maybe a problem?)

00400000 00409000   bones    C (pdb symbols)          c:\temp\bones\bones.pdb
5d090000 5d12a000   comctl32   (pdb symbols)          c:\symbols\comctl32.pdb\77EF193B0498456F92411B02620462FB2\comctl32.pdb
763b0000 763f9000   comdlg32   (pdb symbols)          c:\symbols\comdlg32.pdb\026A6FF770FD4E6186ADBBE96DFFA99C2\comdlg3
.
.

I then  use g start to start debugging, but there is no indication as to where the debugger is up to in the source file.

Any help would be greatly appreciated.

AParsons

I found the problem.

I don't know why I was using "g start" in the command window.  ::)   If I just use "g" in the command window, I can then use F10 to step over and the other commands. :clap:

Now its on to trying to understand how to set breakpoints in windbg. :eek

AParsons

Just found this on the internet:

To set a breakpoint at the start, rather than using "Int 3" in your code use:
bu @$exentry

:8)

dedndave

i think most of us use Olly Debug
http://www.ollydbg.de/

that may be why you got so few responses   :P

AParsons

BTW it looks like "bu @$exentry" loses the funtionality of stepping through source using F10.

Dave,

I kind of figured that, but thats cool. Ollydbg is a great debugger, however the reason I am looking at Windbg is because I want to know more about crash dumps, kernel, drivers etc.



ToutEnMasm


for windbg
Quote
Link  .. /DEBUG /debugtype:cv ....
ctrl F-10 to go to line (go to the cursor position)



AParsons

Quote
for windbg
Quote
Link  .. /DEBUG /debugtype:cv ....
ctrl F-10 to go to line (go to the cursor position)

ToutEnMasm,

Thankyou for that tip.  :8)

Does anyone know how to get line numbers to show in the source view in Windbg?? Because I read somewhere that there is a command to jump to a line number.