Re: breakpoint for accessing memory location

Eli Zaretskii
2006-10-21T21:26:11Z

> Date: Sat, 21 Oct 2006 11:51:25 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: "Rodney M. Bates" <rodney.bates@wichita.edu>, gdb@sourceware.org
>
> > > I print the address of p->f and then watch the contents of that address.
> >
> > Does "watch *(<type-of-p->f> *)&p->f" work as well?
>
> I'm pretty sure it won't. Because "p" is still in the expression, we
> consider the expression dependent on the value of p, so it goes out of
> scope when p does.

So you are saying that "watch p - p" will also cause an error message
when p goes out of scope?