Output format fixes, improving the situation after recent
change which added better handling of processes suddenly
disappearing. Now we often do not finish last line
before exiting in those cases.
The only change affecting something other than output
is change in umovestr where we were calling
abort() on ptrace error.
* strace.c (trace): If trace_syscall() failed with ESRCH,
finish current output line with " <unfinished ...>".
(mp_ioctl): While we are at it, fix gross style mismatch
in this function definition. No code chages.
* syscall.c (trace_syscall): If decode fails on syscall exit,
finish current output line with "= ? <unavailable>".
* util.c (umoven): Do not complain if error is ESRCH.
(umovestr): Do not complain and do not abort() if error is ESRCH.
* defs.h: Remove unused tcp parameter from printtrailer().
* process.c: Adjust printtrailer() calls accordingly.
* strace.c: Adjust printtrailer() calls accordingly.
* syscall.c: Adjust printtrailer() calls accordingly.
diff --git a/syscall.c b/syscall.c
index 6fc329e..40fd985 100644
--- a/syscall.c
+++ b/syscall.c
@@ -2330,6 +2330,9 @@
if (dtime)
gettimeofday(&tv, NULL);
+ /* BTW, why we don't just memorize syscall no. on entry
+ * in tcp->something?
+ */
scno_good = res = get_scno(tcp);
if (res == 0)
return res;
@@ -2368,6 +2371,8 @@
if (res != 1) {
tprintf(") ");
tabto(acolumn);
+ tprintf("= ? <unavailable>");
+ printtrailer();
tcp->flags &= ~TCB_INSYSCALL;
return res;
}
@@ -2466,7 +2471,7 @@
tprintf(" <%ld.%06ld>",
(long) tv.tv_sec, (long) tv.tv_usec);
}
- printtrailer(tcp);
+ printtrailer();
dumpio(tcp);
if (fflush(tcp->outf) == EOF)