From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id 9AFF6388F41A for ; Tue, 5 May 2020 17:02:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9AFF6388F41A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4B496117319; Tue, 5 May 2020 13:02:51 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ESOdjkodpAXN; Tue, 5 May 2020 13:02:51 -0400 (EDT) Received: from murgatroyd.Home (184-96-229-138.hlrn.qwest.net [184.96.229.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 10D821172E3; Tue, 5 May 2020 13:02:51 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Restore info_command and breakpoint Date: Tue, 5 May 2020 11:02:49 -0600 Message-Id: <20200505170249.31630-1-tromey@adacore.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-15.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP 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 17:02:58 -0000 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 + commands + silent + return + end + dir @srcdir@/../libiberty dir @srcdir@/../bfd dir @srcdir@ -- 2.21.1