Re: [PATCH v2] tracepoint: add new trace command "printf" and agent expression "printf" [3] doc

Hui Zhu
2011-06-15T05:27:49Z

[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]

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,
Hui

[-- Attachment #2: tp_print_doc.txt --]
[-- Type: text/plain, Size: 1542 bytes --]

---
doc/agentexpr.texi | 7 +++++++
doc/gdb.texinfo | 7 +++++++
2 files changed, 14 insertions(+)

--- a/doc/agentexpr.texi
+++ b/doc/agentexpr.texi
@@ -489,6 +489,13 @@ named @code{trace_quick16}, for consiste
Record the value of trace state variable number @var{n} in the trace
buffer. The handling of @var{n} is as described for @code{getv}.

+@item @code{printf} (0x31) @var{n} @var{template}: @result{}
+Print a value on the stack under control of the string @var{template}.
+@var{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 control
+of the string @var{template}.
+
@item @code{end} (0x27): @result{}
Stop executing bytecode; the result should be the top element of the
stack. If the purpose of the expression was to compute an lvalue or a
--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -10289,6 +10289,13 @@ state variables (@pxref{Trace State Vari
values to the trace buffer, as would be the case if the @code{collect}
action were used.

+@kindex printf, in tracepoint actions
+@item printf @var{template}, @var{expressions}@dots{}
+Print the values of one or more @var{expressions} under control of
+the string @var{template}.
+@var{template} is a format string of the same form as used with the
+@value{GDBN} command @code{printf} (@pxref{Output, printf}).
+
@kindex while-stepping @r{(tracepoints)}
@item while-stepping @var{n}
Perform @var{n} single-step instruction traces after the tracepoint,