This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: minor watchpoint code cleanup


> While we are talking: someone (H.J. Lu?) suggested to make the
> watchpoint insertion code common to all x86 targets.  What's the
> current say-so on this?

With Solaris x86 2.6 and beyond we can get an unlimited amount of watchpoints
with only a few restrictions via page fault handling, procfs and appropriate
Solaris kernel support.

I don't object to common watchpoint insertion code (using x86 debug registers)
for other x86 targets, but we should be able to override it via the tm/nm
config files.


My (currently experimental) version of config/nm-i386sol2.h has this:


#if defined (NEW_PROC_API)

/* Solaris supports procfs watchpoints starting with 2.6. */
#define TARGET_HAS_HARDWARE_WATCHPOINTS

#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1

/* When a hardware watchpoint fires off the PC will be left after the
   instruction which caused the watchpoint.  */

#define STOPPED_BY_WATCHPOINT(W) \
     procfs_stopped_by_watchpoint(inferior_pid)
extern int procfs_stopped_by_watchpoint PARAMS ((int));

#define HAVE_CONTINUABLE_WATCHPOINT

#define CANNOT_STEP_HW_WATCHPOINTS

/* Use these macros for watchpoint insertion/deletion.  */
/* TYPE is target_hw_bp_type. */
#define target_insert_watchpoint(ADDR, LEN, TYPE) \
     procfs_set_watchpoint (inferior_pid, ADDR, LEN, TYPE, 1)
#define target_remove_watchpoint(ADDR, LEN, TYPE) \
     procfs_set_watchpoint (inferior_pid, ADDR, 0, 0, 1)
extern int procfs_set_watchpoint PARAMS ((int, CORE_ADDR, int, int, int));

#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1

#endif /* NEW_PROC_API */


-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]