This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: Watchpoint-related changes in go32-nat.c and friends
- To: eliz@gnu.org
- Subject: Re: Watchpoint-related changes in go32-nat.c and friends
- From: DJ Delorie <dj@delorie.com>
- Date: Thu, 19 Aug 1999 17:10:59 -0400
- CC: gdb-patches@sourceware.cygnus.com
- References: <199908181521.LAA06730@mescaline.gnu.org>
I applied the djgpp-specific patches, but had to manually patch some
due to whitespace differences. Please get the latest version before
you send any more patches so that the whitespace will match.
I didn't apply the infrun.c patch; I know it's djgpp-specific but I
wanted someone to say "yup, it's OK to put that kind of djgpp-specific
stuff there" and it's only printfs so I figured it could wait for a
decision.
> The following changes make watchpoints work much better in the DJGPP
> port of GDB. In particular, I can now watch double values. These
> patches also prevent crashes when single-stepping over INT nn
> instructions.
>
> 1999-08-16 Eli Zaretskii <eliz@is.elta.co.il>
>
> * go32-nat.c (go32_wait): If we are in a single-step mode, and the
> next instruction is INT nn or INTO, use a temporary breakpoint to
> simulate single-step mode, and reset the trace flag.
>
> 1999-08-14 Eli Zaretskii <eliz@is.elta.co.il>
>
> * go32-nat.c (wp_op): New typedef.
> (SHOW_DR): Print the length of watched region as well.
> (go32_insert_aligned_watchpoint): Remove unused argument PID. All
> callers and the prototype changed.
> (go32_handle_nonaligned_watchpoint): Renamed from
> go32_insert_nonaligned_watchpoint. Now handles all operations on
> non-aligned watchpoints: insertion, deletion, and counting. If
> called with wp_count as the first argument, return the count of
> debug registers needed to watch the region. Don't break out of
> the loop before all the addresses in the region are processed.
> (go32_remove_watchpoint): Call go32_remove_aligned_watchpoint to
> do the actual work.
> (go32_remove_aligned_watchpoint): New function, modeled after
> go32_insert_aligned_watchpoint. Removes watchpoints that watch
> regions of arbitrary length by calling
> go32_handle_nonaligned_watchpoint as needed.
> (go32_region_ok_for_watchpoint): New function, called from
> can_use_hardware_watchpoint via the new macro
> TARGET_REGION_OK_FOR_HW_WATCHPOINT.
>
> * config/i386/nm-go32.h (TARGET_REGION_OK_FOR_HW_WATCHPOINT):
> Define to call go32_region_ok_for_watchpoint.
> (DECR_PC_AFTER_HW_BREAK): Define back to zero (previous redefinition
> to 1 was due to a bug in go32-nat.c).
>
> 1999-08-07 Eli Zaretskii <eliz@is.elta.co.il>
>
> * go32-nat.c (cleanup_dregs): New function.
> (go32_mourn_inferior): Call it.
> (IS_REG_FREE, LOCAL_ENABLE_REG, GLOBAL_ENABLE_REG, DISABLE_REG,
> SET_BREAK, SET_WATCH, IS_WATCH, WATCH_HIT): Protect arguments with
> parentheses.
> (SET_BREAK): Increment the debug register's reference count.
> (DR_DEF): New macro, returns the access and length bits of the
> breakpoint.
> (SHOW_DR): Print the reference count of each register. Disable or
> enable print-out depending on an environment variable GDB_SHOW_DR.
> (go32_insert_aligned_watchpoint): Look for an occupied debug
> register with the same address and access/length bits, and reuse
> it by incrementing reference the count, before occupying another
> register. Return zero upon success.
> (go32_insert_nonaligned_watchpoint): Pass the read/write bits to
> go32_remove_watchpoint.
> (go32_remove_watchpoint): Accept an additional parameter: the
> read/write bits of the watchpoint to remove, and only remove a
> watchpoint if it's occupied and its address and read/write bits
> match. Only disable the register if its reference count is zero;
> otherwise just decrease the reference count.
> (go32_remove_hw_breakpoint): Only decrease reference count and
> disable the debug register if it is occupied and its access bits
> match those of an instruction breakpoint.
> (go32_insert_hw_breakpoint): Before occupying another debug
> register, look for an already occupied register that defines an
> instruction breakpoint with the same address. If found, increment
> its reference count. Call SHOW_DR even if failed to insert a
> breakpoint.
>
> * config/i386/nm-go32.h (target_remove_watchpoint): Accept the
> TYPE argument as well.
>
> 1999-08-06 Eli Zaretskii <eliz@is.elta.co.il>
>
> * infrun.c (proceed) [__DJGPP__]: If some hardware breakpoints
> couldn't be inserted, print a message that they may have set too
> many of them.
> (normal_stop) [__DJGPP__]: Likewise.
> Reset breakpoints_failed, they might do something that will cause
> insert_breakpoints() succeed next time.