From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 78D533858D39; Thu, 19 Jan 2023 13:05:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78D533858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674133511; bh=Q9VKQV9P0sJbpIutrzxE1VtWM3BUJ7a9D4R6FsO0VzQ=; h=From:To:Subject:Date:From; b=DY+dv0SHTw40yNk7Vic3G/2M1n/bU0IezBy+tQdjguECNZbmXEdig22dHJil2OjPr aBGFbZHrNCiMNiEZqMp5GO+uqZwVTwZ9MOdjdTpj2xxIf1qOSs9H+LK+xr3ILaAKcG pJob3ZhZq4JOgFZQ6K/6R6E4kZdwYZrd4owZE9UE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/tdep, aarch64] Remove fp and sp reg aliases, add x31 reg alias X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: a0d5ef869da20e023e4b75860012c56273f26d92 X-Git-Newrev: ea2f6fad7e104fb65da6a438bb0ec753210f1e90 Message-Id: <20230119130511.78D533858D39@sourceware.org> Date: Thu, 19 Jan 2023 13:05:11 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dea2f6fad7e10= 4fb65da6a438bb0ec753210f1e90 commit ea2f6fad7e104fb65da6a438bb0ec753210f1e90 Author: Tom de Vries Date: Thu Jan 19 14:05:08 2023 +0100 [gdb/tdep, aarch64] Remove fp and sp reg aliases, add x31 reg alias =20 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}, ... =20 The sp alias is superfluous, because the canonical name of x31 is alrea= dy sp. =20 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); ... =20 Fix this by removing the fp and sp aliases. =20 While we're at it, add an x31 alias for sp. =20 Approved-By: Luis Machado =20 Tested on aarch64-linux. PR tdep/30012 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30012 Diff: --- 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..7bf36d825c8 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; =20 -/* 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[] =3D { - /* 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_name= s, + so we're adding an x31 alias for sp. */ + {"x31", AARCH64_SP_REGNUM}, /* specials */ {"ip0", AARCH64_X0_REGNUM + 16}, {"ip1", AARCH64_X0_REGNUM + 17}