From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40428 invoked by alias); 20 Apr 2015 05:44:37 -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 40418 invoked by uid 89); 20 Apr 2015 05:44:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f174.google.com Received: from mail-qk0-f174.google.com (HELO mail-qk0-f174.google.com) (209.85.220.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 20 Apr 2015 05:44:35 +0000 Received: by qkx62 with SMTP id 62so181154906qkx.0 for ; Sun, 19 Apr 2015 22:44:33 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.140.237.67 with SMTP id i64mr15703538qhc.86.1429508673242; Sun, 19 Apr 2015 22:44:33 -0700 (PDT) Received: by 10.229.213.199 with HTTP; Sun, 19 Apr 2015 22:44:33 -0700 (PDT) In-Reply-To: <20150414124920.GH4704@adacore.com> References: <20141123042417.GA839@adacore.com> <87bnny45zi.fsf@igel.home> <20141123095317.GE5774@adacore.com> <20141124071258.GI5774@adacore.com> <20150414124920.GH4704@adacore.com> Date: Mon, 20 Apr 2015 05:44:00 -0000 Message-ID: Subject: Re: RFC: "set" command with 2 arguments instead of one? From: Doug Evans To: Joel Brobecker Cc: "Tedeschi, Walfred" , Andreas Schwab , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00734.txt.bz2 On Tue, Apr 14, 2015 at 5:49 AM, Joel Brobecker wro= te: >> Sorry for the long delay here. Now I could come back to the patches agai= n. >> >> Was there any outcome on that discussion. How do you think I could use >> the multiple arguments? > > I don't remember any reply to the message you quote above, which > summarizes my current thinking and position. As you indicate, it is > a question of making a decision. > > Global Maintainers: What do you think? Let's make a decision so that > Walfred can resume his work on this. > > Thanks! Hi. As a data point, regarding this comment: "Commas also have a meaning in C, so arguably they could be used in expressions as well." note that parse_to_comma_and_eval handles parenthesized expressions, so one *can* use commas in expressions. If they pose a problem to parsing of the command then one can wrap that expression in parens. E.g., (gdb) p $pc $1 =3D (void (*)(void)) 0x400764 (gdb) disas (($pc+42),($pc+0)),+16 Dump of assembler code from 0x400764 to 0x400774: =3D> 0x0000000000400764 : mov $0x400860,%esi 0x0000000000400769 : mov $0x401c80,%edi 0x000000000040076e : callq 0x400630 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt> 0x0000000000400773 : mov $0x0,%eax So I'm not worried about commas in expressions. gdb is never going to be at a point where all commands can use buildargv. I think choosing either buildargv or commas (using parse_to_comma_and_eval or whatever) should consider what the arguments to the command are. And since this command takes things that are more like expressions than like strings, I'm leaning towards commas. >> -----Original Message----- >> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcew= are.org] On Behalf Of Joel Brobecker >> Sent: Monday, November 24, 2014 8:13 AM >> To: Doug Evans >> Cc: Andreas Schwab; gdb-patches@sourceware.org >> Subject: Re: RFC: "set" command with 2 arguments instead of one? >> >> > This feels like a case where we need to at least think about some >> > future-proofing. >> > One way some commands separate expressions is with commas. >> > I'm not fond of optional commas (setting aside the thread on info >> > macro -at LOCATION,). >> > IOW, if it turns out that we want to use commas down the road to >> > separate expressions here, then I'd prefer the commas be required >> > today. >> > E.g., set mpx bound ADDR, LBOUND, UBOUND >> >> > As for how to process multiple arguments to a "set" command, one way >> > would be to stage the value in a string parameter, and then have a set >> > handler post-process the result. >> >> I think using commas systematically is making it worse for ourselves, si= nce it prevents us from using gdb_buildargv to parse the command arguments = for us. Commas also have a meaning in C, so arguably they could be used in = expressions as well. But, if that's the way people prefer, then having a st= andard gdb_buildargv-like API that everyone consistently uses will make it = easier for me to accept that decision. >> >> -- >> Joel >> Intel GmbH >> Dornacher Strasse 1 >> 85622 Feldkirchen/Muenchen, Deutschland >> Sitz der Gesellschaft: Feldkirchen bei Muenchen >> Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk >> Registergericht: Muenchen HRB 47456 >> Ust.-IdNr./VAT Registration No.: DE129385895 >> Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052 > > -- > Joel