[0/2] linux-nat: Fix watchpoint issues across exec calls

Message ID 20190516201218.29403-1-pedromfc@linux.ibm.com
Headers show
Series
  • linux-nat: Fix watchpoint issues across exec calls
Related show

Message

Pedro Franco de Carvalho May 16, 2019, 8:12 p.m.
These two patches are intended to fix an issue caused by calls to exec
when hardware breakpoints and watchpoints are in use.  Currently, the
linux native targets don't correctly keep track of debug register usage
across exec calls.

I've implemented this for the x86 linux target, but this likely affects
other native linux targets that keep track of debug registers (e.g. s390
and ARM).

I found these issues while fixing other issues with watchpoints for the
native linux on Power target.  I'm still working on those, and will
incorporate the changes needed for using watchpoints with exec with them.

Pedro Franco de Carvalho (2):
  linux-nat: Callback for exec events
  x86 linux: Update debug register state after exec events

 gdb/linux-nat.c                            |  4 ++
 gdb/linux-nat.h                            | 13 ++++++
 gdb/testsuite/gdb.base/watchpoint-exec.c   | 48 ++++++++++++++++++++
 gdb/testsuite/gdb.base/watchpoint-exec.exp | 53 ++++++++++++++++++++++
 gdb/x86-linux-nat.h                        |  3 ++
 gdb/x86-nat.c                              | 15 ++++--
 gdb/x86-nat.h                              |  8 +++-
 7 files changed, 140 insertions(+), 4 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/watchpoint-exec.c
 create mode 100644 gdb/testsuite/gdb.base/watchpoint-exec.exp

-- 
2.20.1