From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21959 invoked by alias); 29 Jul 2019 21:27:42 -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 21949 invoked by uid 89); 29 Jul 2019 21:27:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=20190711, pedro, 2019-07-11, HContent-Transfer-Encoding:8bit X-HELO: mailsec104.isp.belgacom.be Received: from mailsec104.isp.belgacom.be (HELO mailsec104.isp.belgacom.be) (195.238.20.100) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jul 2019 21:27:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1564435659; x=1595971659; h=message-id:subject:from:to:date:in-reply-to:references: mime-version:content-transfer-encoding; bh=NuSvDLY8/ixy3+vpVX0jYObl0QEBXJxVfzbVgExmF20=; b=khfEfZI9x2vB8xCVZb/QgIw8mQQGnJ2Eg/sxcBax7V1t73oL1ZV/9Ob4 xAXm3+zTaJGTKFEGQ8BuuackbYICVw==; Received: from 96.218-128-109.adsl-dyn.isp.belgacom.be (HELO md) ([109.128.218.96]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 29 Jul 2019 23:27:37 +0200 Message-ID: <1564435657.1435.4.camel@skynet.be> Subject: Re: [RFA] Make first and last lines of 'command help documentation' consistent. From: Philippe Waroquiers To: Pedro Alves , gdb-patches@sourceware.org Date: Mon, 29 Jul 2019 21:27:00 -0000 In-Reply-To: <662100d4-a245-8010-f1bc-a75987ef54f9@redhat.com> References: <20190616195804.9427-1-philippe.waroquiers@skynet.be> <662100d4-a245-8010-f1bc-a75987ef54f9@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00642.txt.bz2 On Thu, 2019-07-11 at 14:49 +0100, Pedro Alves wrote: > On 6/16/19 8:58 PM, Philippe Waroquiers wrote: > > @@ -448,8 +448,8 @@ _initialize_interpreter (void) > > c = add_cmd ("interpreter-exec", class_support, > > interpreter_exec_cmd, _("\ > > Execute a command in an interpreter.\n\ > > -It takes two arguments:\n\ > > +Usage: interpreter-exec INTERPRETER COMMAND...\n\ > > The first argument is the name of the interpreter to use.\n\ > > -The second argument is the command to execute."), &cmdlist); > > +The following arguments are the commands to execute."), &cmdlist); > > This sentence is incorrect -- there's only one command to execute. The code loops over a set of strings, and execute each of these strings. When trying: (gdb) interpreter-exec console bt bt #0  0x00007ffff78fe603 in select () at ../sysdeps/unix/syscall-template.S:84 #1  0x0000555555554f5e in sleeper_or_burner (v=0x7fffffffdf30) at sleepers.c:86 #2  0x000055555555549d in main (argc=1, argv=0x7fffffffe0b8) at sleepers.c:194 #0  0x00007ffff78fe603 in select () at ../sysdeps/unix/syscall-template.S:84 #1  0x0000555555554f5e in sleeper_or_burner (v=0x7fffffffdf30) at sleepers.c:86 #2  0x000055555555549d in main (argc=1, argv=0x7fffffffe0b8) at sleepers.c:194 (gdb) Now, I have to admit that at least for the console interpreter, unclear where the syntax for the arguments is described. Looks like the below works: (gdb) interpreter-exec console bt\ 1 bt\ 2 #0  0x00007ffff78fe603 in select () at ../sysdeps/unix/syscall-template.S:84 (More stack frames follow...) #0  0x00007ffff78fe603 in select () at ../sysdeps/unix/syscall-template.S:84 #1  0x0000555555554f5e in sleeper_or_burner (v=0x7fffffffdf30) at sleepers.c:86 (More stack frames follow...) (gdb)  This also works: (gdb) interpreter-exec console "bt 1" "bt 2" #0  0x00007ffff78fe603 in select () at ../sysdeps/unix/syscall-template.S:84 (More stack frames follow...) #0  0x00007ffff78fe603 in select () at ../sysdeps/unix/syscall-template.S:84 #1  0x0000555555554f5e in sleeper_or_burner (v=0x7fffffffdf30) at sleepers.c:86 (More stack frames follow...) (gdb)  So, it looks like really several commands can be given, but I am not sure if the commands and argument syntax is the same for all interpreters. Also, when looking at some mi documentation, we again see only one command mentionned: The '-interpreter-exec' Command ------------------------------- Synopsis --------      -interpreter-exec INTERPRETER COMMAND    Execute the specified COMMAND in the given INTERPRETER. > You meant to say that it's the command to execute and its arguments. > As it was before was also correct, IMHO. > > > set_cmd_completer (c, interpreter_completer); > > } > > Thanks, > Pedro Alves