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: Stan Shebs <shebs at codesourcery dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, David Taylor <dtaylor at emc dot com>
- Date: Sun, 23 Nov 2014 07:27:17 +0400
- Subject: Re: two agent expression nits (one line each)
- Authentication-results: sourceware.org; auth=none
- References: <14583 dot 1410458050 at usendtaylorx2l>
Hi Stan
Would you mind looking into this? David's comments seem reasonable,
but it would be nice to confirm that what we currently do is what
we had meant to do :-).
Thanks!
On Thu, Sep 11, 2014 at 01:54:10PM -0400, David Taylor wrote:
> In gdb/doc/agentexpr.texi you''ll find the text:
>
> @item @code{setv} (0x2d) @var{n}: @result{} @var{v}
> Set trace state variable number @var{n} to the value found on the top
> of the stack. The stack is unchanged, so that the value is readily
> available if the assignment is part of a larger expression. The
> handling of @var{n} is as described for @code{getv}.
>
> The @item line and the following text do no agree with one another. I'm
> guessing that the text is correct, in which case this line:
>
> @item @code{setv} (0x2d) @var{n}: @result{} @var{v}
>
> should be changed to this:
>
> @item @code{setv} (0x2d) @var{n}: @var{v} @result{} @var{v}
>
> Additionally, in gdb/common/ax.def we find the line:
>
> DEFOP (setv, 2, 0, 0, 1, 0x2d)
>
> >From the comment earlier in the file:
>
> Each line is of the form:
>
> DEFOP (name, size, data_size, consumed, produced, opcode)
> [...]
> CONSUMED is the number of stack elements consumed.
> PRODUCED is the number of stack elements produced.
>
> which is saying that nothing is consumed and one item is produced. Both
> should be 0 or both should be 1. Setting them both to 1 seems better
> since if nothing is on the stack an error will occur. So, it should be
> changed to:
>
> DEFOP (setv, 2, 0, 1, 1, 0x2d)
>
> David
--
Joel