aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-nat.h
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2009-05-14 09:37:00 +0000
committerPierre Muller <muller@sourceware.org>2009-05-14 09:37:00 +0000
commit9bb9e8ade770027f5cced2856574e2d317b15254 (patch)
treef003486763df1c1d30ac87826befffa182dad837 /gdb/i386-nat.h
parent7a893eb8c1c037df38184beb7d993222a68d7c3d (diff)
downloadfsf-binutils-gdb-9bb9e8ade770027f5cced2856574e2d317b15254.zip
fsf-binutils-gdb-9bb9e8ade770027f5cced2856574e2d317b15254.tar.gz
fsf-binutils-gdb-9bb9e8ade770027f5cced2856574e2d317b15254.tar.bz2
Remove all i386 debug register low level macros in config nm files.
(I386_DR_LOW_SET_ADDR, I386_DR_LOW_RESET_ADDR): Remove. (I386_DR_LOW_GET_STATUS, I386_DR_LOW_SET_CONTROL): Remove. (I386_USE_GENERIC_WATCHPOIINTS): Remove. * i386-nat.h: New file (adapted from config/i386/nm-i386.h). (struct i386_dr_low_type): New type. (i386_dr_low): New global variable. * i386-nat.c (TARGET_HAS_DR_LEN_8): Update macro. (i386_insert_aligned_watchpoint): Replace i386 dr low macros by i386_dr_low struct variable fields. (i386_remove_aligned_watchpoint): Likewise. (i386_stopped_data_address): Likewise. (i386_stopped_by_hwbp): Likewise. (show_debug_regs_command_added): New static variable. (add_show_debug_regs_command): New static function. (i386_use_watchpoints): Call add_show_debug_regs_command if not done. (i386_set_debug_register_length): New function. (_initialize_i386_nat): Delete. * amd64-linux-nat.c: Include "i386-nat.h". (amd64_linux_dr_set_control): Change to static. (amd64_linux_dr_get_status): Change to static. (amd64_linux_dr_set_addr,amd64_linux_dr_reset_addr): Likewise. (_initialize_amd64_linux_nat): Set i386_dr_low variable fields. * go32-nat.c: Include "i386-nat.h". (go32_set_addr): Change to static. (go32_set_dr7): Change to static. Change arg type to unisgned long. (go32_get_dr6): Change to static. Change return type to unisnged long. (init_go32_ops): Set i386_dr_low variable fields. * i386-linux-nat.c: Include "i386-nat.h". (i386_linux_dr_set_control, i386_linux_dr_get_status): Change to static. (i386_linux_dr_set_addr, i386_linux_dr_reset_addr): Idem. (_initialize_i386_linux_nat): Set i386_dr_low variable fields. * i386bsd-nat.h: Declare functions used for i386_dr_low fields in i386fbsd-nat.c. * i386fbsd-nat.c: Include "i386-nat.h". (_initialize_i386fbsd_nat): Set i386_dr_low variable fields. * windows-nat.c: Include "i386-nat.h". (cygwin_set_dr, cygwin_get_dr6, cygwin_set_dr7): Add prototypes. Change to static. (cygwin_get_dr6): Change return type to unisnged long. (cygwin_set_dr7): Change arg type to unisgned long. (init_windows_ops): Set i386_dr_low function fields. * amd64-windows-nat.c (_initialize_amd64_windows_nat): Call i386_set_debug_register_length. * i386-windows-nat.c (_initialize_i386_windows_nat): Likewise. * config/i386/nm-cygwin.h: Remove all I386_* macros. * config/i386/nm-cygwin64.h: Likewise. * config/i386/nm-fbsd.h: Likewise. * config/i386/nm-linux.h: Likewise. * config/i386/nm-i386.h: Remove completely. * config/i386/nm-go32.h: Remove completely. * config/i386/nm-linux64.h: Remove completely. * config/i386/go32.mh (NAT_FILE): Remove entry. * config/i386/linux64.h (NAT_FILE): Change to config/nm-linux.h.
Diffstat (limited to 'gdb/i386-nat.h')
-rw-r--r--gdb/i386-nat.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/gdb/i386-nat.h b/gdb/i386-nat.h
new file mode 100644
index 0000000..f49b9f6
--- /dev/null
+++ b/gdb/i386-nat.h
@@ -0,0 +1,89 @@
+/* Native-dependent code for the i386.
+
+ Low level functions to implement Oeprating System specific
+ code to manipulate I386 debug registers.
+
+ Copyright (C) 2009
+ 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/>. */
+
+#include "defs.h"
+
+#ifndef I386_NAT_H
+#define I386_NAT_H 1
+
+/* Hardware-assisted breakpoints and watchpoints. */
+
+/* Add watchpoint methods to the provided target_ops.
+ Targets using i386 family debug registers for watchpoints should call
+ this. */
+struct target_ops;
+extern void i386_use_watchpoints (struct target_ops *);
+
+/* Support for hardware watchpoints and breakpoints using the i386
+ debug registers.
+
+ This provides several functions for inserting and removing
+ hardware-assisted breakpoints and watchpoints, testing if one or
+ more of the watchpoints triggered and at what address, checking
+ whether a given region can be watched, etc.
+
+ In addition, each target should provide several low-level functions
+ regrouped into i386_dr_low_type struct below. These functions
+ that will be called to insert watchpoints and hardware breakpoints
+ into the inferior, remove them, and check their status. These
+ functions are:
+
+ set_control -- set the debug control (DR7)
+ register to a given value
+
+ set_addr -- put an address into one debug
+ register
+
+ reset_addr -- reset the address stored in
+ one debug register
+
+ get_status -- return the value of the debug
+ status (DR6) register.
+
+ Additionally, the native file should set the debug_register_length
+ field to 4 or 8 depending on the number of bytes used for
+ deubg registers. */
+
+struct i386_dr_low_type
+ {
+ void (*set_control) (unsigned long);
+ void (*set_addr) (int, CORE_ADDR);
+ void (*reset_addr) (int);
+ unsigned long (*get_status) (void);
+ int debug_register_length;
+ };
+
+extern struct i386_dr_low_type i386_dr_low;
+
+/* Use this function to set i386_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 i386_set_debug_register_length (int len);
+
+/* Use this function to reset the i386-nat.c debug register state. */
+
+extern void i386_cleanup_dregs (void);
+
+#endif /* I386_NAT_H */