return 1;
}
+ /* Always update the entry/return state, even if this particular
+ syscall isn't interesting to the core now. In async mode,
+ the user could install a new catchpoint for this syscall
+ between syscall enter/return, and we'll need to know to
+ report a syscall return if that happens. */
+ lp->syscall_state = (lp->syscall_state == TARGET_WAITKIND_SYSCALL_ENTRY
+ ? TARGET_WAITKIND_SYSCALL_RETURN
+ : TARGET_WAITKIND_SYSCALL_ENTRY);
+
if (catch_syscall_enabled ())
{
- /* Always update the entry/return state, even if this particular
- syscall isn't interesting to the core now. In async mode,
- the user could install a new catchpoint for this syscall
- between syscall enter/return, and we'll need to know to
- report a syscall return if that happens. */
- lp->syscall_state = (lp->syscall_state == TARGET_WAITKIND_SYSCALL_ENTRY
- ? TARGET_WAITKIND_SYSCALL_RETURN
- : TARGET_WAITKIND_SYSCALL_ENTRY);
-
if (catching_syscall_number (syscall_number))
{
/* Alright, an event to report. */
struct target_waitstatus *ourstatus = &lp->waitstatus;
int event = linux_ptrace_get_extended_event (status);
+ /* All extended events we currently use are mid-syscall. Only
+ PTRACE_EVENT_STOP is delivered more like a signal-stop, but
+ you have to be using PTRACE_SEIZE to get that. */
+ lp->syscall_state = TARGET_WAITKIND_SYSCALL_ENTRY;
+
if (event == PTRACE_EVENT_FORK || event == PTRACE_EVENT_VFORK
|| event == PTRACE_EVENT_CLONE)
{
if (linux_handle_syscall_trap (lp, 1))
return wait_lwp (lp);
}
+ else
+ {
+ /* Almost all other ptrace-stops are known to be outside of system
+ calls, with further exceptions in linux_handle_extended_wait. */
+ lp->syscall_state = TARGET_WAITKIND_IGNORE;
+ }
/* Handle GNU/Linux's extended waitstatus for trace events. */
if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP
if (linux_handle_syscall_trap (lp, 0))
return NULL;
}
+ else
+ {
+ /* Almost all other ptrace-stops are known to be outside of system
+ calls, with further exceptions in linux_handle_extended_wait. */
+ lp->syscall_state = TARGET_WAITKIND_IGNORE;
+ }
/* Handle GNU/Linux's extended waitstatus for trace events. */
if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP