Thread overview
Debugger on Codeblocks with DMD and Tango on Linux
Aug 10, 2008
Timo Gransch
Aug 12, 2008
Koroskin Denis
Aug 12, 2008
Timo Gransch
Aug 13, 2008
Denis Koroskin
Aug 13, 2008
Timo Gransch
August 10, 2008
Hi all,

did anybody manage to make the debugger work with the above environment (Codeblocks 8.02 or the current 'Nightly Build', current Tango + DMD package with DMD 1.033, gdb 6.8 from Debian Testing)?

If I set a breakpoint and then start the debugger, I get:

-------------------
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8-debian
Child process PID: 3642
-------------------

This looks OK to me so far, but there is no debugger arrow shown. Obviously something happens when I press F7 (Next line), because every time I do, I get messages like

-------------------
In _D6dmain24mainUiPPaZi7runMainMFZv () ()
In _D6dmain24mainUiPPaZi7tryExecMFDFZvZv () ()
In _D6dmain24mainUiPPaZi6runAllMFZv () ()
In _D6dmain24mainUiPPaZi7tryExecMFDFZvZv () ()
-------------------

... and finally ...

-------------------
In main () ()
In __libc_start_main () (/lib/libc.so.6)
Program exited normally.
Debugger finished with status 0
-------------------

... but still no yellow arrow.

Any ideas on what is wrong?

Best regards and thanks in advance,
Timo

August 12, 2008
On Sun, 10 Aug 2008 11:41:26 +0400, Timo Gransch <timo.gransch@gmx.de> wrote:

> Hi all,
>
> did anybody manage to make the debugger work with the above environment
> (Codeblocks 8.02 or the current 'Nightly Build', current Tango + DMD
> package with DMD 1.033, gdb 6.8 from Debian Testing)?
>
> If I set a breakpoint and then start the debugger, I get:
>
> -------------------
> Starting debugger:
> done
> Registered new type: wxString
> Registered new type: STL String
> Registered new type: STL Vector
> Setting breakpoints
> Debugger name and version: GNU gdb 6.8-debian
> Child process PID: 3642
> -------------------
>
> This looks OK to me so far, but there is no debugger arrow shown. Obviously
> something happens when I press F7 (Next line), because every time I do, I
> get messages like
>
> -------------------
> In _D6dmain24mainUiPPaZi7runMainMFZv () ()
> In _D6dmain24mainUiPPaZi7tryExecMFDFZvZv () ()
> In _D6dmain24mainUiPPaZi6runAllMFZv () ()
> In _D6dmain24mainUiPPaZi7tryExecMFDFZvZv () ()
> -------------------
>
> ... and finally ...
>
> -------------------
> In main () ()
> In __libc_start_main () (/lib/libc.so.6)
> Program exited normally.
> Debugger finished with status 0
> -------------------
>
> ... but still no yellow arrow.
>
> Any ideas on what is wrong?
>
> Best regards and thanks in advance,
> Timo
>

I don't use gdb but I've heard you need to apply some patches for better D support (like variable and function names demangling etc). Take a look here: http://dsource.org/projects/gdb-patches/browser/downloads/gdb6.8

That's all I can help you with.
August 12, 2008
Koroskin Denis wrote:

> I don't use gdb but I've heard you need to apply some patches for better D support (like variable and function names demangling etc). Take a look here: http://dsource.org/projects/gdb-patches/browser/downloads/gdb6.8

Hi!

Thanks a lot, didn't know about this.

I patched and compiled gdb 6.8, but the unfortunately the behaviour is still the same.

Best regards,
Timo


August 13, 2008
Timo Gransch wrote:

> did anybody manage to make the debugger work with the above environment
> (Codeblocks 8.02 or the current 'Nightly Build', current Tango + DMD
> package with DMD 1.033, gdb 6.8 from Debian Testing)?

If you don't get the same problems when doing the same build/debug from
the commandline, it might be a bug where -g is not properly passed...

I believe the logic (inherited from C/C++) might only pass -g when compiling which might not be enough. Or, it could be something else.

--anders

PS. Testing the same thing with GDC would also help isolate the problem.
August 13, 2008
On Wed, 13 Aug 2008 11:19:42 +0400, Anders F Björklund <afb@algonet.se> wrote:

> Timo Gransch wrote:
>
>> did anybody manage to make the debugger work with the above environment
>> (Codeblocks 8.02 or the current 'Nightly Build', current Tango + DMD
>> package with DMD 1.033, gdb 6.8 from Debian Testing)?
>
> If you don't get the same problems when doing the same build/debug from
> the commandline, it might be a bug where -g is not properly passed...
>
> I believe the logic (inherited from C/C++) might only pass -g when compiling which might not be enough. Or, it could be something else.
>
> --anders
>
> PS. Testing the same thing with GDC would also help isolate the problem.

Yeah, make sure compiler and linker get the "-g" flag.

1) Compiler settings -> Compiler flags -> check "add symbolic debug info [-g]" (and, optionally, "compile in debug code [-debug])
2) Linker settings -> Other linker options - add "-g".
August 13, 2008
Denis Koroskin wrote:

> Yeah, make sure compiler and linker get the "-g" flag.
> 
> 1) Compiler settings -> Compiler flags -> check "add symbolic debug info
> [-g]" (and, optionally, "compile in debug code [-debug])
> 2) Linker settings -> Other linker options - add "-g".

Hi Denis and Anders!

I already had -g and -debug checked in the compiler settings. I added -g in the linker options and tried to debug again, but unfortunately it does not make any difference.

The funny thing is that the breakpoint I set is nevertheless somehow recognized by gdb. In spite of having no arrow and variable watches, I can obviously step through the lines of the code by pressing F7 and get some output. If I do not set a breakpoint, the debuger rushes through the code and finishes immediately.

Thanks for all your help and efforts. Maybe this is rather a topic for the CodeBlocks forum (although there are only very few D programmers there).

KR,
Timo