[PATCH] tile: Fix merge skew with new get_regs architecture

Chris Metcalf cmetcalf at tilera.com
Tue Feb 5 18:02:42 UTC 2013


Also fix a compiler warning about pt_reg_t in a printf expression.

Signed-off-by: Chris Metcalf <cmetcalf at tilera.com>
---
 defs.h    |    3 ++-
 syscall.c |    6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/defs.h b/defs.h
index d2c17e3..a45fa62 100644
--- a/defs.h
+++ b/defs.h
@@ -560,7 +560,8 @@ extern void call_summary(FILE *);
  || defined(X86_64) || defined(X32) \
  || defined(AARCH64) \
  || defined(ARM) \
- || defined(SPARC) || defined(SPARC64)
+ || defined(SPARC) || defined(SPARC64) \
+ || defined(TILE)
 extern long get_regs_error;
 # define clear_regs()  (get_regs_error = -1)
 extern void get_regs(pid_t pid);
diff --git a/syscall.c b/syscall.c
index d9f7b3b..f7db3a1 100644
--- a/syscall.c
+++ b/syscall.c
@@ -845,9 +845,9 @@ printcall(struct tcb *tcp)
 	tprintf("[%08lx] ", pc);
 #elif defined(TILE)
 # ifdef _LP64
-	tprintf("[%16lx] ", tile_regs.pc);
+	tprintf("[%16lx] ", (long)tile_regs.pc);
 # else
-	tprintf("[%08lx] ", tile_regs.pc);
+	tprintf("[%08lx] ", (long)tile_regs.pc);
 # endif
 #endif /* architecture */
 }
@@ -886,7 +886,7 @@ void get_regs(pid_t pid)
 # elif defined(SPARC) || defined(SPARC64)
 	get_regs_error = ptrace(PTRACE_GETREGS, pid, (char *)&regs, 0);
 # elif defined(TILE)
-	get_regs_error = ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long) &tile_regs);
+	get_regs_error = ptrace(PTRACE_GETREGS, pid, NULL, (long) &tile_regs);
 # endif
 }
 #endif
-- 
1.7.10.3





More information about the Strace-devel mailing list