This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: two agent expression nits (one line each)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: David Taylor <dtaylor at emc dot com>
- Cc: Stan Shebs <stanshebs at earthlink dot net>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sat, 20 Dec 2014 12:19:55 -0500
- Subject: Re: two agent expression nits (one line each)
- Authentication-results: sourceware.org; auth=none
- References: <14583 dot 1410458050 at usendtaylorx2l> <547E24E5 dot 8050908 at earthlink dot net> <20141213134428 dot GF5457 at adacore dot com> <23074 dot 1418658035 at usendtaylorx2l>
Hi David,
> > Would you mind taking care of that for us? I kept that message around
> > in the hope that I'd have a clearer picture with a little extra time,
> > but I am still not sure whether you're just suggesting a documentation
> > fix, or if you're saying we should fix the implementation...
>
> The first part is pure documentation -- the description is correct but
> the summary line is wrong. The second part is implementation -- the
> consumed and produced fields are used to check for stack underflow and
> overflow.
>
> The fields are used by gdb and gdbserver for sanity checking the
> bytecode expression -- checking for underflow and overflow.
>
> The underflow check catches bad bytecode sequences generated by GDB.
>
> Since DEFOP has consumed as 0 when it is really 1, that means that GDB
> will think that there is more on the stack than there really is.
>
> So, if GDB generates a bytecode sequence that underflows it might not
> catch it. It does not currently generate bad sequences, so fixing it
> will merely help catch future lossage.
>
> As I recall, the overflow check is used by gdbserver to verify that it
> has sufficent stack space for the expression. The bad DEFOP line makes
> it think that the expression is using one more stack slot than reality.
> But, gdbserver has fairly generous bytecode stack space -- so unless the
> expression is really complicated, that won't happen.
Since you understand what should be done, would you mind sending
a patch in for Stan to review?
--
Joel