From: David Mosberger <davidm@hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] small strace fix
Date: Thu, 12 Apr 2001 06:31:47 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590693005394@msgid-missing> (raw)
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;
reply other threads:[~2001-04-12 6:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590693005394@msgid-missing \
--to=davidm@hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox