Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT
@ 2003-10-08  8:50 Orjan Friberg
  2003-10-08 10:26 ` Eli Zaretskii
  0 siblings, 1 reply; 50+ messages in thread
From: Orjan Friberg @ 2003-10-08  8:50 UTC (permalink / raw)
  To: gdb-patches

Hi all,

I'm working on a gdb port for a remote target that has hardware 
watchpoint support.  I have defined HAVE_NONSTEPPABLE_WATCHPOINT, to 
make gdb disable the watchpoint and single-step over it when it's hit. 
The basic stuff works fine; the problem I have is the displaying of "Old 
value/New value" when a read or access watchpoint is hit.  (Normal write 
watchpoints are displayed correctly.)

The problem seems to be that target_stopped_data_address () is called in 
bp_stop_status () *after* the single-step over the disabled breakpoint 
has been carried out, at which point the target is no longer stopped due 
to a hardware watchpoint (but due to the single-step).  Consequently, 
target_stopped_data_address () returns 0, and gdb thinks that the 
watchpoint didn't hit.  I can't see that any other targets keep the last 
"stopped data address" until the next hardware watchpoint is hit (which 
would make the address still available after the single-step).

Any suggestions as to what I might have missed, or any insight in how 
it's supposed to work would be appreciated.

Thanks,
Orjan

-- 
Orjan Friberg
Axis Communications



^ permalink raw reply	[flat|nested] 50+ messages in thread
* Re: Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT
@ 2004-05-04 22:10 Ulrich Weigand
  2004-05-05  5:08 ` Eli Zaretskii
  2004-05-05 13:44 ` Paul Koning
  0 siblings, 2 replies; 50+ messages in thread
From: Ulrich Weigand @ 2004-05-04 22:10 UTC (permalink / raw)
  To: orjan.friberg, kettenis; +Cc: gdb-patches, eliz, drow

Mark Kettenis wrote:

>This patch breaks hardware watchpoints in SVR4-derived systems.  Those
>systems don't provide target_stopped_data_address().  The default
>target_stopped_data_address() will always return zero, which means
>that triggered watchpoints aren't properly caught.  This results in
>spurious SIGTRAPS.

The patch also breaks s390(x), for exactly this reason.

We don't define target_stopped_data_address, and *cannot* do so
because the hardware doesn't provide this information.

We do know whether a SIGTRAP was due to a (any) watchpoint or not,
however, and define STOPPED_BY_WATCHPOINT to indicate this.

(Since the hardware supports only write watchpoints, not read
or access watchpoints, this should -and used to- be enough for
gdb to find out what happened by manually checking watchpoint
values.)

The patch below uses STOPPED_BY_WATCHPOINT instead of 
target_stopped_data_address in bpstat_stop_status;
this get s390(x) watchpoints back functional.

Alternatively, we could also make the target_stopped_data_address
check only for read and access watch points, *not* for write
watchpoints ...

What do you think?


Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.170
diff -c -p -r1.170 breakpoint.c
*** gdb/breakpoint.c	2 May 2004 00:21:41 -0000	1.170
--- gdb/breakpoint.c	4 May 2004 21:20:10 -0000
*************** bpstat_stop_status (CORE_ADDR bp_addr, p
*** 2631,2637 ****
  	&& !((b->type == bp_hardware_watchpoint
  	      || b->type == bp_read_watchpoint
  	      || b->type == bp_access_watchpoint)
! 	     && target_stopped_data_address () != 0)
  	&& b->type != bp_hardware_breakpoint
  	&& b->type != bp_catch_fork
  	&& b->type != bp_catch_vfork
--- 2631,2637 ----
  	&& !((b->type == bp_hardware_watchpoint
  	      || b->type == bp_read_watchpoint
  	      || b->type == bp_access_watchpoint)
! 	     && STOPPED_BY_WATCHPOINT ())
  	&& b->type != bp_hardware_breakpoint
  	&& b->type != bp_catch_fork
  	&& b->type != bp_catch_vfork

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2004-05-07  8:23 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-08  8:50 Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT Orjan Friberg
2003-10-08 10:26 ` Eli Zaretskii
2003-10-08 13:36   ` Orjan Friberg
2003-10-08 16:02     ` Paul Koning
2004-04-06 10:14   ` Orjan Friberg
2004-04-06 14:22     ` Daniel Jacobowitz
2004-04-07  9:11       ` Orjan Friberg
2004-04-15  8:17       ` Eli Zaretskii
2004-04-15 13:24         ` Orjan Friberg
2004-04-16  7:18           ` Eli Zaretskii
2004-04-16  9:46             ` Orjan Friberg
2004-04-16 11:42           ` Orjan Friberg
2004-04-17  8:27             ` Eli Zaretskii
2004-04-19 14:59               ` Orjan Friberg
2004-04-22 15:08                 ` Orjan Friberg
2004-04-22 15:48                   ` Paul Koning
2004-04-22 18:40                   ` Eli Zaretskii
2004-04-22 19:07                     ` Paul Koning
2004-04-22 19:09                       ` Paul Koning
2004-04-23 18:20                       ` Eli Zaretskii
2004-04-23 18:22                   ` Eli Zaretskii
2004-04-26  9:04                     ` Orjan Friberg
2004-04-26  9:25                       ` Eli Zaretskii
2004-05-01 21:18                   ` Mark Kettenis
2004-05-02  4:48                     ` Eli Zaretskii
2004-05-03 11:25                       ` Orjan Friberg
2004-05-03 15:05                         ` Andrew Cagney
2004-05-03 18:01                           ` Eli Zaretskii
2004-05-03 18:36                             ` Andrew Cagney
2004-05-03 17:49                         ` Eli Zaretskii
2004-05-04  7:31                           ` Orjan Friberg
2004-05-04 23:52                             ` Daniel Jacobowitz
2004-05-04 22:10 Ulrich Weigand
2004-05-05  5:08 ` Eli Zaretskii
2004-05-05  8:26   ` Orjan Friberg
2004-05-06  4:58     ` Eli Zaretskii
2004-05-06 14:21       ` Daniel Jacobowitz
2004-05-06 18:02         ` Eli Zaretskii
2004-05-06 18:05           ` Daniel Jacobowitz
2004-05-07  8:18             ` Eli Zaretskii
2004-05-06 21:34   ` Ulrich Weigand
2004-05-06 21:36     ` Daniel Jacobowitz
2004-05-07  8:22       ` Eli Zaretskii
2004-05-07  8:23     ` Eli Zaretskii
2004-05-05 13:44 ` Paul Koning
2004-05-06  5:08   ` Eli Zaretskii
2004-05-06 13:44     ` Paul Koning
2004-05-06 21:38   ` Ulrich Weigand
2004-05-06 21:49     ` Paul Koning
2004-05-07  8:18     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox