old-cross-binutils/gdb/x86-nat.h
Gary Benson 70a0bb6b59 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.
2015-03-24 14:05:43 +00:00

52 lines
1.8 KiB
C

/* Native-dependent code for x86 (i386 and x86-64).
Low level functions to implement Oeprating System specific
code to manipulate x86 debug registers.
Copyright (C) 2009-2015 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef X86_NAT_H
#define X86_NAT_H 1
#include "nat/x86-dregs.h"
/* Hardware-assisted breakpoints and watchpoints. */
/* Add watchpoint methods to the provided target_ops.
Targets using x86 family debug registers for watchpoints should call
this. */
struct target_ops;
extern void x86_use_watchpoints (struct target_ops *);
/* Use this function to set x86_dr_low debug_register_length field
rather than setting it directly to check that the length is only
set once. It also enables the 'maint set/show show-debug-regs'
command. */
extern void x86_set_debug_register_length (int len);
/* Use this function to reset the x86-nat.c debug register state. */
extern void x86_cleanup_dregs (void);
/* Called whenever GDB is no longer debugging process PID. It deletes
data structures that keep track of debug register state. */
extern void x86_forget_process (pid_t pid);
#endif /* X86_NAT_H */