This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] tracepoint: add new trace command "printf" and agent expression "printf" [3] doc
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches at sourceware dot org, brobecker at adacore dot com, dje at google dot com, stan at codesourcery dot com, tromey at redhat dot com
- Date: Wed, 15 Jun 2011 20:24:36 +0300
- Subject: Re: [PATCH v2] tracepoint: add new trace command "printf" and agent expression "printf" [3] doc
- References: <AANLkTinGZvnz68ao3HmnhFizze+q4YwsjM0psgisT51i@mail.gmail.com> <20110224085616.GB2495@adacore.com> <AANLkTimxWQwRNWbFLa3F6uAiUFYiuyGDaq_bZ_aMOE1X@mail.gmail.com> <BANLkTik5xRmAjprmBJs5f0_KQyu=dDtAMQ@mail.gmail.com> <83ei36ce2o.fsf@gnu.org> <BANLkTimaAVatnUdq9CVEDEzR_APNXQMO5A@mail.gmail.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Hui Zhu <teawater@gmail.com>
> Date: Wed, 15 Jun 2011 13:26:47 +0800
> Cc: gdb-patches@sourceware.org, brobecker@adacore.com, dje@google.com,
> stan@codesourcery.com, tromey@redhat.com
>
> [1:text/plain Hide]
> On Tue, Jun 7, 2011 at 15:09, Eli Zaretskii <eliz@gnu.org> wrote:
> >> From: Hui Zhu <teawater@gmail.com>
> >> Date: Tue, 7 Jun 2011 14:32:55 +0800
> >> Cc: Joel Brobecker <brobecker@adacore.com>, Doug Evans <dje@google.com>,
> >> ? ? ? Stan Shebs <stan@codesourcery.com>, Tom Tromey <tromey@redhat.com>, Eli Zaretskii <eliz@gnu.org>
> >>
> >> +@item @code{printf} (0x31) @var{n} @var{template}: @result{}
> >> +Print the values in the stack under the control of the string template.
> >> +The end of @var{template} is 0x00.
> >
> > I don't understand the last sentence. ?Do you mean to say that the
> > template is a null-terminated string?
> >
> >> +If @var{n} is 0, just output the string template.
> >> +If @var{n} is 1, pop a value from the stack and print it under the control
> >> +of the string template.
> >
> > Does this support only a single value? ?That's not what one would
> > normally expect from something called "printf". ?If it can pop more
> > than one value, that should be documented.
> >
> >> +@kindex printf
> >> +@item printf @var{template}, @var{expressions}@dots{}
> >> +Print the values of one or more @var{expressions} under the control of
> >> +the string @var{template} in @code{gdbserver} part.
> >
> > What do you mean by "in @code{gdbserver} part"?
> >
> >> +The command format is with simple @code{printf} (@pxref{Output, printf}).
> >
> > This sentence's intent is not clear to me. ?Can you explain what were
> > you trying to say?
> >
> > Thanks.
> >
>
> Faint, I send an old patch. So sorry about that.
>
> That attchment is the right patch.
Thanks, this version is much better. But this question is still
unanswered:
> >> +If @var{n} is 0, just output the string template.
> >> +If @var{n} is 1, pop a value from the stack and print it under the control
> >> +of the string template.
> >
> > Does this support only a single value? ?That's not what one would
> > normally expect from something called "printf". ?If it can pop more
> > than one value, that should be documented.