This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

Re: Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT


Eli Zaretskii wrote:

However, it seems to me that the right thing to do is to fix the cited code in bpstat_stop_status (and perhaps elsewhere in breakpoint.c) to DTRT for the test program posted by Orjan, since it clearly should work with i386 as well, and since this specific failure of GDB has nothing to do with read-only vs read-write watchpoints.

The test program (repeated below) *does* work for i386 (though I didn't say that), because it also stops when foo is written (thus updating the value of foo when watchpoint_check is called), so by the time it stops when the second read happens the value hasn't changed since the last time and GDB decides it's a valid hit.


  volatile int foo = 0;
  int a;

  a = foo;
  foo = 1;
  a = foo;

Question is how to fix this (comments are most welcome):

1. Add a check if the target cannot set "pure" read watchpoints to the b->type == bp_read_watchpoint check at WP_VALUE_CHANGED (my interpretation of Eli's suggestion).

or

2. Somehow don't update the value in watchpoint_check when it's a false hit. (Then the b->type == bp_read_watchpoint check at WP_VALUE_CHANGED isn't needed.)

or

3. Add some distinction between "wanted watchpoint type" and "actual watchpoint type".

--
Orjan Friberg
Axis Communications


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