* [Linux-ia64] small strace fix
@ 2001-04-12 6:31 David Mosberger
0 siblings, 0 replies; only message in thread
From: David Mosberger @ 2001-04-12 6:31 UTC (permalink / raw)
To: linux-ia64
Hi Don,
Attached below is a small fix for strace. It makes strace work across
inlined system calls. Actually, you also need a one-line fix to the
kernel for this to really work:
--- arch/ia64/kernel/ivt.S~ Thu Mar 29 13:57:32 2001
+++ arch/ia64/kernel/ivt.S Wed Apr 11 23:09:07 2001
@@ -702,7 +702,7 @@
st8 [r16]=r18 // store new value for cr.isr
(p8) br.call.sptk.many b6¶ // ignore this return addr
- br.call.sptk.many rp=ia64_trace_syscall // rp will be overwritten (ignored)
+ br.cond.sptk.many ia64_trace_syscall
// NOT REACHED
END(break_fault)
--david
ChangeLog
2001-04-11 David Mosberger <davidm@hpl.hp.com>
* syscall.c (syscall_enter): Use PT_RBS_END instead of deprecated
PT_AR_BSP. Pick up arguments starting with out0, which is not
always the same as r32 (e.g., consider inlined syscalls).
Index: syscall.c
=================================RCS file: /cvsroot/strace/strace/syscall.c,v
retrieving revision 1.25.2.3
diff -u -r1.25.2.3 syscall.c
--- syscall.c 2001/03/07 01:13:25 1.25.2.3
+++ syscall.c 2001/04/12 06:27:57
@@ -1190,21 +1190,26 @@
}
#elif defined (IA64)
{
- unsigned long *bsp, cfm, i;
+ unsigned long *out0, *rbs_end, cfm, sof, sol, i;
+#ifndef PT_RBS_END
+# define PT_RBS_END PT_AR_BSP /* be backwards compatible with kernels before 2.4.4... */
+#endif
- if (upeek(pid, PT_AR_BSP, (long *) &bsp) < 0)
+ if (upeek(pid, PT_RBS_END, (long *) &rbs_end) < 0)
return -1;
if (upeek(pid, PT_CFM, (long *) &cfm) < 0)
return -1;
- bsp = ia64_rse_skip_regs(bsp, -(cfm & 0x7f));
+ sof = (cfm >> 0) & 0x7f;
+ sol = (cfm >> 7) & 0x7f;
+ out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
if (tcp->scno >= 0 && tcp->scno < nsyscalls && sysent[tcp->scno].nargs != -1)
tcp->u_nargs = sysent[tcp->scno].nargs;
- else
+ else
tcp->u_nargs = MAX_ARGS;
for (i = 0; i < tcp->u_nargs; ++i) {
- if (umoven(tcp, (unsigned long) ia64_rse_skip_regs(bsp, i), sizeof(long),
+ if (umoven(tcp, (unsigned long) ia64_rse_skip_regs(out0, i), sizeof(long),
(char *) &tcp->u_arg[i])
< 0)
return -1;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-04-12 6:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-12 6:31 [Linux-ia64] small strace fix David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox