Description
Transferred from: https://issues.dlang.org/show_bug.cgi?id=8173
User @thelastmammoth reported (2012-May-31 02:23:50):
Currently, running:
$ rdmd -g --build-only main && gdb main
yields:
warning: Could not find object file "/tmp/.rdmd-503/rdmd-main.d-.../main.o" - no debug information available for "main.d".
(but using the manual way with dmd works... with the names mangled but that's a different issue )
perhaps it would be possible to preserve debug info when -g (or -debug, etc) is present as opposed to having -o- (which appears when --chatty is on) ?
User @CyberShadow responded (2013-Mar-10 01:17:44):
(In reply to comment #0)
Currently, running
rdmd -g --build-only main && gdb mainyields:
warning: Could not find object file "/tmp/.rdmd-503/rdmd-main.d-.../main.o" -
no debug information available for "main.d".What OS is this on? You specified "All" but it does not apply to Windows and does not happen on Linux.
perhaps it would be possible to preserve debug info when -g (or -debug, etc) is
present as opposed to having -o- (which appears when --chatty is on) ?I can't make out any meaning from the above.
Judging by the error message, the problem is that rdmd deletes object (.o) files after a successful build.
Tried this today on OSX and could reproduce the issue. The dwarfdump
output seems correct but the debugger (lldb in my case) seems not to be able to link it to the source code (e.g. b _Dmain
gives ASM output.)