static void
add_to_pid_list (struct simple_pid_list **listp, int pid, int status)
{
- struct simple_pid_list *new_pid = xmalloc (sizeof (struct simple_pid_list));
+ struct simple_pid_list *new_pid = XNEW (struct simple_pid_list);
new_pid->pid = pid;
new_pid->status = status;
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);
}
gdb_assert (ptid_lwp_p (ptid));
- lp = (struct lwp_info *) xmalloc (sizeof (struct lwp_info));
+ lp = XNEW (struct lwp_info);
memset (lp, 0, sizeof (struct lwp_info));
/* 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)
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 (siginfo.si_signo == SIGTRAP)
{
- if (siginfo.si_code == GDB_ARCH_TRAP_BRKPT)
+ if (GDB_ARCH_IS_TRAP_BRKPT (siginfo.si_code))
{
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
target_pid_to_str (lp->ptid));
}
- if (!target_is_async_p ())
- {
- /* Causes SIGINT to be passed on to the attached process. */
- set_sigint_trap ();
- }
-
/* But if we don't find a pending event, we'll have to wait. Always
pull all events out of the kernel. We'll randomly select an
event LWP out of all that have events, to prevent starvation. */
ourstatus->kind = TARGET_WAITKIND_NO_RESUMED;
- if (!target_is_async_p ())
- clear_sigint_trap ();
-
restore_child_signals_mask (&prev_mask);
return minus_one_ptid;
}
sigsuspend (&suspend_mask);
}
- if (!target_is_async_p ())
- clear_sigint_trap ();
-
gdb_assert (lp);
status = lp->status;
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)
{
- return 0;
+ if (linux_ops->to_always_non_stop_p != NULL)
+ return linux_ops->to_always_non_stop_p (linux_ops);
+ return 1;
}
/* True if we want to support multi-process. To be removed when GDB
static void
linux_nat_terminal_inferior (struct target_ops *self)
{
- /* Like target_terminal_inferior, use target_can_async_p, not
- target_is_async_p, since at this point the target is not async
- yet. If it can async, then we know it will become async prior to
- resume. */
- if (!target_can_async_p ())
- {
- /* Async mode is disabled. */
- child_terminal_inferior (self);
- return;
- }
-
child_terminal_inferior (self);
/* Calls to target_terminal_*() are meant to be idempotent. */
static int
linux_nat_fileio_open (struct target_ops *self,
struct inferior *inf, const char *filename,
- int flags, int mode, int *target_errno)
+ int flags, int mode, int warn_if_slow,
+ int *target_errno)
{
int nat_flags;
mode_t nat_mode;
return NULL;
}
- ret = xmalloc (len + 1);
+ ret = (char *) xmalloc (len + 1);
memcpy (ret, buf, len);
ret[len] = '\0';
return ret;