Messed up debug symbols GDB/GDC

kk klynesys at
Thu Dec 7 19:08:11 UTC 2017

Hey so I recently got back into D a bit, but I'm having a bit of 
trouble with debugging.

So for this minimal test file:

void main()
     int x = 5;
     int y = x * 20;

     float b = 6.7432143;

     b *= 2;


Compiled with gdc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
$ gdc -g test.d -otest

I get this output in gdb
(gdb) b main
Breakpoint 1 at 0x104f9: file 
/usr/lib/gcc/x86_64-linux-gnu/7/include/d/__entrypoint.di, line 
(gdb) r
Starting program: /home/kyoji/ProgrammingTests/dlang/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library 

Breakpoint 1, main (argc=1, argv=0x7fffffffdd78) at 
44          return _d_run_main(argc, argv, &_Dmain);
(gdb) n
45      }
__libc_start_main (main=0x5555555644ea <main>, argc=1, 
argv=0x7fffffffdd78, init=<optimized out>, fini=<optimized out>, 
rtld_fini=<optimized out>,
     stack_end=0x7fffffffdd68) at ../csu/libc-start.c:342
342     ../csu/libc-start.c: No such file or directory.
[Inferior 1 (process 11211) exited normally]

Sometimes if I reformatted the text, it would print a random 
line, such as 'b *= 2'
but it was more less random.

I also did try forcing different dwarf versions, but it was the 
exact same result.

If I need to post anymore info please let me know.

More information about the Digitalmars-d-debugger mailing list