]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add regression test for PR gdb/19858 (JIT code registration on attach)
authorPedro Alves <palves@redhat.com>
Thu, 31 Mar 2016 18:28:47 +0000 (19:28 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 31 Mar 2016 18:36:09 +0000 (19:36 +0100)
commit85af34ee0211eedf8d30a5c44dfc59dddf8b512a
tree8d0d69388894bae50f6a12e9a3fdfacebb7a6c96
parent89df5d6cce0e91c4b34c7a62ba4a68756a8ed4e7
Add regression test for PR gdb/19858 (JIT code registration on attach)

This test would fail without the previous gdb/jit.c fix:

  (gdb) attach 23031
  Attaching to program: .../build/gdb/testsuite/outputs/gdb.base/jit/jit-main, process 23031
  [...]
  207           WAIT_FOR_GDB; i = 0;  /* gdb break here 1 */
  (gdb) PASS: gdb.base/jit.exp: attach: one_jit_test-2: attach
  set var wait_for_gdb = 0
  (gdb) PASS: gdb.base/jit.exp: attach: one_jit_test-2: set var wait_for_gdb = 0
  info function ^jit_function
  All functions matching regular expression "^jit_function":
  (gdb) FAIL: gdb.base/jit.exp: attach: one_jit_test-2: info function ^jit_function

gdb/testsuite/ChangeLog:
2016-03-31  Pedro Alves  <palves@redhat.com>

PR gdb/19858
* gdb.base/jit-main.c: Include unistd.h.
(ATTACH): Define to 0 if not already defined.
(wait_for_gdb, mypid): New globals.
(WAIT_FOR_GDB): New macro.
(MAIN): Set an alarm.  Store the process's pid.  Wait for GDB at
some breakpoint locations.
* gdb.base/jit.exp (clean_reattach, continue_to_test_location):
New procedures.
(one_jit_test): Add REATTACH parameter, and handle it.  Use
continue_to_test_location.
(top level): Test attach, and adjusts calls to one_jit_test.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/jit-main.c
gdb/testsuite/gdb.base/jit.exp