Index: darwin-nat.c =================================================================== RCS file: /cvs/src/src/gdb/darwin-nat.c,v retrieving revision 1.6 diff -u -p -r1.6 darwin-nat.c --- darwin-nat.c 16 Mar 2009 15:57:08 -0000 1.6 +++ darwin-nat.c 16 Mar 2009 16:22:01 -0000 @@ -90,8 +90,6 @@ static void darwin_mourn_inferior (struc static int darwin_lookup_task (char *args, task_t * ptask, int *ppid); -static void darwin_kill_inferior (struct target_ops *ops); - static void darwin_ptrace_me (void); static void darwin_ptrace_him (int pid); @@ -337,8 +335,7 @@ darwin_stop (ptid_t t) } static void -darwin_resume (struct target_ops *ops, - ptid_t ptid, int step, enum target_signal signal) +darwin_resume_1 (ptid_t ptid, int step, enum target_signal signal) { struct target_waitstatus status; int pid; @@ -406,6 +403,13 @@ darwin_resume (struct target_ops *ops, } } +static void +darwin_resume (struct target_ops *ops, + ptid_t ptid, int step, enum target_signal signal) +{ + darwin_resume_1 (ptid, step, signal); +} + kern_return_t catch_exception_raise_state (mach_port_t port, @@ -475,8 +479,7 @@ catch_exception_raise (mach_port_t port, } static ptid_t -darwin_wait (struct target_ops *ops, - ptid_t ptid, struct target_waitstatus *status) +darwin_wait_1 (ptid_t ptid, struct target_waitstatus *status) { kern_return_t kret; mach_msg_header_t *hdr = &msgin.hdr; @@ -613,6 +616,13 @@ darwin_wait (struct target_ops *ops, } } +static ptid_t +darwin_wait (struct target_ops *ops, + ptid_t ptid, struct target_waitstatus *status) +{ + return darwin_wait_1 (ptid, status); +} + static void darwin_mourn_inferior (struct target_ops *ops) { @@ -668,7 +678,7 @@ darwin_mourn_inferior (struct target_ops } static void -darwin_stop_inferior (struct target_ops *ops, darwin_inferior *inf) +darwin_stop_inferior_1 (darwin_inferior *inf) { struct target_waitstatus wstatus; ptid_t ptid; @@ -688,12 +698,18 @@ darwin_stop_inferior (struct target_ops if (res != 0) warning (_("cannot kill: %s\n"), strerror (errno)); - ptid = darwin_wait (ops, inferior_ptid, &wstatus); + ptid = darwin_wait_1 (inferior_ptid, &wstatus); gdb_assert (wstatus.kind = TARGET_WAITKIND_STOPPED); } static void -darwin_kill_inferior (struct target_ops *ops) +darwin_stop_inferior (struct target_ops *ops, darwin_inferior *inf) +{ + darwin_stop_inferior_1 (inf); +} + +static void +darwin_kill_inferior (void) { struct target_waitstatus wstatus; ptid_t ptid; @@ -706,7 +722,7 @@ darwin_kill_inferior (struct target_ops if (ptid_equal (inferior_ptid, null_ptid)) return; - darwin_stop_inferior (ops, darwin_inf); + darwin_stop_inferior_1 (darwin_inf); res = PTRACE (PT_KILL, darwin_inf->pid, 0, 0); gdb_assert (res == 0); @@ -714,13 +730,13 @@ darwin_kill_inferior (struct target_ops if (msg_state == GOT_MESSAGE) { exc_msg.ex_type = 0; - darwin_resume (ops, inferior_ptid, 0, 0); + darwin_resume_1 (inferior_ptid, 0, 0); } kret = task_resume (darwin_inf->task); MACH_CHECK_ERROR (kret); - ptid = darwin_wait (ops, inferior_ptid, &wstatus); + ptid = darwin_wait_1 (inferior_ptid, &wstatus); /* This double wait seems required... */ res = waitpid (darwin_inf->pid, &status, 0);