Re: breakpoint for accessing memory location

Daniel Jacobowitz
2006-10-21T22:32:08Z

On Sat, Oct 21, 2006 at 11:26:10PM +0200, Eli Zaretskii wrote:
> > 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?

Well, I just tried it; that's what I'd expect, and it seems to be what
happens, also.

--
Daniel Jacobowitz
CodeSourcery