This is the mail archive of the 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: does bpstat_print stop printing prematurely?

On Mon, 15 Apr 2002, Doug Evans wrote:

> What if there is 1 breakpoint that triggers and two watchpoints?

Do you actually have an example of this, or can craft one?

You see, I think it's all but impossible to have a breakpoint and a 
watchpoint trigger at the same PC.  That's because the CPU carefully 
designs its faults and traps so that one always preceeds the other.  
(For soft breakpoints, the ones implemented by inserting a breakpoint 
opcode into the code, doing so overwrites the instruction that would 
have caused a watchpoint to trigger, so the simultaneous triggering is 
again impossible.)

> As a user, whenever execution stops I'd kinda like to know which
> of all of my active watchpoints triggered without having to
> manually examine each one.

GDB should already cite all the watchpoints that trigger, unless there's 
a bug.  Again, please provide a specific example of a failure, if you can.

> Things are even more confusing if gdb prints some but not all
> of the triggering watchpoints.

Cannot reproduce this on my machine with GDB 5.1.1: if I set two 
watchpoints on the same address, GDB announces both of them.  Please tell 
what OS did you try that on, and which version of GDB was that.

> Example: Suppose the `bs' arg to bpstat_print contains a watchpoint,
> a pc breakpoint, and another watchpoint, in that order.
> Currently bpstat_print will print the first watchpoint and the
> pc breakpoint but not the second watchpoint.  Blech.

An example program that exhibits this behavior would be nice.  Thanks.

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