From e24d4c64ff2e89327ba84fdcc77cc557791eb3cd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 22 Mar 2001 09:35:19 +0000 Subject: * config/i386/nm-go32.h : Don't include nm-i386v.h, include nm-i386.h instead. (TARGET_HAS_HARDWARE_WATCHPOINTS, HAVE_CONTINUABLE_WATCHPOINT) (TARGET_CAN_USE_HARDWARE_WATCHPOINT, STOPPED_BY_WATCHPOINT) (TARGET_REGION_OK_FOR_HW_WATCHPOINT, DECR_PC_AFTER_HW_BREAK) (target_stopped_data_address, target_insert_watchpoint) (target_remove_watchpoint, target_insert_hw_breakpoint) (target_remove_hw_breakpoint): Don't define. (I386_USE_GENERIC_WATCHPOINTS, I386_DR_LOW_SET_CONTROL) (I386_DR_LOW_SET_ADDR, I386_DR_LOW_RESET_ADDR) (I386_DR_LOW_GET_STATUS): Define to call appropriate go32_* functions from go32-nat.c. * config/i386/go32.mh (NATDEPFILES): Add i386-nat.o. * go32-nat.c : Remove prototypes for watchpoint- related functions. Remove definitions of watchpoint-related macros. (go32_mourn_inferior): Call i386_cleanup_dregs instead of the private cleanup_dregs function. (cleanup_dregs, go32_insert_watchpoint) (go32_insert_aligned_watchpoint, go32_handle_nonaligned_watchpoint) (go32_remove_watchpoint, go32_remove_aligned_watchpoint) (go32_region_ok_for_watchpoint, go32_stopped_by_watchpoint) (go32_remove_hw_breakpoint, go32_insert_hw_breakpoint): Remove. (go32_set_dr, go32_set_dr7, go32_get_dr6): New functions. --- gdb/config/i386/go32.mh | 4 +-- gdb/config/i386/nm-go32.h | 68 ++++++++--------------------------------------- 2 files changed, 13 insertions(+), 59 deletions(-) (limited to 'gdb/config') diff --git a/gdb/config/i386/go32.mh b/gdb/config/i386/go32.mh index a1c673d..9534447 100644 --- a/gdb/config/i386/go32.mh +++ b/gdb/config/i386/go32.mh @@ -8,9 +8,9 @@ XM_FILE= xm-go32.h XDEPFILES= NAT_FILE= nm-go32.h -NATDEPFILES= go32-nat.o i387-nat.o +NATDEPFILES= go32-nat.o i386-nat.o i387-nat.o -TERMCAP= +TERMCAP= HOST_IPC= CC= gcc XM_CLIBS= -ldbg diff --git a/gdb/config/i386/nm-go32.h b/gdb/config/i386/nm-go32.h index 2258c84..70b1907 100644 --- a/gdb/config/i386/nm-go32.h +++ b/gdb/config/i386/nm-go32.h @@ -1,5 +1,5 @@ /* Native definitions for Intel x86 running DJGPP. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -20,65 +20,19 @@ #define NO_PTRACE_H -#include "i386/nm-i386v.h" +#define I386_USE_GENERIC_WATCHPOINTS -#define TARGET_HAS_HARDWARE_WATCHPOINTS +#include "i386/nm-i386.h" -/* 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 - CNT is more than the maximum number of watchpoints of type TYPE - that we can support. TYPE is one of bp_hardware_watchpoint, - bp_read_watchpoint, bp_write_watchpoint, or bp_hardware_breakpoint. - CNT is the number of such watchpoints used so far (including this - one). OTHERTYPE is non-zero if other types of watchpoints are - currently enabled. +/* Support for hardware-assisted breakpoints and watchpoints. */ - We always return 1 here because we don't have enough information - about possible overlap of addresses that they want to watch. As - an extreme example, consider the case where all the watchpoints - watch the same address and the same region length: then we can - handle a virtually unlimited number of watchpoints, due to debug - register sharing implemented via reference counts in go32-nat.c. */ +#define I386_DR_LOW_SET_CONTROL(VAL) go32_set_dr7 (VAL) +extern void go32_set_dr7 (unsigned); -#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1 +#define I386_DR_LOW_SET_ADDR(N,ADDR) go32_set_dr (N,ADDR) +extern void go32_set_dr (int, CORE_ADDR); -/* Returns non-zero if we can use hardware watchpoints to watch a region - whose address is ADDR and whose length is LEN. */ +#define I386_DR_LOW_RESET_ADDR(N) -#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr,len) \ - go32_region_ok_for_watchpoint(addr,len) -extern int go32_region_ok_for_watchpoint (CORE_ADDR, int); - -/* After a watchpoint trap, the PC points to the instruction after the - one that caused the trap. Therefore we don't need to step over it. - But we do need to reset the status register to avoid another trap. */ - -#define HAVE_CONTINUABLE_WATCHPOINT - -#define STOPPED_BY_WATCHPOINT(W) \ - go32_stopped_by_watchpoint (inferior_pid, 0) - -#define target_stopped_data_address() \ - go32_stopped_by_watchpoint (inferior_pid, 1) -extern CORE_ADDR go32_stopped_by_watchpoint (int, int); - -/* Use these macros for watchpoint insertion/removal. */ - -#define target_insert_watchpoint(addr, len, type) \ - go32_insert_watchpoint (inferior_pid, addr, len, type) -extern int go32_insert_watchpoint (int, CORE_ADDR, int, int); - -#define target_remove_watchpoint(addr, len, type) \ - go32_remove_watchpoint (inferior_pid, addr, len, type) -extern int go32_remove_watchpoint (int, CORE_ADDR, int, int); - -#define target_insert_hw_breakpoint(addr, shadow) \ - go32_insert_hw_breakpoint(addr, shadow) -extern int go32_insert_hw_breakpoint (CORE_ADDR, void *); - -#define target_remove_hw_breakpoint(addr, shadow) \ - go32_remove_hw_breakpoint(addr, shadow) -extern int go32_remove_hw_breakpoint (CORE_ADDR, void *); - -#define DECR_PC_AFTER_HW_BREAK 0 +#define I386_DR_LOW_GET_STATUS() go32_get_dr6 () +extern unsigned go32_get_dr6 (void); -- cgit v1.1