binutils-gdb/gdb/arch
Hui Li 1304f47d02 gdb: LoongArch: Change LOONGARCH_FIRST_FP_REGNUM to 35
There is an assertion error "gdb_assert (n < tdesc->reg_defs.size ())"
in find_register_by_number() when gdb connects to gdbserver, this
is because the value of LOONGARCH_LINUX_NUM_GREGSET (45, which contains
10 reserved regs) is different with the number of regs (35, which not
contains 10 reserved regs) in file gdb/features/loongarch/base64.xml.
Add a new macro LOONGARCH_USED_NUM_GREGSET which is defined as 35 to
keep consistent with the gdb/features/loongarch/base64.xml, and then
define LOONGARCH_FIRST_FP_REGNUM as LOONGARCH_USED_NUM_GREGSET so that
all the reg numbers in regcache are consistent with tdesc reg numbers.

without this patch:

Execute on the target machine:

  $ gdbserver 192.168.1.123:5678 ./test

Execute on the host machine:

  $ gdb ./test
  (gdb) target remote 192.168.1.123:5678

Output on the target machine:

  Process ./test created; pid = 67683
  Listening on port 5678
  Remote debugging from host 192.168.1.136, port 6789
  gdbserver/regcache.cc:205: A problem internal to GDBserver has been detected.
  find_register_by_number: Assertion 'n < tdesc->reg_defs.size ()' failed.

Output on the host machine:

  Remote debugging using 192.168.1.123:5678
  Remote connection closed

Signed-off-by: Hui Li <lihui@loongson.cn>
Approved-By: John Baldwin <jhb@FreeBSD.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
2024-03-02 19:07:04 +08:00
..
aarch32.c gdb/arm: Remove tpidruro register from non-FreeBSD target descriptions 2024-02-29 12:27:27 -03:00
aarch32.h gdb/arm: Remove tpidruro register from non-FreeBSD target descriptions 2024-02-29 12:27:27 -03:00
aarch64-insn.c aarch64: Use aarch64_debug_printf in a few more places 2024-02-28 16:03:16 -08:00
aarch64-insn.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
aarch64-mte-linux.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
aarch64-mte-linux.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
aarch64-scalable-linux.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
aarch64-scalable-linux.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
aarch64.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
aarch64.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
amd64.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
amd64.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arc.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arc.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arm-get-next-pcs.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arm-get-next-pcs.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arm-linux.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arm-linux.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arm.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
arm.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
csky.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
csky.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
i386.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
i386.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
loongarch.c gdb: LoongArch: Add LBT extension support 2024-02-06 18:40:19 +08:00
loongarch.h gdb: LoongArch: Change LOONGARCH_FIRST_FP_REGNUM to 35 2024-03-02 19:07:04 +08:00
ppc-linux-common.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
ppc-linux-common.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
ppc-linux-tdesc.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
riscv.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
riscv.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
tic6x.c Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
tic6x.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
xtensa.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00