diff options
author | Petr Machata <pmachata@redhat.com> | 2013-01-15 17:11:43 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2013-01-15 17:11:43 +0100 |
commit | 643c6460b64e37af58d8259d86689d414c6b4052 (patch) | |
tree | 0252923cd13544f90126acbfbe1a00dfa7a95028 /sysdeps/linux-gnu/trace.c | |
parent | 693dfad9c1b121cf079a3082866daa2225df1797 (diff) | |
download | ltrace-643c6460b64e37af58d8259d86689d414c6b4052.tar.gz |
Update call to arch_sw_singlestep
- After the refactoring, the prototype changed and it doesn't
return int anymore. Of course C happily implicitly converts
this. Ho hum.
Diffstat (limited to 'sysdeps/linux-gnu/trace.c')
-rw-r--r-- | sysdeps/linux-gnu/trace.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c index fe1f960..2f9cf2d 100644 --- a/sysdeps/linux-gnu/trace.c +++ b/sysdeps/linux-gnu/trace.c @@ -611,21 +611,25 @@ singlestep(struct process_stopping_handler *self) struct process *proc = self->task_enabling_breakpoint; struct sw_singlestep_data data = { self }; - int status = arch_sw_singlestep(self->task_enabling_breakpoint, - self->breakpoint_being_enabled, - &sw_singlestep_add_bp, &data); - - /* Propagate failure and success. */ - if (status <= 0) - return status; - - /* Otherwise do the default action: singlestep. */ - debug(1, "PTRACE_SINGLESTEP"); - if (ptrace(PTRACE_SINGLESTEP, proc->pid, 0, 0)) { - perror("PTRACE_SINGLESTEP"); + switch (arch_sw_singlestep(self->task_enabling_breakpoint, + self->breakpoint_being_enabled, + &sw_singlestep_add_bp, &data)) { + case SWS_HW: + /* Otherwise do the default action: singlestep. */ + debug(1, "PTRACE_SINGLESTEP"); + if (ptrace(PTRACE_SINGLESTEP, proc->pid, 0, 0)) { + perror("PTRACE_SINGLESTEP"); + return -1; + } + return 0; + + case SWS_OK: + return 0; + + case SWS_FAIL: return -1; } - return 0; + abort(); } static void |