Re: recurse.exp: watch on local variable that goes out of scope

Orjan Friberg
2004-07-23T09:23:31Z

Eli Zaretskii wrote:
>
> So it sounds like your low-level target-side support misbehaves in
> this case: I386_DR_LOW_GET_STATUS should map into a system call that
> returns the contents of the DR6 debug register. If the returned value
> says that one of the watched addresses was written to, there's nothing
> GDB can do except report that and act accordingly.

Actually, this isn't an i386 remote target: it's my i386 Linux host. I'm sorry
if I sent you off in the wrong direction (I guess I should have been more
specific than just "i386").

Just to be clear on what the problem is: recurse.exp on an i386 Linux host is
all PASS; I just don't understand why it works the way it does.

There are actually two things that don't make sense to me:

1. Why the i386 reports a watchpoint hit when reaching the watchpoint scope del
breakpoint if the watchpoint has been hit previously (but not otherwise).

2. Compare the "Mimicking recurse.exp" and "Watch on return statement" examples
in my previous e-mail: in both cases GDB notices that the watched variable goes
out of scope, but stops only in the first case (where out of scope is detected
by watchpoint_check) and not in the second case (where out of scope is detected
by insert_bp_location).