1*4882a593SmuzhiyunFrom d205f398e1e36f9673f50f368a3f29fd1dfaa794 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3*4882a593SmuzhiyunDate: Sat, 3 Jun 2017 21:23:52 +0200
4*4882a593SmuzhiyunSubject: [PATCH] sh/ptrace: Define pt_{dsp,}regs uapi_pt_{dsp,}regs on !GLIBC
5*4882a593Smuzhiyun systems
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunFixes a pt_{dsp,}regs redefinition when building with the musl C library
8*4882a593Smuzhiyunon SuperH.
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunInspired by
11*4882a593Smuzhiyunhttp://git.yoctoproject.org/clean/cgit.cgi/poky/plain/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch,
12*4882a593Smuzhiyunadapted for SuperH.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunSigned-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
15*4882a593Smuzhiyun[Rebase	on gdb 8.0]
16*4882a593SmuzhiyunSigned-off-by: Romain Naour <romain.naour@gmail.com>
17*4882a593Smuzhiyun---
18*4882a593Smuzhiyun gdbserver/linux-sh-low.cc | 8 ++++++++
19*4882a593Smuzhiyun 1 file changed, 8 insertions(+)
20*4882a593Smuzhiyun
21*4882a593Smuzhiyundiff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc
22*4882a593Smuzhiyunindex a6d3fc60047..b83cce6b9fe 100644
23*4882a593Smuzhiyun--- a/gdbserver/linux-sh-low.cc
24*4882a593Smuzhiyun+++ b/gdbserver/linux-sh-low.cc
25*4882a593Smuzhiyun@@ -76,7 +76,15 @@ extern const struct target_desc *tdesc_sh;
26*4882a593Smuzhiyun #include <sys/reg.h>
27*4882a593Smuzhiyun #endif
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun+#if !defined(__GLIBC__)
30*4882a593Smuzhiyun+# define pt_regs uapi_pt_regs
31*4882a593Smuzhiyun+# define pt_dspregs uapi_pt_dspregs
32*4882a593Smuzhiyun+#endif
33*4882a593Smuzhiyun #include <asm/ptrace.h>
34*4882a593Smuzhiyun+#if !defined(__GLIBC__)
35*4882a593Smuzhiyun+# undef pt_regs
36*4882a593Smuzhiyun+# undef pt_dspregs
37*4882a593Smuzhiyun+#endif
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun #define sh_num_regs 41
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun--
42*4882a593Smuzhiyun2.29.2
43*4882a593Smuzhiyun
44