breakpoint for accessing memory location

Eli Zaretskii eliz@gnu.org
Sat Oct 21 21:26:00 GMT 2006


> 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?



More information about the Gdb mailing list