www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - line number information with dmd and gdb

reply "Tobias Pankrath" <tobias pankrath.net> writes:
Hey,

I've run into problems when debugging a program of mine using gdb 
(7.4.1) and dmd (2.59 / 2.60).

While running the program in a step by step fashion it occurs 
that the current line jumps back and forth. So I'm more less 
blind till the line number information turns correct again. Sadly 
I've yet to reduce this problem to a program that's fit for a bug 
report.

Does anyone have this problem, too? Any workarounds?

Thanks
Jul 01 2012
next sibling parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 7/1/2012 10:24 AM, Tobias Pankrath wrote:
 Hey,

 I've run into problems when debugging a program of mine using gdb
 (7.4.1) and dmd (2.59 / 2.60).

 While running the program in a step by step fashion it occurs that the
 current line jumps back and forth. So I'm more less blind till the line
 number information turns correct again. Sadly I've yet to reduce this
 problem to a program that's fit for a bug report.

 Does anyone have this problem, too? Any workarounds?

 Thanks
I've seen that, too, but haven't analyzed it thoroughly, because I've been getting used to these. Some unexpected cases from the top of my head (seen on windows, but I guess the problem is OS independent): - line numbers inside templates are sometimes off by 1 - line numbers within string mixins including line breaks overlap with the following source code - implicite struct destructors might jump back to the place of the construction - code like this: if(condition) return; code; sometimes steps into the line of the "return" statement, even if the condition is false, but then continues with the code - passing default arguments jumps to the function definition, returns to the invocation before the call, then jumps there again. Very frustrating if you think you can skip the function call by using "until return/finish" - it is sometimes hard to step into/out of foreach loops, because there is too much magic involved
Jul 03 2012
parent "Blackcat345" <blackcat345345 gmail.com> writes:
I've been messing around with this for a couple of hours, and I'm 
having difficulty determining whether gdb on OS X can be used 
with DMD at all (it seems to work ok with gdc). I've tried 
compiling with both -g and -gc switches.
Dec 14 2014
prev sibling parent "kiranlucky" <kiran_asif_222 yahoo.com> writes:
On Sunday, 1 July 2012 at 08:24:14 UTC, Tobias Pankrath wrote:
 Hey,

 I've run into problems when debugging a program of mine using 
 gdb (7.4.1) and dmd (2.59 / 2.60).

 While running the program in a step by step fashion it occurs 
 that the current line jumps back and forth. So I'm more less 
 blind till the line number information turns correct again. 
 Sadly I've yet to reduce this problem to a program that's fit 
 for a bug report.

 Does anyone have this problem, too? Any workarounds?

 Thanks
very nice.http://www.kiransweet.com/
Jul 22 2012