Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: RFC: tracepoints: extend range of ax_trace_quick function
       [not found] <m34pgdcwj2.fsf@codesourcery.com>
@ 2007-10-27  8:12 ` Michael Snyder
  2007-10-29 17:48   ` Jim Blandy
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Snyder @ 2007-10-27  8:12 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb-patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFC: tracepoints: extend range of ax_trace_quick function
  2007-10-27  8:12 ` RFC: tracepoints: extend range of ax_trace_quick function Michael Snyder
@ 2007-10-29 17:48   ` Jim Blandy
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Blandy @ 2007-10-29 17:48 UTC (permalink / raw)
  To: Michael Snyder; +Cc: gdb-patches


Michael Snyder <msnyder at specifix.com> writes:
> 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.

I'll commit; thanks!

trace16 has been in there for some time; agentexpr.texi says:

@item Why does @code{trace16} exist?
That opcode was added by the customer that contracted Cygnus for the
data tracing work.  I personally think it is unnecessary; objects that
large will be quite rare, so it is okay to use @code{dup const16
@var{size} trace} in those cases.

Whatever we decide to do with @code{trace16}, we should at least leave
opcode 0x30 reserved, to remain compatible with the customer who added
it.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-29 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m34pgdcwj2.fsf@codesourcery.com>
2007-10-27  8:12 ` RFC: tracepoints: extend range of ax_trace_quick function Michael Snyder
2007-10-29 17:48   ` Jim Blandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox