From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6238 invoked by alias); 15 Apr 2013 13:34:22 -0000 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 Received: (qmail 6228 invoked by uid 89); 15 Apr 2013 13:34:21 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from mail-ob0-f177.google.com (HELO mail-ob0-f177.google.com) (209.85.214.177) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 15 Apr 2013 13:34:21 +0000 Received: by mail-ob0-f177.google.com with SMTP id 16so2072665obc.36 for ; Mon, 15 Apr 2013 06:34:19 -0700 (PDT) X-Received: by 10.60.27.136 with SMTP id t8mr7380972oeg.92.1366032859016; Mon, 15 Apr 2013 06:34:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.13.133 with HTTP; Mon, 15 Apr 2013 06:33:38 -0700 (PDT) In-Reply-To: <87ppxzhfqy.fsf@fleche.redhat.com> References: <515451EA.1000200@mentor.com> <83y5d7wpvq.fsf@gnu.org> <516454DA.9040109@redhat.com> <87ppxzhfqy.fsf@fleche.redhat.com> From: Hui Zhu Date: Mon, 15 Apr 2013 18:04:00 -0000 Message-ID: Subject: Re: [PATCH] add -s option to make -break-insert support dprintf To: Tom Tromey Cc: Pedro Alves , Eli Zaretskii , Hui Zhu , gdb-patches ml , Marc Khouzam Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-04/txt/msg00425.txt.bz2 On Sat, Apr 13, 2013 at 12:32 AM, Tom Tromey wrote: >>>>>> "Hui" == Hui Zhu writes: > > Hui> + [ -s "@var{template},@var{expression}[,@var{expression}@dots{}]" ] > Hui> + [ @var{location} ] > > Hui> +@item -s "@var{template},@var{expression}[,@var{expression}@dots{}]" > Hui> +Set a dynamic printf breakpoint, described in @ref{Dynamic Printf}. > Hui> +The @var{template} and @var{expression} should be within double > Hui> +quotes and be escaped by being preceded with a backslash. > > MI already defines a quoting approach and allows multiple arguments. > In fact one of its selling points is that it doesn't have to be as > free-form as the CLI -- it can be more predictable for programs to use. > > So, I think the above approach is not that great. > It adds a second layer of parsing to MI, I guess just to work around > internal deficiencies in gdb. > > It seems like you could use positional arguments instead: > > -break-insert -s FORMAT LOCATION ARG ARG ARG ... > > > I don't really understand the part about how the expressions should be > in double quotes. The test suite doesn't do that: > > +mi_gdb_test "5-break-insert -s \"\\\"arg=%d, g=%d\\\\n\\\", arg, g\" $dp_location1" \ > > I suggest just dropping that text. I think it probably means that the > argument should be properly quoted for MI, but that is redundant. > > Tom This design is because the MI inferior will auto convert the format string of argument of mi command. But dprintf need format sting keep the original of the format string. So I use the current format. Thanks, Hui