June 12, 2014 Known problem? DMD commandline module order matters for debugging on amd64 linux | ||||
|---|---|---|---|---|
| ||||
I'm not sure if this is a known problem, or if it's something that I'd need to file a new bug for, but if a program is compiled with a module besides the one containing main() first on the commandline, certain debug info is clobbered on 64-bit linux.
An easy testcase, with module afunc.d:
module afunc;
auto inc (size_t var) {
return ++var;
}
and module main.d:
import afunc;
void main() {
size_t counter;
while (counter < size_t.max) {
counter++;
}
}
Compile with the following command:
$ dmd -m64 -g -ofbadsymbols afunc.d main.d
$ gdb ./badsymbols
if you run the program for a moment, then ^C and type 'print counter', gdb gives the error 'Could not find the frame base for "D main".'
However, compiling with this command:
$ dmd -m64 -g -ofgoodsymbols main.d afunc.d
using print counter in gdb will actually work.
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply