From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy2-pub.mail.unifiedlayer.com (gproxy2-pub.mail.unifiedlayer.com [69.89.18.3]) by sourceware.org (Postfix) with ESMTPS id 7A188384188F for ; Fri, 27 May 2022 13:53:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A188384188F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw14.mail.unifiedlayer.com (unknown [10.0.90.129]) by progateway4.mail.pro1.eigbox.com (Postfix) with ESMTP id B101610048352 for ; Fri, 27 May 2022 13:53:25 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id uaP7n9i4AhWk0uaP7noX0Y; Fri, 27 May 2022 13:53:25 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=IrfbzJzg c=1 sm=1 tr=0 ts=6290d7d5 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=oZkIemNP1mAA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=vvR8Y8ZhJHuGozYQ7P8A:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FIl3Y3A73ORsJGtIjkG70U7p76srbghVRGeAK+qEvuk=; b=BWFujmcX5WjR1sK1maCEiI0/Pn Z0hp85PXbNFYLpTx48Ix2jCg4Ics4B2GriulsOfRvZIAMGRL6rpA4Q0Z4lyBSWYQn/oGGo9GKhxBf ijF4xINvNLooUsdwfvSTYu/Dr; Received: from 71-211-158-194.hlrn.qwest.net ([71.211.158.194]:45626 helo=prentzel.Home) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nuaP7-002BRk-05; Fri, 27 May 2022 07:53:25 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Fix crash with "maint print arc" Date: Fri, 27 May 2022 07:53:22 -0600 Message-Id: <20220527135322.2794401-1-tom@tromey.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.158.194 X-Source-L: No X-Exim-ID: 1nuaP7-002BRk-05 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-158-194.hlrn.qwest.net (prentzel.Home) [71.211.158.194]:45626 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3027.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Fri, 27 May 2022 13:53:28 -0000 Luis noticed that "maint print arc" would crash, because the command handler did not find "show" in the command name, violating an invariant. This patch fixes the bug by changing the registration to use add_basic_prefix_cmd instead. --- gdb/arc-tdep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 98bd1c4bc0a..3edfd466f3b 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -2474,11 +2474,11 @@ _initialize_arc_tdep () /* Register ARC-specific commands with gdb. */ /* Add root prefix command for "maintenance print arc" commands. */ - add_show_prefix_cmd ("arc", class_maintenance, - _("ARC-specific maintenance commands for printing GDB " - "internal state."), - &maintenance_print_arc_list, - 0, &maintenanceprintlist); + add_basic_prefix_cmd ("arc", class_maintenance, + _("ARC-specific maintenance commands for printing GDB " + "internal state."), + &maintenance_print_arc_list, + 0, &maintenanceprintlist); add_cmd ("arc-instruction", class_maintenance, dump_arc_instruction_command, -- 2.34.1