diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-03-01 04:39:36 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-03-01 04:39:36 +0000 |
commit | c03374d554a6d5f326a0d356a2e0918961bc1cfb (patch) | |
tree | 5e78e840af0460012c9368fbc4189b90654e407d /gdb/config | |
parent | 16fb4e2d3a147568e4e6b00c82adcf447ba10ffe (diff) | |
download | gdb-c03374d554a6d5f326a0d356a2e0918961bc1cfb.zip gdb-c03374d554a6d5f326a0d356a2e0918961bc1cfb.tar.gz gdb-c03374d554a6d5f326a0d356a2e0918961bc1cfb.tar.bz2 |
* Makefile.in (i386-nat.o): Update.
* amd64-linux-nat.c (_initialize_amd64_linux_nat): Call
i386_use_watchpoints.
* i386-linux-nat.c (_initialize_i386_linux_nat): Call
i386_use_watchpoints.
* i386-nat.c (i386_stopped_data_address): Take two arguments.
(i386_stopped_by_watchpoint): Update call.
(i386_can_use_hw_breakpoint, i386_use_watchpoints): New.
* config/i386/nm-i386.h: Conditionalize definitions on
! I386_WATCHPOINTS_IN_TARGET_VECTOR.
(i386_use_watchpoints): Declare.
(i386_stopped_data_address): Update.
* config/i386/nm-linux.h (I386_WATCHPOINTS_IN_TARGET_VECTOR): Define.
* config/i386/nm-linux64.h (I386_WATCHPOINTS_IN_TARGET_VECTOR): Define.
Diffstat (limited to 'gdb/config')
-rw-r--r-- | gdb/config/i386/nm-i386.h | 18 | ||||
-rw-r--r-- | gdb/config/i386/nm-linux.h | 1 | ||||
-rw-r--r-- | gdb/config/i386/nm-linux64.h | 1 |
3 files changed, 16 insertions, 4 deletions
diff --git a/gdb/config/i386/nm-i386.h b/gdb/config/i386/nm-i386.h index d46b8b3..090cc42 100644 --- a/gdb/config/i386/nm-i386.h +++ b/gdb/config/i386/nm-i386.h @@ -24,6 +24,11 @@ /* Targets should define this to use the generic x86 watchpoint support. */ #ifdef I386_USE_GENERIC_WATCHPOINTS +/* Add watchpoint methods to the provided target_ops. Targets which call + this should also define I386_WATCHPOINTS_IN_TARGET_VECTOR. */ +struct target_ops; +void i386_use_watchpoints (struct target_ops *); + /* Clear the reference counts and forget everything we knew about DRi. */ extern void i386_cleanup_dregs (void); @@ -48,7 +53,7 @@ extern int i386_stopped_by_hwbp (void); /* If the inferior has some break/watchpoint that triggered, set the address associated with that break/watchpoint and return true. Otherwise, return false. */ -extern int i386_stopped_data_address (CORE_ADDR *); +extern int i386_stopped_data_address (struct target_ops *, CORE_ADDR *); /* Insert a hardware-assisted breakpoint at BP_TGT->placed_address. Return 0 on success, EBUSY on failure. */ @@ -59,6 +64,10 @@ extern int i386_insert_hw_breakpoint (struct bp_target_info *bp_tgt); Return 0 on success, -1 on failure. */ extern int i386_remove_hw_breakpoint (struct bp_target_info *bp_tgt); +extern int i386_stopped_by_watchpoint (void); + +#ifndef I386_WATCHPOINTS_IN_TARGET_VECTOR + /* Returns the number of hardware watchpoints of type TYPE that we can set. Value is positive if we can set CNT watchpoints, zero if setting watchpoints of type TYPE is not supported, and negative if @@ -90,11 +99,10 @@ extern int i386_remove_hw_breakpoint (struct bp_target_info *bp_tgt); #define HAVE_CONTINUABLE_WATCHPOINT 1 -extern int i386_stopped_by_watchpoint (void); - #define STOPPED_BY_WATCHPOINT(W) (i386_stopped_by_watchpoint () != 0) -#define target_stopped_data_address(target, x) i386_stopped_data_address(x) +#define target_stopped_data_address(target, x) \ + i386_stopped_data_address(target, x) /* Use these macros for watchpoint insertion/removal. */ @@ -110,6 +118,8 @@ extern int i386_stopped_by_watchpoint (void); #define target_remove_hw_breakpoint(bp_tgt) \ i386_remove_hw_breakpoint (bp_tgt) +#endif /* I386_WATCHPOINTS_IN_TARGET_VECTOR */ + #endif /* I386_USE_GENERIC_WATCHPOINTS */ #endif /* NM_I386_H */ diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h index 3ee3ecd..755e0d7 100644 --- a/gdb/config/i386/nm-linux.h +++ b/gdb/config/i386/nm-linux.h @@ -23,6 +23,7 @@ /* GNU/Linux supports the i386 hardware debugging registers. */ #define I386_USE_GENERIC_WATCHPOINTS +#define I386_WATCHPOINTS_IN_TARGET_VECTOR #include "i386/nm-i386.h" #include "config/nm-linux.h" diff --git a/gdb/config/i386/nm-linux64.h b/gdb/config/i386/nm-linux64.h index 02608fb..7bf273b 100644 --- a/gdb/config/i386/nm-linux64.h +++ b/gdb/config/i386/nm-linux64.h @@ -25,6 +25,7 @@ /* GNU/Linux supports the i386 hardware debugging registers. */ #define I386_USE_GENERIC_WATCHPOINTS +#define I386_WATCHPOINTS_IN_TARGET_VECTOR #include "i386/nm-i386.h" #include "config/nm-linux.h" |