digitalmars.D.learn - How do you guys debug large programs?
- Gary Willoughby (7/7) May 27 2013 This is quite an open ended question but i wondered how you guys
- mimi (5/12) May 27 2013 I am use Geany + gdb in Linux. A little frustrating that the
- Adam D. Ruppe (7/9) May 27 2013 I just use gdb with dmd's -gc -debug flags, when I use a debugger
- Nathan M. Swan (6/13) May 28 2013 I know Alexander Bothe of Mono-D fame is working on debugging
- nazriel (8/15) May 28 2013 If I suspect what block of code may be causing a problem:
- Timothee Cour (2/18) May 28 2013 not on OSX, where demangling doesn't work (but the OP mentioned linux).
- Timon Gehr (2/8) May 28 2013 writeln, assert, gdb.
This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working with D but up until now i haven't need one. Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux.
May 27 2013
On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote:This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working with D but up until now i haven't need one. Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux.I am use Geany + gdb in Linux. A little frustrating that the Geany's GUI don't shows CPU registers, but . Need to compile with this arguments for working with gdb: dmd -unittest -gc -debug -debug=5
May 27 2013
On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote:Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux.I just use gdb with dmd's -gc -debug flags, when I use a debugger at all. tbh I kinda prefer just littering assert()'s and sometimes invariant(){}'s throughout the code as a kind of printf debugging, then leave them there once the bug is fixed so hopefully it doesn't come back. But when that doesn't help, gdb is pretty trusty on linux.
May 27 2013
On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote:This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working with D but up until now i haven't need one. Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux.I know Alexander Bothe of Mono-D fame is working on debugging support for it: http://mono-d.alexanderbothe.com/?p=997 It's still in alpha, but getting there. NMS
May 28 2013
On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote:This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working with D but up until now i haven't need one. Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux.If I suspect what block of code may be causing a problem: 1) printf's / asserts 2) comment out 3) Duck partner When it is getting worse: 4) GDB GDB plays nice with D so it is smooth.
May 28 2013
On Tue, May 28, 2013 at 12:32 AM, nazriel <spam dzfl.pl> wrote:On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote:not on OSX, where demangling doesn't work (but the OP mentioned linux).This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working with D but up until now i haven't need one. Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux.If I suspect what block of code may be causing a problem: 1) printf's / asserts 2) comment out 3) Duck partner When it is getting worse: 4) GDB GDB plays nice with D so it is smooth.
May 28 2013
Then (12 months ago): If you're on linux and after VStudio style debugging in the GUI then I found QtCreator worked well. I was just using the Qt SDK bundle but it should work just from the QtCreator download (saves installing the monolithic Qt development libs). I would build the D application with -gc for C symbols and it just worked, expect for one small caveat. I had to load the D source file containing main() into the IDE editor, set a breakpoint (F9) anywhere and then: Debug->Start Debugging->Start and Debug External Application Reason for this was that QtCreator's "break at main" function would break at the real main() not _Dmain. To be expected I guess as QtCreator (aka GDB) knows nothing about D startup. Now: I haven't tried QtCreator for a while as the D compile time is so fast debugging with printfs seems to be quicker and stepping through code in the IDE. Cheers, Stewart
May 28 2013
Sorry, ignore the two lines stating "Then (12 months ago):" and "Now:". They are a cut-paste schmozzle and shouldn't be there...no edits of posts?. My middle mouse button is both a blessing an a curse :) Stewart
May 28 2013
On 05/27/2013 09:55 PM, Gary Willoughby wrote:This is quite an open ended question but i wondered how you guys debug your D programs (i'm talking about stepping through code, setting breakpoints, etc). The lack of nice IDE's with integrated debuggers is worrying when working with D but up until now i haven't need one. Now i've started to write much larger programs, i'm wondering which debuggers do you use? Especially using Linux.writeln, assert, gdb.
May 28 2013