From 70a0bb6b590bcfe304fe082d421feb52e0a0d4dc Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Tue, 24 Mar 2015 14:05:43 +0000 Subject: Add x86_debug_reg_state to gdbserver This commit introduces a new function, x86_debug_reg_state, that shared x86 code can use to access the local mirror of a process's debug registers. This function already existed in GDB and was in use by GDB's x86_linux_prepare_to_resume. An equivalent was written for gdbserver and gdbserver's x86_linux_prepare_to_resume was modified to use it. gdb/ChangeLog: * x86-nat.h (x86_debug_reg_state): Move declaration to... * nat/x86-dregs.h (x86_debug_reg_state): New declaration. gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_debug_reg_state): New function. (x86_linux_prepare_to_resume): Use the above. --- gdb/nat/x86-dregs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/nat/x86-dregs.h') diff --git a/gdb/nat/x86-dregs.h b/gdb/nat/x86-dregs.h index a2b9926..61a97c8 100644 --- a/gdb/nat/x86-dregs.h +++ b/gdb/nat/x86-dregs.h @@ -92,6 +92,11 @@ struct x86_debug_reg_state #define ALL_DEBUG_ADDRESS_REGISTERS(i) \ for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) +/* Return a pointer to the local mirror of the debug registers of + process PID. This function must be provided by the client + if required. */ +extern struct x86_debug_reg_state *x86_debug_reg_state (pid_t pid); + /* Insert a watchpoint to watch a memory region which starts at address ADDR and whose length is LEN bytes. Watch memory accesses of the type TYPE. Return 0 on success, -1 on failure. */ -- cgit v1.1