diff options
author | Daniel Jacobowitz <drow@false.org> | 2003-08-17 18:22:25 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2003-08-17 18:22:25 +0000 |
commit | 4de4c07c6b48659ae212352236be9413c853a23c (patch) | |
tree | 5aeb62d1cb427760fda2a718d4faf154963827a7 /gdb/lin-lwp.c | |
parent | 2b66634babe795d9b28487625b8e701fff866482 (diff) | |
download | gdb-4de4c07c6b48659ae212352236be9413c853a23c.zip gdb-4de4c07c6b48659ae212352236be9413c853a23c.tar.gz gdb-4de4c07c6b48659ae212352236be9413c853a23c.tar.bz2 |
* Makefile.in (i386-linux-nat.o): Update dependencies.
* config/i386/nm-linux.h (LINUX_CHILD_POST_STARTUP_INFERIOR): Define.
* config/nm-linux.h (CHILD_POST_STARTUP_INFERIOR, CHILD_POST_ATTACH)
(CHILD_FOLLOW_FORK, KILL_INFERIOR): Define.
* i386-linux-nat.c: Include "linux-nat.h".
(child_post_startup_inferior): New function.
* i386-nat.c (child_post_startup_inferior): Wrap in #ifdef.
* infptrace.c (kill_inferior): Wrap in #ifdef.
* lin-lwp.c (lin_lwp_attach_lwp): Call child_post_attach after
attaching to each LWP.
(child_wait, lin_lwp_wait): Call linux_handle_extended_wait.
(init_lin_lwp_ops): Fill in some more operations.
* linux-nat.h (linux_enable_event_reporting)
(linux_handle_extended_wait, linux_child_post_startup_inferior): New
prototypes.
* linux-nat.c (linux_enable_event_reporting): New function.
(child_post_attach, linux_child_post_startup_inferior)
(child_post_startup_inferior, child_follow_fork)
(linux_handle_extended_wait, kill_inferior): New functions.
Diffstat (limited to 'gdb/lin-lwp.c')
-rw-r--r-- | gdb/lin-lwp.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c index a82adb7..b168b05 100644 --- a/gdb/lin-lwp.c +++ b/gdb/lin-lwp.c @@ -324,6 +324,8 @@ lin_lwp_attach_lwp (ptid_t ptid, int verbose) gdb_assert (pid == GET_LWP (ptid) && WIFSTOPPED (status) && WSTOPSIG (status)); + child_post_attach (pid); + lp->stopped = 1; if (debug_lin_lwp) @@ -1067,6 +1069,10 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) return minus_one_ptid; } + /* Handle GNU/Linux's extended waitstatus for trace events. */ + if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0) + return linux_handle_extended_wait (pid, status, ourstatus); + store_waitstatus (ourstatus, status); return pid_to_ptid (pid); } @@ -1488,6 +1494,14 @@ retry: else trap_ptid = null_ptid; + /* Handle GNU/Linux's extended waitstatus for trace events. */ + if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0) + { + linux_handle_extended_wait (ptid_get_pid (trap_ptid), + status, ourstatus); + return trap_ptid; + } + store_waitstatus (ourstatus, status); return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid))); } @@ -1657,6 +1671,12 @@ init_lin_lwp_ops (void) lin_lwp_ops.to_mourn_inferior = lin_lwp_mourn_inferior; lin_lwp_ops.to_thread_alive = lin_lwp_thread_alive; lin_lwp_ops.to_pid_to_str = lin_lwp_pid_to_str; + lin_lwp_ops.to_post_startup_inferior = child_post_startup_inferior; + lin_lwp_ops.to_post_attach = child_post_attach; + lin_lwp_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint; + lin_lwp_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint; + lin_lwp_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint; + lin_lwp_ops.to_stratum = thread_stratum; lin_lwp_ops.to_has_thread_control = tc_schedlock; lin_lwp_ops.to_magic = OPS_MAGIC; |