ldc icon indicating copy to clipboard operation
ldc copied to clipboard

master: GDB test failures

Open dnadlinger opened this issue 10 years ago • 8 comments

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?

dnadlinger avatar Nov 03 '15 11:11 dnadlinger

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, actual Error 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

kinke avatar Nov 03 '15 22:11 kinke

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.

dnadlinger avatar Nov 08 '15 00:11 dnadlinger

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).

kinke avatar Jul 31 '16 19:07 kinke

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.

???

kinke avatar Jul 31 '16 19:07 kinke

Maybe an issue with absolute/relative source paths?

dnadlinger avatar Jul 31 '16 20:07 dnadlinger

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 prints Cannot access memory at address 0x0
  • gdb14313: variable of type uint is displayed as signed. ushort works correctly.

rainers avatar Sep 03 '16 09:09 rainers

With https://github.com/ldc-developers/ldc/pull/1784, only gdb10311 remains disabled. Shall we close this issue?

kinke avatar Sep 26 '16 23:09 kinke

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

apteryks avatar Oct 28 '21 05:10 apteryks