From: Sebastian Huber Date: Fri, 29 Jun 2018 08:50:11 +0000 (+0200) Subject: gdb: Prefer RISC-V register name "s0" over "fp" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41823f29a811bb250ae274652281a6294fdc2530;p=binutils-gdb.git gdb: Prefer RISC-V register name "s0" over "fp" The "fp" register name is an alias for "s0" which is an alias for "x8". The "fp" name is only understood by very recent Binutils and thus not used by GCC. GCC does not emit a frame pointer with common optimization options such as -Og or -O2. It is still possible to use the "fp" register name, e.g. (gdb) p/x $fp $1 = 0x800367c8 works. However, in the register dump you see now: (gdb) info registers ... t2 0xffffffffffffffff 18446744073709551615 s0 0x800367c8 0x800367c8 s1 0x80033280 2147693184 ... gdb/ * riscv-tdep.c (riscv_register_aliases): Swap "fp" and "s0" entries. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e3267853d37..0f601bdbf07 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-07-02 Sebastian Huber + + * riscv-tdep.c (riscv_register_aliases): Swap "fp" and "s0" entries. + 2018-06-29 Joel Brobecker * amd64-darwin-tdep.c (x86_darwin_init_abi_64): Add missing diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 154567136eb..4c68ef73fc5 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -128,8 +128,8 @@ static const struct register_alias riscv_register_aliases[] = { "t0", 5 }, { "t1", 6 }, { "t2", 7 }, - { "fp", 8 }, { "s0", 8 }, + { "fp", 8 }, { "s1", 9 }, { "a0", 10 }, { "a1", 11 },