master: GDB test failures
If you look at a Travis log for the currently red master, you'll see that there are some failing tests that use a GDB script to check for debug info generation. Some of these fail with "unknown symbol" error messages. However, I can't reproduce those on an Ubuntu 14.04 box with
gdb --version
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Does anybody else have more luck?
Same gdb as you, gdb-related failures using LLVM 3.7 when invoking ctest -R dmd-testsuite:
dmd-testsuite-debug:
-
runnable/gdb14313.d: expected regex.*4000065002, actual$1 = -294902294
dmd-testsuite:
-
runnable/gdb14276.d: expected.*1234, actualError in sourced command file: value has been optimized out;) -
runnable/gdb14330.d: expected.*something, actual$1 = <error reading variable> -
runnable/gdb4149.d: expected.*33, actual$1 = 32
The following tests are now temporarily disabled on master (some already have been for quite some time):
DISABLED_TESTS += gdb1
DISABLED_TESTS += gdb4149
DISABLED_TESTS += gdb4181
DISABLED_TESTS += gdb10311
DISABLED_TESTS += gdb14225
DISABLED_TESTS += gdb14276
DISABLED_TESTS += gdb14313
DISABLED_TESTS += gdb14330
Somebody needs to sit down and spend some time on debug info soon. Now that we only support 3.5+ this should be quite a bit easier.
With gdb 7.11.1, LDC master, LLVM 3.9 and Linux x64 (Xubuntu 16.04), all gdb tests pass when performed manually EXCEPT for gdb10311 (captured local showing up as <optimized out> - it shows up correctly in line 18 though).
Inside dmd-testsuite-debug they all fail though, due to:
No line <N> in the current file.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
If I execute the two commands in the tests/d2/dmd-testsuite directory (compile + gdb batch run), it all works:
(gdb) b 19
Breakpoint 1 at 0x401e44: file gdb10311.d, line 19.
???
Maybe an issue with absolute/relative source paths?
No line <N> in the current file.
The trouble is that the current file is usually "." at startup. If I change that bad default in ldc::DIBuilder::CreateFile to IR->dmodule->srcfile->toChars(), I get __entrypoint.d as the current file ;-(
Most gdb scripts pass if I add a switch to the actual test file in d_do_test, e.g. list gdb1.d:1,1.
I still see 2 errors:
- gdb10311: captured local showing up as
<optimized out>. Inside the delegate, gdb printsCannot access memory at address 0x0 - gdb14313: variable of type
uintis displayed as signed.ushortworks correctly.
With https://github.com/ldc-developers/ldc/pull/1784, only gdb10311 remains disabled. Shall we close this issue?
Don't know if that's related, but there are still some tests failure with GDB 11.1.
Failed Tests (2): LDC :: debuginfo/classtypes_gdb.d LDC :: debuginfo/print_gdb.d