digitalmars.D.bugs - [Issue 8172] New: OSX: symbols mangled on gdb,ggdb,cgdb,lldb but not on ubuntu; no line numbers on stacktraces
- d-bugmail puremagic.com (68/68) May 31 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (11/11) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (8/10) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (6/6) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (7/8) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (9/9) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (9/14) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (11/11) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
- d-bugmail puremagic.com (9/11) Jun 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8172
http://d.puremagic.com/issues/show_bug.cgi?id=8172 Summary: OSX: symbols mangled on gdb,ggdb,cgdb,lldb but not on ubuntu; no line numbers on stacktraces Product: D Version: D2 Platform: All OS/Version: Mac OS X Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: thelastmammoth gmail.com --- Comment #0 from thelastmammoth gmail.com 2012-05-31 00:54:11 PDT --- I'm trying to have proper debug info for D on OSX (D2, 2.059 but it shouldn't matter). Currently I can only do that on ubuntu. I see several posts about this topic but they seem out of date and the information is scattered. I tried several options: **** A) OSX 1) gdb (default provided by apple: gdb 6.3.50) 2) ggdb (from macports: version 7.3) => doesn't seem to work at all even for simple C hello world 3) gdb-7.4.1 (manual build from gdb website, somehow requires to run as sudo otherwise complains : please check gdb is codesigned - see taskgated, but despite instructions online running as sudo was the only way to make it work) 4) cgdb 5) lldb B) Ubuntu 1) gdb 7.2 (according to http://www.dsource.org/projects/gdb-patches, a patch for D is part of GDB " as of 7.2) **** I'm compiling a simple hello world with a forced seg fault: compiled with dmd -g main.d. cat main.d: module main; void fun(){int *x = null; *x = 1;} void main(){fun;} Here are the results on $debugger_name main: A.1: mangled names, line numbers: 0x00000001000014e3 in _D4main3funFZv () at main.d:2 A.2: just addresses: 0x000000010bb5a4e3 in ?? () A.3: mangled names, no line numbers: 0x00000001000014e3 in D4main3funFZv () A.4: mangled names, line numbers: 0x00000001000014e3 in _D4main3funFZv () at main.d:2 A.5: mangled names, line numbers: frame #0: 0x00000001000014e3 main`D4main3funFZv + 15 at main.d:2 B.1: demangled names, line numbers 0x00000000004016c7 in main.fun () at main.d:2 Note, even on OSX the D demangling would be easy via dfilt or ddemangle [cf git repo: dmd/tools/ddemangle.d for a tool or dmd/druntime/src/core/demangle.d for the function]): dfilt D4fun25fun2bFPiZv => void main.fun() Would you have any ideas how to make it work on OSX? **** Another related issue is wrt stacktraces: the situation is reversed, ie it displays the demangled names, but no line numbers: 6 main2 0x000000010b6b94db void main.__assert(int) + 23 There were some previous threads about requiring to add to dmd.conf "-L--export-dynamic" but that will not let dmd run. I'm not sure whether it's relevant, but I am able to get proper stack traces in C++ programs on OSX using code similar to http://www.tekkotsu.org/dox/StackTrace_8h.html **** btw is there a way to print stack trace without having an assertion failed in D? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 31 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 klickverbot <code klickverbot.at> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |code klickverbot.at --- Comment #1 from klickverbot <code klickverbot.at> 2012-06-07 15:43:29 PDT --- Issue 8208 might be related, depending on how the GDB patches expect the mangled names. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 --- Comment #2 from thelastmammoth gmail.com 2012-06-07 16:09:16 PDT --- (In reply to comment #1)Issue 8208 might be related, depending on how the GDB patches expect the mangled names.Did you mean Issue 8207? I would LOVE to see this resolved ASAP, this issue has been there for a while! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 --- Comment #3 from klickverbot <code klickverbot.at> 2012-06-07 16:10:21 PDT --- Oh, yes, the perils of _not_ using copy and paste… ;) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 --- Comment #4 from thelastmammoth gmail.com 2012-06-07 16:13:16 PDT --- (In reply to comment #3)Oh, yes, the perils of _not_ using copy and paste… ;)does your intended pull request solve this issue on OSX ? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 --- Comment #5 from klickverbot <code klickverbot.at> 2012-06-07 16:20:49 PDT --- Didn't try yet; I didn't have too much luck with getting newer (non-Apple) GDB versions to reliably work so far. For LLDB to display demangled names, somebody would need to write a LLDB patch/plugin for D, which, to my knowledge, has not happened yet. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 --- Comment #6 from thelastmammoth gmail.com 2012-06-07 16:25:22 PDT --- (In reply to comment #5)Didn't try yet; I didn't have too much luck with getting newer (non-Apple) GDB versions to reliably work so far. For LLDB to display demangled names, somebody would need to write a LLDB patch/plugin for D, which, to my knowledge, has not happened yet.newer, non-apple gdb versions work on osx, but have to be run under sudo in my experience; I could try myself if I had your pull request to see if it resolves this issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 klickverbot <code klickverbot.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |8207 --- Comment #7 from klickverbot <code klickverbot.at> 2012-06-07 16:35:46 PDT --- With my preliminary patches and GDB 7.4.1, name demangling in GDB indeed seems to work. Added a dependency on Issue 8207. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8172 --- Comment #8 from thelastmammoth gmail.com 2012-06-07 16:43:57 PDT --- (In reply to comment #7)With my preliminary patches and GDB 7.4.1, name demangling in GDB indeed seems to work. Added a dependency on Issue 8207.wonderful, at last! btw did you figure out a way to run the new gdb without sudo on osx? looking forward for your patch -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 07 2012