summaryrefslogtreecommitdiff
path: root/package/strace/patches/patch-process_c
blob: 7309200d016d8a525aff4a939b89d099e96913dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- strace-4.5.18.orig/process.c	2008-07-18 04:16:47.000000000 +0200
+++ strace-4.5.18/process.c	2009-01-02 21:24:05.490094969 +0100
@@ -584,7 +584,7 @@ extern void print_ldt_entry();
 #  define ARG_PTID	(known_scno(tcp) == SYS_clone2 ? 3 : 2)
 #  define ARG_CTID	(known_scno(tcp) == SYS_clone2 ? 4 : 3)
 #  define ARG_TLS	(known_scno(tcp) == SYS_clone2 ? 5 : 4)
-# elif defined S390 || defined S390X
+# elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
 #  define ARG_STACK	0
 #  define ARG_FLAGS	1
 #  define ARG_PTID	2
@@ -740,6 +740,10 @@ int new;
                                    0x100000 | new) < 0)
                        return -1;
        return 0;
+#elif defined(CRISV10) || defined(CRISV32)
+	if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_R9), new) < 0)
+		return -1;
+	return 0;
 #elif defined(ARM)
        /* Some kernels support this, some (pre-2.6.16 or so) don't.  */
 # ifndef PTRACE_SET_SYSCALL
@@ -3003,7 +3007,77 @@ const struct xlat struct_user_offsets[] 
 	{ 69,			"fpcsr"					},
 	{ 70,			"fpeir"					},
 #endif
+#ifdef CRISV10
+	{ 4*PT_FRAMETYPE, "4*PT_FRAMETYPE" },
+	{ 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
+	{ 4*PT_R13, "4*PT_R13" },
+	{ 4*PT_R12, "4*PT_R12" },
+	{ 4*PT_R11, "4*PT_R11" },
+	{ 4*PT_R10, "4*PT_R10" },
+	{ 4*PT_R9, "4*PT_R9" },
+	{ 4*PT_R8, "4*PT_R8" },
+	{ 4*PT_R7, "4*PT_R7" },
+	{ 4*PT_R6, "4*PT_R6" },
+	{ 4*PT_R5, "4*PT_R5" },
+	{ 4*PT_R4, "4*PT_R4" },
+	{ 4*PT_R3, "4*PT_R3" },
+	{ 4*PT_R2, "4*PT_R2" },
+	{ 4*PT_R1, "4*PT_R1" },
+	{ 4*PT_R0, "4*PT_R0" },
+	{ 4*PT_MOF, "4*PT_MOF" },
+	{ 4*PT_DCCR, "4*PT_DCCR" },
+	{ 4*PT_SRP, "4*PT_SRP" },
+	{ 4*PT_IRP, "4*PT_IRP" },
+	{ 4*PT_CSRINSTR, "4*PT_CSRINSTR" },
+	{ 4*PT_CSRADDR, "4*PT_CSRADDR" },
+	{ 4*PT_CSRDATA, "4*PT_CSRDATA" },
+	{ 4*PT_USP, "4*PT_USP" },
+#endif
+#ifdef CRISV32
+	{ 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
+	{ 4*PT_R0, "4*PT_R0" },
+	{ 4*PT_R1, "4*PT_R1" },
+	{ 4*PT_R2, "4*PT_R2" },
+	{ 4*PT_R3, "4*PT_R3" },
+	{ 4*PT_R4, "4*PT_R4" },
+	{ 4*PT_R5, "4*PT_R5" },
+	{ 4*PT_R6, "4*PT_R6" },
+	{ 4*PT_R7, "4*PT_R7" },
+	{ 4*PT_R8, "4*PT_R8" },
+	{ 4*PT_R9, "4*PT_R9" },
+	{ 4*PT_R10, "4*PT_R10" },
+	{ 4*PT_R11, "4*PT_R11" },
+	{ 4*PT_R12, "4*PT_R12" },
+	{ 4*PT_R13, "4*PT_R13" },
+	{ 4*PT_ACR, "4*PT_ACR" },
+	{ 4*PT_SRS, "4*PT_SRS" },
+	{ 4*PT_MOF, "4*PT_MOF" },
+	{ 4*PT_SPC, "4*PT_SPC" },        
+	{ 4*PT_CCS, "4*PT_CCS" },
+	{ 4*PT_SRP, "4*PT_SRP" },
+	{ 4*PT_ERP, "4*PT_ERP" },
+	{ 4*PT_EXS, "4*PT_EXS" },
+	{ 4*PT_EDA, "4*PT_EDA" },
+	{ 4*PT_USP, "4*PT_USP" },
+	{ 4*PT_PPC, "4*PT_PPC" },
+	{ 4*PT_BP_CTRL, "4*PT_BP_CTRL" },
+	{ 4*PT_BP+4, "4*PT_BP+4" },
+	{ 4*PT_BP+8, "4*PT_BP+8" },
+	{ 4*PT_BP+12, "4*PT_BP+12" },
+	{ 4*PT_BP+16, "4*PT_BP+16" },
+	{ 4*PT_BP+20, "4*PT_BP+20" },
+	{ 4*PT_BP+24, "4*PT_BP+24" },
+	{ 4*PT_BP+28, "4*PT_BP+28" },
+	{ 4*PT_BP+32, "4*PT_BP+32" },
+	{ 4*PT_BP+36, "4*PT_BP+36" },
+	{ 4*PT_BP+40, "4*PT_BP+40" },
+	{ 4*PT_BP+44, "4*PT_BP+44" },
+	{ 4*PT_BP+48, "4*PT_BP+48" },
+	{ 4*PT_BP+52, "4*PT_BP+52" },
+	{ 4*PT_BP+56, "4*PT_BP+56" },
+#endif
 
+#if !defined(CRISV10) && !defined(CRISV32)
 #if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64)
 	{ uoff(u_fpvalid),	"offsetof(struct user, u_fpvalid)"	},
 #endif
@@ -3041,6 +3115,7 @@ const struct xlat struct_user_offsets[] 
 #if defined(I386) || defined(X86_64)
 	{ uoff(u_debugreg),	"offsetof(struct user, u_debugreg)"	},
 #endif /* I386 */
+#endif /* !CRISV10/!CRISV32 */
 #endif /* !IA64 */
 #endif /* !ALPHA */
 #endif /* !POWERPC/!SPARC */