From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 590253858C52 for ; Thu, 19 Jan 2023 12:37:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 590253858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 750DC37F1D; Thu, 19 Jan 2023 12:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1674131865; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=JYcR8vfYmWo0dQTNBnu/KTJg4aKKGoxGv5xx0Uk50yw=; b=qQ6GiMD6Yc3eY3p1fI3ixh/V1tk04t2ZQw5UoOtb9r6fTp1q3qkiPykt0ZpYeWWY7PylhN 8K8NMt/F8KptkLA9v7eQl3X+UiQaHv14HpNSg+uEfxcy7gcz2HjYZKlf1kGrWeWTzWlVHI wgdNrnX4jKnByutTiI5aK4cn7rXv8rM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1674131865; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=JYcR8vfYmWo0dQTNBnu/KTJg4aKKGoxGv5xx0Uk50yw=; b=4q2s6JrgQOm1ZyPRaRry5pxXchfx7OsWifwRE/O2kD8PQ0SrRJxk2HYaEvIGlXsj55z9Xe juvjumAVmAmNpPDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5B4BA139ED; Thu, 19 Jan 2023 12:37:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id n6ctFZk5yWPyZAAAMHmgww (envelope-from ); Thu, 19 Jan 2023 12:37:45 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Luis Machado Subject: [PATCH] [gdb/tdep, aarch64] Remove fp and sp reg aliases, add x31 reg alias Date: Thu, 19 Jan 2023 13:37:44 +0100 Message-Id: <20230119123744.18276-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Tom de Vries In aarch64-tdep.c we find these register aliases: ... { /* 64-bit register names. */ {"fp", AARCH64_FP_REGNUM}, {"lr", AARCH64_LR_REGNUM}, {"sp", AARCH64_SP_REGNUM}, ... The sp alias is superfluous, because the canonical name of x31 is already sp. The fp alias is superfluous, because it's already taken by the default meaning of fp, assigned here in _initialize_frame_reg: ... user_reg_add_builtin ("fp", value_of_builtin_frame_fp_reg, NULL); ... Fix this by removing the fp and sp aliases. While we're at it, add an x31 alias for sp. Tested on aarch64-linux. PR tdep/30012 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30012 --- gdb/aarch64-tdep.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index b576d3b9d99..1dcedac31f2 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -61,17 +61,20 @@ /* All possible aarch64 target descriptors. */ static std::unordered_map tdesc_aarch64_map; -/* The standard register names, and all the valid aliases for them. */ +/* The standard register names, and all the valid aliases for them. + We're not adding fp here, that name is already taken, see + _initialize_frame_reg. */ static const struct { const char *const name; int regnum; } aarch64_register_aliases[] = { - /* 64-bit register names. */ - {"fp", AARCH64_FP_REGNUM}, + /* Link register alias for x30. */ {"lr", AARCH64_LR_REGNUM}, - {"sp", AARCH64_SP_REGNUM}, + /* Sp is the canonical name for x31 according to aarch64_r_register_names, + so we're adding an x31 alias for sp. */ + {"x31", AARCH64_SP_REGNUM}, /* specials */ {"ip0", AARCH64_X0_REGNUM + 16}, {"ip1", AARCH64_X0_REGNUM + 17} base-commit: 75c2efc6f19fe454413aa70d2c37e543f04a67e1 -- 2.35.3