From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 2E337388F400 for ; Tue, 5 May 2020 18:26:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2E337388F400 Received: by mail-qt1-x843.google.com with SMTP id g16so2813167qtp.11 for ; Tue, 05 May 2020 11:26:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bka/A5lWWFfjGSnsFsVetQwVmVdeFhWDszboHt0wBhg=; b=QJyiaj3muJSCZ4RfblMM8Ns1+fQ/g2yqAwbgCcq9h9QjOAOy7kVJGcXtF3xAFcppXi L2we3ZYGqarUQqcTScrIPuKnujXA9spJbaetaTt7nUdVymXxJLhhv8AvBQ1A/CXQGixR cgww0Gh1fFLwaZPAfvWeG5U/tLjR+Le13ptzLw+X3OZZjBdoo3lx8uZ8jjCNGJiUAUiR xftMYX5MyHNMXpcKbVy4lJr4D1ltnsDVDjlp9pClERrKHM+I6A9JLAkhR4dywpdm87CE QyE/huD7Ph022WynnWqirxzrCoqu5heVamCeiLrU66rIlIxifou0CSZ7A+uFxuPk4dHs Sd0Q== X-Gm-Message-State: AGi0PuZSNDkeXYIctTc4kqY0JfK7qoASlSVJcbeakfxuxy9lJmcYUCya fva/4dOU+MMcY81mTPR0YMc3/C1ftjku64SvLnYKvncw X-Google-Smtp-Source: APiQypJSoKpwqdcriT/BFNqgQZKbqZMYQCusv+GJwX0L4aKbQZ41YAgLfGon0uir9cDQuijidcmoDHgH7ld9i5sfXps= X-Received: by 2002:ac8:37e6:: with SMTP id e35mr4150295qtc.19.1588703208332; Tue, 05 May 2020 11:26:48 -0700 (PDT) MIME-Version: 1.0 References: <20200505170249.31630-1-tromey@adacore.com> In-Reply-To: <20200505170249.31630-1-tromey@adacore.com> From: Christian Biesinger Date: Tue, 5 May 2020 13:26:11 -0500 Message-ID: Subject: Re: [PATCH] Restore info_command and breakpoint To: Tom Tromey Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-26.3 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2020 18:26:52 -0000 On Tue, May 5, 2020 at 12:03 PM Tom Tromey wrote: > > As discussed on gdb-patches, this restores info_command and the > breakpoint on info_command in gdb-gdb.gdb. This reverts a tiny part > of 0743fc83c03 ("Replace most calls to help_list and cmd_show_list"), > as well as 652fc23a30a ("Remove gdb-gdb.gdb breakpoint on disappeared > function info_command."). > > gdb/ChangeLog > 2020-05-05 Tom Tromey > > * cli/cli-cmds.c (info_command): Restore. > (_initialize_cli_cmds): Use add_prefix_command for "info". > * gdb-gdb.gdb.in: Restore breakpoint on info_command. > --- > gdb/ChangeLog | 6 ++++++ > gdb/cli/cli-cmds.c | 15 +++++++++++++-- > gdb/gdb-gdb.gdb.in | 6 ++++++ > 3 files changed, 25 insertions(+), 2 deletions(-) > > diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c > index 1b677f5d7a1..104d273812f 100644 > --- a/gdb/cli/cli-cmds.c > +++ b/gdb/cli/cli-cmds.c > @@ -191,6 +191,17 @@ error_no_arg (const char *why) > error (_("Argument required (%s)."), why); > } > > +/* This implements the "info" prefix command. Normally such commands > + are automatically handled by add_basic_prefix_cmd, but in this case > + a separate command is used so that it can be hooked into by > + gdb-gdb.gdb. */ > + > +static void > +info_command (const char *arg, int from_tty) > +{ > + help_list (infolist, "info ", all_commands, gdb_stdout); > +} > + > /* See cli/cli-cmds.h. */ > > void > @@ -2189,9 +2200,9 @@ Without an argument, history expansion is enabled."), > show_history_expansion_p, > &sethistlist, &showhistlist); > > - add_basic_prefix_cmd ("info", class_info, _("\ > + add_prefix_cmd ("info", class_info, info_command, _("\ > Generic command for showing things about the program being debugged."), > - &infolist, "info ", 0, &cmdlist); > + &infolist, "info ", 0, &cmdlist); > add_com_alias ("i", "info", class_info, 1); > add_com_alias ("inf", "info", class_info, 1); > > diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in > index b647445e8c9..05a38b2670b 100644 > --- a/gdb/gdb-gdb.gdb.in > +++ b/gdb/gdb-gdb.gdb.in > @@ -7,6 +7,12 @@ if !$gdb_init_done > > b internal_error > > + b info_command It would probably be good to add a comment here? # This provides an easy way to break into the top-level GDB by typing "info" > + commands > + silent > + return > + end > + > dir @srcdir@/../libiberty > dir @srcdir@/../bfd > dir @srcdir@ > -- > 2.21.1 >