mbox series

[v2,0/2] Add testcase for libc memory operations

Message ID 20240421222657.1052635-1-thiago.bauermann@linaro.org
Headers show
Series Add testcase for libc memory operations | expand

Message

Thiago Jung Bauermann April 21, 2024, 10:26 p.m. UTC
Hello,

v2 addresses a test failure on armv8l-linux-gnueabihf found by the
Linaro CI (I forgot to try the testcase on that platform...).  The problem
was that the machine used by the CI needs hardware watchpoints to be
aligned to 4 bytes, or else GDB fails with:

  (gdb) watch -location c[31]
  Hardware watchpoint 4: -location c[31]
  (gdb) continue
  Continuing.
  Unexpected error setting watchpoint: Invalid argument.
  (gdb) 

After fixing this problem, the testcase uncovered a real bug, filed as
PR breakpoints/31665 and kfailed in the testcase.

Patch 1 is the same as v1, only patch 2 has changes.

Original cover letter below:

In PR testsuite/31484, Tom de Vries suggests adding testcases that
excercise memset/memcpy/memmove and set watchpoints.

Patch 2 adds such testcase.  See its description for a bit more on the
motivation.  Patch 1 factors out code to check whether libc debug info is
available, which is needed for the new testcase.

Thiago Jung Bauermann (2):
  gdb/testsuite: Add libc_has_debug_info require helper
  gdb/testsuite: Add gdb.base/memops-watchpoint.exp

 gdb/testsuite/gdb.base/memops-watchpoint.c   | 45 ++++++++++
 gdb/testsuite/gdb.base/memops-watchpoint.exp | 86 ++++++++++++++++++++
 gdb/testsuite/gdb.base/relativedebug.exp     | 13 +--
 gdb/testsuite/lib/gdb.exp                    | 54 ++++++++++++
 4 files changed, 186 insertions(+), 12 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/memops-watchpoint.c
 create mode 100644 gdb/testsuite/gdb.base/memops-watchpoint.exp


base-commit: 20eee7540b9f2615f7661393756fec0bb62a1495