line number information with dmd and gdb

Rainer Schuetze r.sagitario at gmx.de
Tue Jul 3 11:16:02 PDT 2012



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



More information about the Digitalmars-d-debugger mailing list