Conversation
trufae
left a comment
There was a problem hiding this comment.
Its unclear to me how this feature is used in contrast to the current dcs also whats “fast time” exactly meaning?
| return false; | ||
| } | ||
| if (!thread_state->in_syscall) { | ||
| if (!r_debug_fasttime_prepare_syscall_entry (dbg, tid, syscall_num)) { |
There was a problem hiding this comment.
Use shorter function names
| RListIter *it; | ||
| r_list_foreach (dbg->threads, it, th) { | ||
| ret = r_debug_ptrace (dbg, PTRACE_CONT, th->pid, 0, 0); | ||
| ret = r_debug_ptrace (dbg, ptrace_cmd, th->pid, 0, 0); |
There was a problem hiding this comment.
Have you see dcs command to continue until syscall? Isnt that feature the same thing?
dbg.fasttime=true changes a different workflow, when the user just wants to continue execution, and the program spends a lot of time in nanosleep / clock_nanosleep, the debugger short-circuits those timer syscalls instead of waiting for real wall-clock time to pass. |
|
Ok so fasttime is just: replace sleep syscalls with return 0. As long as this is linux specific, and adds lots of complexity and the usecase for this is nearly zero. I would suggest a different approach: add cmd.syscall. Something that is executed when we hit a syscall . Like what cmd.esil.* does but for the debugger. this way the feature is generic and can be used for a large variety or usecases because then you can use r2js to intercept syscall arguments and replace return values etc. this may result into 0 new apis and naybe q coupke of commands and one config var |
|
Unreviewed writeup from claude about my thoughts. Take it with care : Proposal: Generic syscall interception via
|
|
We may be able to intercept the syscall before its executed:
|
|
This feature should be possible to be implemented not only on linux but also on BSD with the PT_SYSCALL. Windows and macos are out |
This extracts the dbg.fasttime feature into its own branch.
Scope:
Note: