digitalmars.D.learn - line numbers in linux stack traces?
- Nick Sabalausky (6/6) Oct 05 2014 I know this keeps getting asked every year or so, but I couldn't find
- Vladimir Panteleev (12/19) Oct 05 2014 Not the ones that the program itself prints on an unhandled
- yazd (6/27) Oct 07 2014 Btw, I have some code that parses elf/dwarf and maps addresses to
- Sag Academy (2/8) Oct 07 2014 yeah, I got that problem two or three times.
I know this keeps getting asked every year or so, but I couldn't find recent info. Are line numbers in linux stack traces supposed to be working at this point? Because I'm not getting any with 2.066.0 with either -g or -gc even when running under gdb. Kind of a pain, esp. compared to D dev on windows.
Oct 05 2014
On Sunday, 5 October 2014 at 09:10:06 UTC, Nick Sabalausky wrote:I know this keeps getting asked every year or so, but I couldn't find recent info. Are line numbers in linux stack traces supposed to be working at this point?Not the ones that the program itself prints on an unhandled exception. The main problem is with licensing (GPL). See here for details: https://d.puremagic.com/issues/show_bug.cgi?id=1001Because I'm not getting any with 2.066.0 with either -g or -gc even when running under gdb. Kind of a pain, esp. compared to D dev on windows.It should work when running under gdb. Make sure you're using a recent gdb and you're not stripping the binary. If you link as a separate step, you may need to pass -g to DMD during linking as well. For delegates invoked through the runtime, or to see stack traces of crashes inside the runtime/phobos, you may need to rebuild Phobos and Druntime with -gs. Don't use -gc, it is no longer relevant.
Oct 05 2014
On Sunday, 5 October 2014 at 17:12:28 UTC, Vladimir Panteleev wrote:On Sunday, 5 October 2014 at 09:10:06 UTC, Nick Sabalausky wrote:Btw, I have some code that parses elf/dwarf and maps addresses to file/line information here: https://github.com/yazd/elf-d It can be adapted for druntime and used to show better stack traces.I know this keeps getting asked every year or so, but I couldn't find recent info. Are line numbers in linux stack traces supposed to be working at this point?Not the ones that the program itself prints on an unhandled exception. The main problem is with licensing (GPL). See here for details: https://d.puremagic.com/issues/show_bug.cgi?id=1001Because I'm not getting any with 2.066.0 with either -g or -gc even when running under gdb. Kind of a pain, esp. compared to D dev on windows.It should work when running under gdb. Make sure you're using a recent gdb and you're not stripping the binary. If you link as a separate step, you may need to pass -g to DMD during linking as well. For delegates invoked through the runtime, or to see stack traces of crashes inside the runtime/phobos, you may need to rebuild Phobos and Druntime with -gs. Don't use -gc, it is no longer relevant.
Oct 07 2014
On Sunday, 5 October 2014 at 09:10:06 UTC, Nick Sabalausky wrote:I know this keeps getting asked every year or so, but I couldn't find recent info. Are line numbers in linux stack traces supposed to be working at this point? Because I'm not getting any with 2.066.0 with either -g or -gc even when running under gdb. Kind of a pain, esp. compared to D dev on windows.yeah, I got that problem two or three times.
Oct 07 2014