This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: breakpoint for accessing memory location
> Date: Sun, 22 Oct 2006 00:22:30 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> On Sun, Oct 22, 2006 at 06:17:58AM +0200, Eli Zaretskii wrote:
> > > Date: Sat, 21 Oct 2006 18:32:00 -0400
> > > From: Daniel Jacobowitz <drow@false.org>
> > > Cc: rodney.bates@wichita.edu, gdb@sourceware.org
> > > >
> > > > 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.
> >
> > That's silly, IMHO. Don't you think we should be smarter? Perhaps
> > some kind of expression optimizer could be devised to do better.
>
> I really don't think we should be optimizing expressions. One
> certainly could be devised - but it would look like "fold" in GCC,
> which is a huge and horrendously complex thing.
Agreed.