From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30948 invoked by alias); 24 Jun 2011 03:22:12 -0000 Received: (qmail 30939 invoked by uid 22791); 24 Jun 2011 03:22:11 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Jun 2011 03:21:57 +0000 Received: by fxm18 with SMTP id 18so2024026fxm.0 for ; Thu, 23 Jun 2011 20:21:56 -0700 (PDT) Received: by 10.223.62.194 with SMTP id y2mr3700161fah.123.1308885716042; Thu, 23 Jun 2011 20:21:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.29.155 with HTTP; Thu, 23 Jun 2011 20:21:16 -0700 (PDT) In-Reply-To: <838vt39fe3.fsf@gnu.org> References: <20110224085616.GB2495@adacore.com> <83ei36ce2o.fsf@gnu.org> <838vt39fe3.fsf@gnu.org> From: Hui Zhu Date: Fri, 24 Jun 2011 03:22:00 -0000 Message-ID: Subject: Re: [PATCH v2] tracepoint: add new trace command "printf" and agent expression "printf" [3] doc To: Eli Zaretskii Cc: gdb-patches@sourceware.org, brobecker@adacore.com, dje@google.com, stan@codesourcery.com, tromey@redhat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00364.txt.bz2 On Thu, Jun 16, 2011 at 01:24, Eli Zaretskii wrote: >> From: Hui Zhu >> Date: Wed, 15 Jun 2011 13:26:47 +0800 >> Cc: gdb-patches@sourceware.org, brobecker@adacore.com, dje@google.com, >> =A0 =A0 =A0 stan@codesourcery.com, tromey@redhat.com >> >> [1:text/plain Hide] >> On Tue, Jun 7, 2011 at 15:09, Eli Zaretskii wrote: >> >> From: Hui Zhu >> >> Date: Tue, 7 Jun 2011 14:32:55 +0800 >> >> Cc: Joel Brobecker , Doug Evans , >> >> =A0 =A0 =A0 Stan Shebs , Tom Tromey , Eli Zaretskii >> >> >> >> +@item @code{printf} (0x31) @var{n} @var{template}: @result{} >> >> +Print the values in the stack under the control of the string templa= te. >> >> +The end of @var{template} is 0x00. >> > >> > I don't understand the last sentence. =A0Do 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 c= ontrol >> >> +of the string template. >> > >> > Does this support only a single value? =A0That's not what one would >> > normally expect from something called "printf". =A0If 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, prin= tf}). >> > >> > This sentence's intent is not clear to me. =A0Can you explain what were >> > you trying to say? >> > >> > Thanks. >> > >> >> Faint, I send an old patch. =A0So sorry about that. >> >> That attchment is the right patch. > > Thanks, this version is much better. =A0But 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 c= ontrol >> >> +of the string template. >> > >> > Does this support only a single value? =A0That's not what one would >> > normally expect from something called "printf". =A0If it can pop more >> > than one value, that should be documented. > Hi Eli, Sorry for late. This is not the introduce of tracepoint printf. The tracepoint printf will work like a simple printf. It will divide a printf string into a lot of GDB agent code. So each GDB agent code just support one argument. I make each gdb agent code printf support one argument because I found that multi-argument is hard to support. Thanks, Hui