aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-11-16 19:22:59 +0000
committerDaniel Jacobowitz <drow@false.org>2002-11-16 19:22:59 +0000
commit47932f85ce27bcf18f485c2492dfafb02132dce9 (patch)
treef64276eec5b4178f035fc9e7f5d4476c18be0c61 /gdb/infrun.c
parent4088142aaeb229390c53957ab465955725d43b17 (diff)
downloadgdb-47932f85ce27bcf18f485c2492dfafb02132dce9.zip
gdb-47932f85ce27bcf18f485c2492dfafb02132dce9.tar.gz
gdb-47932f85ce27bcf18f485c2492dfafb02132dce9.tar.bz2
* breakpoint.c (bpstat_stop_status): Call inferior_has_forked,
inferior_has_vforked, and inferior_has_execd instead of target_has_forked, target_has_vforked, and target_has_execd. * config/pa/nm-hppah.h (CHILD_HAS_FORKED, CHILD_HAS_VFORKED) (CHILD_HAS_EXECD, CHILD_HAS_SYSCALL_EVENT): Don't define. (CHILD_WAIT): Define. (child_wait): Add prototype. * hppah-nat.c (hpux_has_forked): Rename from child_has_forked. Add prototype. (hpux_has_vforked): Likewise, from child_has_vforked. (hpux_has_execd): Likewise, from child_has_execd. (hpux_has_syscall_event): Likewise, from child_has_syscall_event. (not_same_real_pid, child_wait): New, copied from inftarg.c. Call hpux_has_forked, hpux_has_vforked, hpux_has_execd, and hpux_has_syscall_event instead of the target hooks. * infrun.c (inferior_has_forked, inferior_has_vforked) (inferior_has_execd): New functions. * inftarg.c (not_same_real_pid): Remove. (child_wait): Remove references to not_same_real_pid, target_has_forked, target_has_vforked, target_has_execd, and target_has_syscall_event. (child_has_forked, child_has_vforked, child_has_execd) (child_has_syscall_event): Remove. (init_child_ops): Remove references to child_has_forked, child_has_vforked, child_has_execd, and child_has_syscall_event. * infttrace.c (hpux_has_forked): Rename from child_has_forked. (hpux_has_vforked): Likewise, from child_has_vforked. (hpux_has_execd): Likewise, from child_has_execd. (hpux_has_syscall_event): Likewise, from child_has_syscall_event. * target.c (cleanup_target): Remove references to to_has_forked, to_has_vforked, to_has_execd, and to_has_syscall_event. (update_current_target): Likewise. (setup_target_debug): Likewise. (debug_to_has_forked): Remove. (debug_to_has_vforked): Remove. (debug_to_has_execd): Remove. (debug_to_has_syscall_event): Remove. * target.h (struct target_ops): Remove to_has_forked. to_has_vforked, to_has_execd, and to_has_syscall_event. (child_has_forked, child_has_vforked, child_has_execd) (child_has_syscall_event): Remove prototypes. (inferior_has_forked, inferior_has_vforked, inferior_has_execd): Add prototypes. (target_has_forked, target_has_vforked, target_has_execd) (target_has_syscall_event): Remove macros.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 3123ca4..da06520 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3983,6 +3983,60 @@ discard_inferior_status (struct inferior_status *inf_status)
xfree (inf_status);
}
+int
+inferior_has_forked (int pid, int *child_pid)
+{
+ struct target_waitstatus last;
+ ptid_t last_ptid;
+
+ get_last_target_status (&last_ptid, &last);
+
+ if (last.kind != TARGET_WAITKIND_FORKED)
+ return 0;
+
+ if (ptid_get_pid (last_ptid) != pid)
+ return 0;
+
+ *child_pid = last.value.related_pid;
+ return 1;
+}
+
+int
+inferior_has_vforked (int pid, int *child_pid)
+{
+ struct target_waitstatus last;
+ ptid_t last_ptid;
+
+ get_last_target_status (&last_ptid, &last);
+
+ if (last.kind != TARGET_WAITKIND_VFORKED)
+ return 0;
+
+ if (ptid_get_pid (last_ptid) != pid)
+ return 0;
+
+ *child_pid = last.value.related_pid;
+ return 1;
+}
+
+int
+inferior_has_execd (int pid, char **execd_pathname)
+{
+ struct target_waitstatus last;
+ ptid_t last_ptid;
+
+ get_last_target_status (&last_ptid, &last);
+
+ if (last.kind != TARGET_WAITKIND_EXECD)
+ return 0;
+
+ if (ptid_get_pid (last_ptid) != pid)
+ return 0;
+
+ *execd_pathname = xstrdup (last.value.execd_pathname);
+ return 1;
+}
+
/* Oft used ptids */
ptid_t null_ptid;
ptid_t minus_one_ptid;