gdb: LoongArch: add orig_a0 into register set
authorXi Ruoyao <xry111@xry111.site>
Tue, 5 Jul 2022 11:30:12 +0000 (19:30 +0800)
committerTiezhu Yang <yangtiezhu@loongson.cn>
Tue, 5 Jul 2022 14:26:45 +0000 (22:26 +0800)
commit736918239b16cc2ff57bfc64a982f2f0afc8c0f6
tree72fee59d80679278fc650315af221377586512cb
parent4694a0e5fe233c5a33f0e4e4b99c9c92021b8c88
gdb: LoongArch: add orig_a0 into register set

The basic support for LoongArch has been merged into the upstream Linux
kernel since 5.19-rc1 on June 5, 2022.  This commit adds orig_a0 which
is added into struct user_pt_regs [1] to match the upstream kernel, and
then the upstream GDB will work with the upstream kernel.

Note that orig_a0 was added into struct user_pt_regs in the development
cycle for merging LoongArch port into the upstream Linux kernel, so
earlier kernels (notably, the product kernel with version 4.19 used in
distros like UOS and Loongnix) don't have it.  Inspect
arch/loongarch/include/uapi/asm/ptrace.h in the kernel tree to make sure.
To build upstream GDB for a kernel lacking orig_a0, it's necessary to
revert this commit locally.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/include/uapi/asm/ptrace.h#n24

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
gdb/features/loongarch/base32.c
gdb/features/loongarch/base32.xml
gdb/features/loongarch/base64.c
gdb/features/loongarch/base64.xml
gdb/loongarch-linux-nat.c
gdb/loongarch-linux-tdep.c
gdb/loongarch-tdep.c
gdb/loongarch-tdep.h