Re: macOS: debugging hell - strange behavior in lldb and gdb

2017-02-14 Thread John Colvin via Digitalmars-d-debugger
On Tuesday, 14 February 2017 at 23:35:15 UTC, Relja Ljubobratovic 
wrote:

On Tuesday, 14 February 2017 at 20:32:53 UTC, John Colvin wrote:
The docs say it is, but they could be wrong. Could you run dub 
with -v (and without any manually added -gc) and share the 
output?


Sure, here's what I'd think is the relevant part:
Performing "debug" build using ldc2 for x86_64.
File '/Users/relja/Projects/dlangplayground/dub.json' modified, 
need rebuild.

dlangplayground ~master: building configuration "application"...
ldc2 -mcpu=haswell 
-of.dub/build/application-debug-posix.osx-x86_64-ldc_2071-A59B2D18A3A7E59FF17DA8905B6773B0/dlangplayground -d-debug -g -w -oq -od=.dub/obj -d-version=Have_dlangplayground -Isource/ source/app.d -vcolumns


So, no -gc.


-g is there though, which is actually what the docs say.

gdb should suppport D (assuming it's not an ancient gdb), so -g 
should be better there. Overall, gdb is a better debugger for D. 
-g means D debug info, -gc means pretend to be C.


The most portable way to get -gc in your debug builds, add this 
to the project's dub.sdl

buildType "debug" {
buildOptions "debugMode" "debugInfoC"
}
or if you're using dub.json:
"buildTypes": {
"debug": {
"buildOptions": ["debugMode", "debugInfoC"]
}
}


Btw. it seems like I'm using dub v1.1.2 from homebrew:
$ dub --version
DUB version unknown, built on Jan 16 2017

$ readlink /usr/local/bin/dub
../Cellar/dub/1.1.2/bin/dub

I'll test this with newer releases in the next few days, and if 
situation is the same, I'll file a bug.


Once again, thanks man - feels fantastic having a debugger once 
again! :)


Cheers,
Relja


I maintain the D packages in homebrew, so let me know if you have 
any problems. homebrew is up to date with the latest stable dub 
release, so a quick brew update && brew upgrade dub should get 
you up to date..


Re: macOS: debugging hell - strange behavior in lldb and gdb

2017-02-14 Thread Relja Ljubobratovic via Digitalmars-d-debugger

On Tuesday, 14 February 2017 at 20:32:53 UTC, John Colvin wrote:
The docs say it is, but they could be wrong. Could you run dub 
with -v (and without any manually added -gc) and share the 
output?


Sure, here's what I'd think is the relevant part:
Performing "debug" build using ldc2 for x86_64.
File '/Users/relja/Projects/dlangplayground/dub.json' modified, 
need rebuild.

dlangplayground ~master: building configuration "application"...
ldc2 -mcpu=haswell 
-of.dub/build/application-debug-posix.osx-x86_64-ldc_2071-A59B2D18A3A7E59FF17DA8905B6773B0/dlangplayground -d-debug -g -w -oq -od=.dub/obj -d-version=Have_dlangplayground -Isource/ source/app.d -vcolumns


So, no -gc.

Btw. it seems like I'm using dub v1.1.2 from homebrew:
$ dub --version
DUB version unknown, built on Jan 16 2017

$ readlink /usr/local/bin/dub
../Cellar/dub/1.1.2/bin/dub

I'll test this with newer releases in the next few days, and if 
situation is the same, I'll file a bug.


Once again, thanks man - feels fantastic having a debugger once 
again! :)


Cheers,
Relja


Re: macOS: debugging hell - strange behavior in lldb and gdb

2017-02-14 Thread John Colvin via Digitalmars-d-debugger
On Tuesday, 14 February 2017 at 18:08:18 UTC, Relja Ljubobratovic 
wrote:

On Tuesday, 14 February 2017 at 15:37:34 UTC, John Colvin wrote:
On Sunday, 12 February 2017 at 10:27:38 UTC, Relja 
Ljubobratovic wrote:

Hey guys,

I've had zero luck with debuggers on macOS. Here's the story:

[...]


You might find adding symbolic debug info will be useful, 
which is done with -g or -gc.


That did it! With -gc lldb works properly. Thank you John!

Any reason this flag is not included on dub --build=debug 
--compiler=ldc2?


The docs say it is, but they could be wrong. Could you run dub 
with -v (and without any manually added -gc) and share the output?


Re: macOS: debugging hell - strange behavior in lldb and gdb

2017-02-14 Thread John Colvin via Digitalmars-d-debugger
On Sunday, 12 February 2017 at 10:27:38 UTC, Relja Ljubobratovic 
wrote:

Hey guys,

I've had zero luck with debuggers on macOS. Here's the story:

[...]


You might find adding symbolic debug info will be useful, which 
is done with -g or -gc. You might also want to experiment with 
the --debuglib settings and/or --link-debuglib for dealing with 
phobos.