For.Bin or.Exe files, how does a linker generate line numbers in debug information?

Rainer Schuetze via Digitalmars-d-debugger digitalmars-d-debugger at
Sat Jun 17 05:05:31 PDT 2017

On 17.06.2017 04:17, moecmks wrote:
> I come from China, my English is not very high. Please forgive me.
> First provide the context
> @:debugger,IDA 6.8
> @:this is my source file <hello.d>, only this one.
> import std.stdio;
> void main () {
>    writeln ("Hello World");
> }
> I've found that for.Obj, using the -c -debug -gc -m32 command always 
> generates line number information that is seen by the debugger
> However, as long as the connection is exe or bin, the debugger can only 
> see variable symbols, but no line numbers can be seen,I don't know if 
> I've done anything wrong 0_0
> this is my linker's command:$(LINK) /CO:4/DEBUG /CODEVIEW /DEBUGLINES 
> /DEBUGMODULES:$(OBJPATH)\hello.obj $(OBJPATH)\hello.obj

The debug information emitted by compiling with -m32 follows a very old 
CodeView 4 specification that isn't well understood by current debuggers.

With cv2pdb ( you can convert 
this debug information into a PDB file following newer standards but 
you'll need some components from the Microsoft tool chain to execute it.

Alternatively you can compile with -m32mscoff or -m64 that will use the 
Microsoft linker and the MS C runtime. This will generate a PDB file 

More information about the Digitalmars-d-debugger mailing list