extern bool get_stack_pointer(struct tcb *, kernel_ulong_t *);
extern void print_instruction_pointer(struct tcb *);
+extern void print_syscall_resume(struct tcb *tcp);
+
extern int syscall_entering_decode(struct tcb *);
extern int syscall_entering_trace(struct tcb *, unsigned int *);
extern void syscall_entering_finish(struct tcb *, int);
set_current_tcp(tcp);
}
- if ((followfork < 2 && printing_tcp != tcp)
- || (tcp->flags & TCB_REPRINT)) {
- tcp->flags &= ~TCB_REPRINT;
- printleader(tcp);
- tprintf("<... %s resumed>", tcp->s_ent->sys_name);
- }
+ print_syscall_resume(tcp);
if (!(tcp->sys_func_rval & RVAL_DECODED)) {
/*
return get_syscall_result(tcp);
}
-int
-syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
+void
+print_syscall_resume(struct tcb *tcp)
{
- if (syscall_tampered(tcp) || inject_delay_exit(tcp))
- tamper_with_syscall_exiting(tcp);
-
- if (cflag) {
- count_syscall(tcp, ts);
- if (cflag == CFLAG_ONLY_STATS) {
- return 0;
- }
- }
-
/* If not in -ff mode, and printing_tcp != tcp,
* then the log currently does not end with output
* of _our syscall entry_, but with something else.
* "strace -ff -oLOG test/threaded_execve" corner case.
* It's the only case when -ff mode needs reprinting.
*/
- if ((followfork < 2 && printing_tcp != tcp) || (tcp->flags & TCB_REPRINT)) {
+ if ((followfork < 2 && printing_tcp != tcp)
+ || (tcp->flags & TCB_REPRINT)) {
tcp->flags &= ~TCB_REPRINT;
printleader(tcp);
- tprintf("<... %s resumed> ", tcp->s_ent->sys_name);
+ tprintf("<... %s resumed>", tcp->s_ent->sys_name);
+ }
+}
+
+int
+syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
+{
+ if (syscall_tampered(tcp) || inject_delay_exit(tcp))
+ tamper_with_syscall_exiting(tcp);
+
+ if (cflag) {
+ count_syscall(tcp, ts);
+ if (cflag == CFLAG_ONLY_STATS) {
+ return 0;
+ }
}
+
+ print_syscall_resume(tcp);
printing_tcp = tcp;
tcp->s_prev_ent = NULL;