From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2158 invoked by alias); 21 Apr 2013 04:59:57 -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 2147 invoked by uid 89); 21 Apr 2013 04:59:56 -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,TW_RG autolearn=ham version=3.3.1 Received: from mail-ob0-f169.google.com (HELO mail-ob0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 21 Apr 2013 04:59:55 +0000 Received: by mail-ob0-f169.google.com with SMTP id tb18so385941obb.28 for ; Sat, 20 Apr 2013 21:59:54 -0700 (PDT) X-Received: by 10.182.79.165 with SMTP id k5mr11244649obx.24.1366520393970; Sat, 20 Apr 2013 21:59:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.13.133 with HTTP; Sat, 20 Apr 2013 21:59:13 -0700 (PDT) In-Reply-To: <87vc7ithtj.fsf@fleche.redhat.com> References: <515451EA.1000200@mentor.com> <83y5d7wpvq.fsf@gnu.org> <516454DA.9040109@redhat.com> <87ppxzhfqy.fsf@fleche.redhat.com> <516C2549.3060808@redhat.com> <87vc7ithtj.fsf@fleche.redhat.com> From: Hui Zhu Date: Mon, 22 Apr 2013 09:07: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/msg00644.txt.bz2 On Sat, Apr 20, 2013 at 3:56 AM, Tom Tromey wrote: >>>>>> "Hui" == Hui Zhu writes: > > Hui> The MI handle the argument is different with CLI. For example: > Hui> Input -break-insert -s "1\n" to mi. The mi_cmd_break_insert will get: > [...] > > This seems to mean that extra quoting is needed for the format string. > Like you can't send just: > > -break-insert -s "\"1\n\"" > > It seems like you have to send: > > -break-insert -s "\"1\\n\"" > > > But an alternative is to keep the MI interface simple and "MI-like" -- > meaning using the quoting and argument parsing convention already > defined by MI, one of its big benefits over the CLI -- and let gdb > handle the requirements of the protocol and/or its own internals. That > is, send: > > -break-insert -s "1\n" > > ... and gdb can rewrite that format string to whatever is needed. > > Tom Does GDB have some function can convert string to "" inside string? Could you give me some comments about the new format for -s. My thought is: -s format argv1 argv2, other options "-break-insert -s FORMAT LOCATION ARG ARG ARG ..." is too different with current options of -break-insert and very hard to support. Thanks, Hui