www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Why D can be debug in VC

reply "Huang Yicheng" <zergbird msn.com> writes:
I cannot understand how it works. Can some one explain it for me briefly. 
Thank you
Jan 18 2005
parent reply "Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> writes:
Hi..

Please explain your question. I've noticed your reply to my explanation on 
how to debug. Is it clear? Is it working but you wonder how it's possible 
that it works?

The trick is that VC understand the debug information in compiled/linked D 
executable. This information tells the debugger where the source code for 
each byte in the code can be found (I don't know the details of this, but in 
practice this is what it comes down to).

So if you put a breakpoint in your opened D source code from within VC, it 
can find the corresponding memory address to break at from this debug 
information.

The debugger in VC knows nothing of C/C++. Maybe it's better if we'd refer 
to the debugger in MSDEV, since it just interprets the language independent 
debug information embedded in the executables.

Hope this covers your question.

Lionello. 
Jan 19 2005
parent reply "Huang Yicheng" <zergbird msn.com> writes:
Thank you! Now I can understand the principle.
Another question is, how can we know the format (I mean debug inforamtion) 
of debugger in MSDEV ?
Is it the same as gdb?

Yicheng

"Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> wrote in message 
news:csl45l$127j$1 digitaldaemon.com...
 Hi..

 Please explain your question. I've noticed your reply to my explanation on 
 how to debug. Is it clear? Is it working but you wonder how it's possible 
 that it works?

 The trick is that VC understand the debug information in compiled/linked D 
 executable. This information tells the debugger where the source code for 
 each byte in the code can be found (I don't know the details of this, but 
 in practice this is what it comes down to).

 So if you put a breakpoint in your opened D source code from within VC, it 
 can find the corresponding memory address to break at from this debug 
 information.

 The debugger in VC knows nothing of C/C++. Maybe it's better if we'd refer 
 to the debugger in MSDEV, since it just interprets the language 
 independent debug information embedded in the executables.

 Hope this covers your question.

 Lionello.
 

Jan 19 2005
parent reply "Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> writes:
"Huang Yicheng" <zergbird msn.com> wrote in message 
news:csl7lt$18gr$1 digitaldaemon.com...
 Thank you! Now I can understand the principle.
 Another question is, how can we know the format (I mean debug inforamtion) 
 of debugger in MSDEV ?
 Is it the same as gdb?

I can't help you there. I know there are more formats for debug information (COFF,OMF) but I really have no idea which format is produced by gcc/msvc/dmd/etc, what format is understood by windbg/msdev/gdb/etc. Sorry. Lionello.
Jan 19 2005
parent reply "Huang Yicheng" <zergbird msn.com> writes:
Thanks anyway. Think it should be COFF.
"Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> wrote in message 
news:cslool$25p4$1 digitaldaemon.com...
 "Huang Yicheng" <zergbird msn.com> wrote in message 
 news:csl7lt$18gr$1 digitaldaemon.com...
 Thank you! Now I can understand the principle.
 Another question is, how can we know the format (I mean debug 
 inforamtion) of debugger in MSDEV ?
 Is it the same as gdb?

I can't help you there. I know there are more formats for debug information (COFF,OMF) but I really have no idea which format is produced by gcc/msvc/dmd/etc, what format is understood by windbg/msdev/gdb/etc. Sorry. Lionello.

Jan 19 2005
parent reply "Charles" <no email.com> writes:
COFF & OMF are object file formats, describes the layout for object files.

GCC emits dwarf2
MSVC / DMC emits CodeView information, usually embeded in the exe, it can
also be pushed into external .pdb file.

Hope that helps,
Charlie


"Huang Yicheng" <zergbird msn.com> wrote in message
news:csluls$2gm5$1 digitaldaemon.com...
 Thanks anyway. Think it should be COFF.
 "Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> wrote in

 news:cslool$25p4$1 digitaldaemon.com...
 "Huang Yicheng" <zergbird msn.com> wrote in message
 news:csl7lt$18gr$1 digitaldaemon.com...
 Thank you! Now I can understand the principle.
 Another question is, how can we know the format (I mean debug
 inforamtion) of debugger in MSDEV ?
 Is it the same as gdb?

I can't help you there. I know there are more formats for debug information (COFF,OMF) but I really have no idea which format is


 by gcc/msvc/dmd/etc, what format is understood by windbg/msdev/gdb/etc.

 Sorry.

 Lionello.


Jan 19 2005
parent "Charles" <no email.com> writes:
Just a side note theres a good book called 'linkers & loaders ' (
http://www.amazon.com/exec/obidos/ASIN/1558604960/002-0853754-5237642 ) that
provides a good overview of the subject.

Charlie!


"Charles" <no email.com> wrote in message
news:csmdfb$719$1 digitaldaemon.com...
 COFF & OMF are object file formats, describes the layout for object files.

 GCC emits dwarf2
 MSVC / DMC emits CodeView information, usually embeded in the exe, it can
 also be pushed into external .pdb file.

 Hope that helps,
 Charlie


 "Huang Yicheng" <zergbird msn.com> wrote in message
 news:csluls$2gm5$1 digitaldaemon.com...
 Thanks anyway. Think it should be COFF.
 "Lionello Lunesu" <lionello.lunesu crystalinter.remove.com> wrote in

 news:cslool$25p4$1 digitaldaemon.com...
 "Huang Yicheng" <zergbird msn.com> wrote in message
 news:csl7lt$18gr$1 digitaldaemon.com...
 Thank you! Now I can understand the principle.
 Another question is, how can we know the format (I mean debug
 inforamtion) of debugger in MSDEV ?
 Is it the same as gdb?

I can't help you there. I know there are more formats for debug information (COFF,OMF) but I really have no idea which format is


 by gcc/msvc/dmd/etc, what format is understood by



 Sorry.

 Lionello.



Jan 19 2005