summaryrefslogtreecommitdiff
path: root/gdb/loongarch-tdep.h
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2022-07-05 19:30:12 +0800
committerTiezhu Yang <yangtiezhu@loongson.cn>2022-07-05 22:26:45 +0800
commit736918239b16cc2ff57bfc64a982f2f0afc8c0f6 (patch)
tree72fee59d80679278fc650315af221377586512cb /gdb/loongarch-tdep.h
parent4694a0e5fe233c5a33f0e4e4b99c9c92021b8c88 (diff)
downloadbinutils-gdb-736918239b16cc2ff57bfc64a982f2f0afc8c0f6.tar.gz
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>
Diffstat (limited to 'gdb/loongarch-tdep.h')
-rw-r--r--gdb/loongarch-tdep.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/loongarch-tdep.h b/gdb/loongarch-tdep.h
index 54b34af1d66..acf0191fd65 100644
--- a/gdb/loongarch-tdep.h
+++ b/gdb/loongarch-tdep.h
@@ -35,9 +35,10 @@ enum
LOONGARCH_A0_REGNUM = 4, /* First Argument/Return Value. */
LOONGARCH_A7_REGNUM = 11, /* Seventh Argument/Syscall Number. */
LOONGARCH_FP_REGNUM = 22, /* Frame Pointer. */
- LOONGARCH_PC_REGNUM = 32, /* Program Counter. */
- LOONGARCH_BADV_REGNUM = 33, /* Bad Vaddr for Addressing Exception. */
- LOONGARCH_LINUX_NUM_GREGSET = 45, /* 32 GPR, PC, BADV, RESERVED 11. */
+ LOONGARCH_ORIG_A0_REGNUM = 32, /* Syscall's original arg0. */
+ LOONGARCH_PC_REGNUM = 33, /* Program Counter. */
+ LOONGARCH_BADV_REGNUM = 34, /* Bad Vaddr for Addressing Exception. */
+ LOONGARCH_LINUX_NUM_GREGSET = 45, /* 32 GPR, ORIG_A0, PC, BADV, RESERVED 10. */
};
/* Register set definitions. */