X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Flinux-nat.c;h=6423ecc998e8f043c62468cb202b949d0a9addab;hb=b08b78e7d4bb56f395d3212eed6184ede236c760;hp=a13fb9edad13f54b999fb27b61546ce35918befa;hpb=b2a33439909493f5bf93ada871bd588f365d61f4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index a13fb9edad..6423ecc998 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -336,7 +336,7 @@ lwp_stop_reason (struct lwp_info *lwp) 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; @@ -438,7 +438,7 @@ num_lwps (int pid) 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); } @@ -822,7 +822,7 @@ add_initial_lwp (ptid_t 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)); @@ -1540,7 +1540,7 @@ linux_nat_detach (struct target_ops *ops, const char *args, int from_tty) /* 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) @@ -2719,7 +2719,7 @@ running_callback (struct lwp_info *lp, void *data) static int count_events_callback (struct lwp_info *lp, void *data) { - int *count = data; + int *count = (int *) data; gdb_assert (count != NULL); @@ -2758,7 +2758,7 @@ lwp_status_pending_p (struct lwp_info *lp) static int select_event_lwp_callback (struct lwp_info *lp, void *data) { - int *selector = data; + int *selector = (int *) data; gdb_assert (selector != NULL); @@ -2801,7 +2801,7 @@ check_stopped_by_breakpoint (struct lwp_info *lp) { 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, @@ -3442,12 +3442,6 @@ linux_nat_wait_1 (struct target_ops *ops, 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. */ @@ -3518,9 +3512,6 @@ linux_nat_wait_1 (struct target_ops *ops, ourstatus->kind = TARGET_WAITKIND_NO_RESUMED; - if (!target_is_async_p ()) - clear_sigint_trap (); - restore_child_signals_mask (&prev_mask); return minus_one_ptid; } @@ -3546,9 +3537,6 @@ linux_nat_wait_1 (struct target_ops *ops, sigsuspend (&suspend_mask); } - if (!target_is_async_p ()) - clear_sigint_trap (); - gdb_assert (lp); status = lp->status; @@ -3653,7 +3641,7 @@ linux_nat_wait_1 (struct target_ops *ops, 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) { @@ -4629,17 +4617,6 @@ static int async_terminal_is_ours = 1; 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. */ @@ -4922,7 +4899,8 @@ linux_nat_fileio_pid_of (struct inferior *inf) 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; @@ -4962,7 +4940,7 @@ linux_nat_fileio_readlink (struct target_ops *self, return NULL; } - ret = xmalloc (len + 1); + ret = (char *) xmalloc (len + 1); memcpy (ret, buf, len); ret[len] = '\0'; return ret;