aboutsummaryrefslogtreecommitdiff
path: root/gdb/jit.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2016-10-06 12:53:51 +0100
committerPedro Alves <palves@redhat.com>2016-10-06 12:53:51 +0100
commit5a122fbc307f35093b8fe038a8e6caa51b4d0dae (patch)
treef364fcb59be4f3a293055bfeb635cf1cabcaac77 /gdb/jit.c
parent6bd7996d3d45d9dfcbf695ec680fb43b5275ee89 (diff)
downloadgdb-5a122fbc307f35093b8fe038a8e6caa51b4d0dae.zip
gdb-5a122fbc307f35093b8fe038a8e6caa51b4d0dae.tar.gz
gdb-5a122fbc307f35093b8fe038a8e6caa51b4d0dae.tar.bz2
Fix a few gdb.base/jit-simple.exp problems
I noticed that we sometimes get this: (gdb) print &__jit_debug_descriptor $1 = (struct jit_descriptor *) 0x601040 <__jit_debug_descriptor> (gdb) PASS: gdb.base/jit-simple.exp: blah 1 [...] (gdb) run [...] Starting program: build/gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple Unsupported JIT protocol version 4 in descriptor (expected 1) Breakpoint 2, main () at src/gdb/testsuite/gdb.base/jit-simple.c:36 36 return 0; (gdb) print &__jit_debug_descriptor $2 = (struct jit_descriptor *) 0x601040 <__jit_debug_descriptor> (gdb) PASS: gdb.base/jit-simple.exp: blah 1 All tests PASSed, but note the "Unsupported JIT protocol version 4" message. Also notice that "__jit_debug_descriptor" has the same address before and after the rerun, while the test is built in a way that should make that address change between runs. The test doesn't catch any of this because it doesn't compare before/after addresses. And then notice the "blah 1" test messages. "blah" is clearly a WIP message, but it should be at least "blah 2" the second time. :-) The reason this sometimes happens is that the test recompiles the program and expects gdb to reload it automaticallyt on "run". However, if the original program and the new recompilation happen to be in the same second, then gdb does not realize that the binary needs to be reloaded. (This is an old problem out of scope of this series.) If that happens, then GDB ends up using the wrong symbols for the program that it spawns, reads the JIT descriptor out of the wrong address, finds garbage, and prints that "unsupported version" notice. Fix that in the same way gdb.base/reread.exp handles it -- by sleeping one second before recompiling. gdb/testsuite/ChangeLog: 2016-10-06 Pedro Alves <palves@redhat.com> * gdb.base/jit-simple.exp (top level) Delete get_compiler_info call. (jit_run): Delete. (jit_test_reread): Use with_test_prefix. Reload the main binary explicitly. Compare the before/after addresses of the JIT descriptor.
Diffstat (limited to 'gdb/jit.c')
0 files changed, 0 insertions, 0 deletions