GDB behaves strange with DMD

2017-07-04 Thread Gorthad via Digitalmars-d-debugger

Hello everyone.

I'm trying to debug programs compiled with DMD using GDB.
My dmd version is 2.074.1, gdb version is 7.11.1, operating 
system is Ubuntu 16.04.


I have this little helloworld.d:

import std.stdio;

void main() {
auto a = 5;

writeln("Hello, world!");

foreach (i; 0 .. 5)
a = a + i;

writeln("");
writeln(a);


}


Then I compile it with tag -g and when I try to debug it with 
GDB, I get this: pastebin.com/GJD7q9XM


As you see, GDB seems to have wrong info about line numbers.

When I compile it with tag -gc, it's basically all the same 
except I need to write 'list _Dmain' in order to access the 
source code from gdb:

pastebin.com/5TkqxEvu

In bigger projects current line in GDB can jump all over the 
place without any obvious logic.


Do you have any ideas how to fix it?
Thank you.


Re: GDB behaves strange with DMD

2017-07-07 Thread Martin Krejcirik via Digitalmars-d-debugger

Dne 4. 7. 2017 v 13:46 Gorthad napsal(a):

As you see, GDB seems to have wrong info about line numbers.


This is acually a regression since 2.072. I'll file a bug report.

--
mk


Re: GDB behaves strange with DMD

2017-09-11 Thread Gorthad via Digitalmars-d-debugger

On Friday, 7 July 2017 at 17:10:23 UTC, Martin Krejcirik wrote:

Dne 4. 7. 2017 v 13:46 Gorthad napsal(a):

As you see, GDB seems to have wrong info about line numbers.


This is acually a regression since 2.072. I'll file a bug 
report.


Could you please send a link to the bug tracker issue and/or 
provide some info about its current status?

Thank you!