From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: Re: RFC: add pick and roll agent expression operations
Date: Fri, 18 Feb 2011 18:44:00 -0000 [thread overview]
Message-ID: <201102181840.30554.pedro@codesourcery.com> (raw)
In-Reply-To: <m3ipwj3al3.fsf@fleche.redhat.com>
On Wednesday 16 February 2011 21:59:04, Tom Tromey wrote:
> I'd appreciate comments on this.
> It at least needs a documentation review.
>
> While looking into agent expressions today, I decided to fix a few bugs
> in DWARF -> AX compilation. This patch adds two new agent expressions,
> pick and roll.
>
> I wanted comments since I was not sure if there is some approved method
> for rolling out AX changes. Do we need some kind of version test in
> remote.c or in the AX translators? If not, should we somehow add this?
I think we can get by without it in this case. Without the
patch you can't even compile the agent expressions. After
the patch, against an older server/stub, we risk the user
only noticing that the expression didn't work
until late in the trace cycle. But then again, in
a super controlled environment where that matters, you should
only use a client/server pair that's been verified to work.
Here's an idea for posterity: what if gdbserver made
a quick validating pass over the expressions at tracepoint
download time, and errored out if it found opcodes it didn't
grok?
> /* Append a sign-extension or zero-extension instruction to EXPR, to
> extend an N-bit value. */
> @@ -376,6 +387,8 @@ struct aop_map aop_map[] =
> {"tracev", 2, 0, 0, 1}, /* 0x2e */
> {0, 0, 0, 0, 0}, /* 0x2f */
> {"trace16", 2, 0, 1, 1}, /* 0x30 */
> + {"pick", 1, 0, 0, 1}, /* 0x31 */
> + {"roll", 0, 0, 3, 3}, /* 0x32 */
Hmm, you used rot everywhere else? Looks like
you end up fixing it in the next patch.
> --- a/gdb/ax.h
> +++ b/gdb/ax.h
> @@ -204,6 +204,8 @@ enum agent_op
> aop_setv = 0x2d,
> aop_tracev = 0x2e,
> aop_trace16 = 0x30,
> + aop_pick = 0x31,
> + aop_rot = 0x32,
> aop_last
> };
>
> struct agent_expr
> @@ -4598,6 +4602,23 @@ eval_agent_expr (struct tracepoint_hit_ctx *ctx,
> + case gdb_agent_op_rot:
> + {
> + int tem = stack[sp - 1];
> +
> + stack[sp - 1] = stack[sp - 2];
> + stack[sp - 2] = top;
> + top = tem;
tem should be ULONGEST.
Otherwise looks okay to me. Thanks.
--
Pedro Alves
next prev parent reply other threads:[~2011-02-18 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 22:01 Tom Tromey
2011-02-17 5:33 ` Eli Zaretskii
2011-02-18 18:44 ` Pedro Alves [this message]
2011-02-18 20:58 ` Tom Tromey
2011-02-18 21:11 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201102181840.30554.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox