summaryrefslogtreecommitdiff
path: root/package/strace/patches/patch-util_c
blob: 17112f30e1e80ab9a45875f7d595be215869effc (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
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- strace-4.5.18.orig/util.c	2008-08-19 06:47:51.000000000 +0200
+++ strace-4.5.18/util.c	2009-01-02 21:24:05.530098238 +0100
@@ -1097,6 +1097,12 @@ struct tcb *tcp;
 #elif defined(SH64)
        if (upeek(tcp->pid, REG_PC ,&pc) < 0)
                return -1;
+#elif defined(CRISV10)
+	if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0)
+		return -1;
+#elif defined(CRISV32)
+	if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0)
+		return -1;
 #endif
 	return pc;
 #endif /* LINUX */
@@ -1245,6 +1251,22 @@ struct tcb *tcp;
 		return;
 	}
 	tprintf("[%08lx] ", pc);
+#elif defined(CRISV10)
+	long pc;
+	
+	if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0) {
+		PRINTBADPC;
+		return;
+	}
+	tprintf("[%08lx] ", (unsigned long)pc);
+#elif defined(CRISV32)
+	long pc;
+	
+	if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0) {
+		PRINTBADPC;
+		return;
+	}
+	tprintf("[%08lx] ", (unsigned long)pc);
 #endif /* !architecture */
 #endif /* LINUX */
 
@@ -1444,6 +1466,13 @@ typedef struct regs arg_setup_state;
 #  define arg0_offset   (REG_OFFSET+16)
 #  define arg1_offset   (REG_OFFSET+24)
 #  define restore_arg0(tcp, state, val) 0
+# elif defined CRISV10 || defined CRISV32
+#  define arg0_offset   (4*PT_R11)
+#  define arg1_offset   (4*PT_ORIG_R10)
+#  define restore_arg0(tcp, state, val) 0
+#  define restore_arg1(tcp, state, val) 0
+#  define arg0_index   1
+#  define arg1_index   0
 # else
 #  define arg0_offset	0
 #  define arg1_offset	4