From: Michael Snyder <msnyder@specifix.com>
To: Jim Blandy <jimb@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFC: tracepoints: extend range of ax_trace_quick function
Date: Sat, 27 Oct 2007 08:12:00 -0000 [thread overview]
Message-ID: <1193472363.16917.100.camel@localhost.localdomain> (raw)
In-Reply-To: <m34pgdcwj2.fsf@codesourcery.com>
On Fri, 2007-10-26 at 15:59 -0700, Jim Blandy wrote:
> In order to get Linux kernel tracepoints working, I needed to make a
> number of fixes in GDB. This is one such patch; the code which uses
> the function's new range comes a bit later.
>
> Okay to commit?
If I understand correctly, a trace_quick was formerly of size up to
8 bits. You've added a trace16 for objects up to 16 bits, and this
just allows trace_quick to handle those objects by forwarding them
to trace16.
In which case, it looks fine.
Michael
>
> gdb/ChangeLog:
> 2007-10-24 Jim Blandy <jimb@codesourcery.com>
>
> * ax-general.c (ax_trace_quick): Generate trace16 instructions for
> sizes from 256 to 65535.
>
> diff -r 7625042dd5a0 -r eb635294a14e gdb/ax-general.c
> --- a/gdb/ax-general.c Wed Oct 24 10:17:42 2007 -0700
> +++ b/gdb/ax-general.c Wed Oct 24 18:02:15 2007 -0700
> @@ -166,17 +166,29 @@ ax_zero_ext (struct agent_expr *x, int n
> }
>
>
> -/* Append a trace_quick instruction to EXPR, to record N bytes. */
> +/* Append a trace_quick or trace16 instruction to EXPR, to record N bytes. */
> void
> ax_trace_quick (struct agent_expr *x, int n)
> {
> - /* N must fit in a byte. */
> - if (n < 0 || n > 255)
> - error (_("GDB bug: ax-general.c (ax_trace_quick): size out of range for trace_quick"));
> -
> - grow_expr (x, 2);
> - x->buf[x->len++] = aop_trace_quick;
> - x->buf[x->len++] = n;
> + if (n < 0)
> + internal_error (__FILE__, __LINE__,
> + _("ax_trace_quick: negative size"));
> + else if (n < (1 << 8))
> + {
> + grow_expr (x, 2);
> + x->buf[x->len++] = aop_trace_quick;
> + x->buf[x->len++] = n;
> + }
> + else if (n < (1 << 16))
> + {
> + grow_expr (x, 3);
> + x->buf[x->len++] = aop_trace16;
> + x->buf[x->len++] = n >> 8;
> + x->buf[x->len++] = n;
> + }
> + else
> + internal_error (__FILE__, __LINE__,
> + _("ax_trace_quick: size out of range"));
> }
>
>
> diff -r 7625042dd5a0 -r eb635294a14e gdb/ax.h
> --- a/gdb/ax.h Wed Oct 24 10:17:42 2007 -0700
> +++ b/gdb/ax.h Wed Oct 24 18:02:15 2007 -0700
> @@ -157,7 +157,8 @@ extern void ax_ext (struct agent_expr *E
> /* Append a zero-extension instruction to EXPR, to extend an N-bit value. */
> extern void ax_zero_ext (struct agent_expr *EXPR, int N);
>
> -/* Append a trace_quick instruction to EXPR, to record N bytes. */
> +/* Append a trace_quick or trace16 instruction to EXPR, to record N bytes.
> + N must be less than 65536. */
> extern void ax_trace_quick (struct agent_expr *EXPR, int N);
>
> /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or
next parent reply other threads:[~2007-10-27 8:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m34pgdcwj2.fsf@codesourcery.com>
2007-10-27 8:12 ` Michael Snyder [this message]
2007-10-29 17:48 ` Jim Blandy
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=1193472363.16917.100.camel@localhost.localdomain \
--to=msnyder@specifix.com \
--cc=gdb-patches@sourceware.org \
--cc=jimb@codesourcery.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