static void
delete_lwp_cleanup (void *lp_voidp)
{
- struct lwp_info *lp = lp_voidp;
+ struct lwp_info *lp = (struct lwp_info *) lp_voidp;
delete_lwp (lp->ptid);
}
/* Put the signal number in ARGS so that inf_ptrace_detach will
pass it along with PTRACE_DETACH. */
- tem = alloca (8);
+ tem = (char *) alloca (8);
xsnprintf (tem, 8, "%d", (int) WSTOPSIG (status));
args = tem;
if (debug_linux_nat)
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
static int
count_events_callback (struct lwp_info *lp, void *data)
{
- int *count = data;
+ int *count = (int *) data;
gdb_assert (count != NULL);
static int
select_event_lwp_callback (struct lwp_info *lp, void *data)
{
- int *selector = data;
+ int *selector = (int *) data;
gdb_assert (selector != NULL);
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
static int
resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
{
- ptid_t *wait_ptid_p = data;
+ ptid_t *wait_ptid_p = (ptid_t *) data;
if (!lp->stopped)
{
static int
linux_nat_always_non_stop_p (struct target_ops *self)
{
- if (linux_ops->to_always_non_stop_p != NULL)
- return linux_ops->to_always_non_stop_p (linux_ops);
return 1;
}
return NULL;
}
- ret = xmalloc (len + 1);
+ ret = (char *) xmalloc (len + 1);
memcpy (ret, buf, len);
ret[len] = '\0';
return ret;