diff options
author | Jim Blandy <jimb@redhat.com> | 2004-12-03 00:02:44 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 2004-12-03 00:02:44 +0000 |
commit | 3abedee4e8577566572526ceba840ba4dc3d68e1 (patch) | |
tree | a3bdbad47b52dce93dcee2c67f43b5e921ea629c /rda/unix | |
parent | 8d2703df262065d100d933bf6a0aad9ab6227053 (diff) | |
download | gdb-3abedee4e8577566572526ceba840ba4dc3d68e1.tar.gz |
* thread-db.c (thread_db_break_program): New function.
(thread_db_attach): Register it as the 'break_program' method.
Diffstat (limited to 'rda/unix')
-rw-r--r-- | rda/unix/ChangeLog | 3 | ||||
-rw-r--r-- | rda/unix/thread-db.c | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/rda/unix/ChangeLog b/rda/unix/ChangeLog index e84df8aa23e..23fe5ad19d2 100644 --- a/rda/unix/ChangeLog +++ b/rda/unix/ChangeLog @@ -1,5 +1,8 @@ 2004-12-02 Jim Blandy <jimb@redhat.com> + * thread-db.c (thread_db_break_program): New function. + (thread_db_attach): Register it as the 'break_program' method. + * ptrace-target.c (kill_lwp): Produce debugging output. * lwp-pool.c (check_stop_pending): lwp_state_stopped_interesting diff --git a/rda/unix/thread-db.c b/rda/unix/thread-db.c index 08405a1f84e..7a0bba426db 100644 --- a/rda/unix/thread-db.c +++ b/rda/unix/thread-db.c @@ -2132,6 +2132,19 @@ thread_db_exit_program (struct gdbserv *serv) parentvec.exit_program (serv); } +static void +thread_db_break_program (struct gdbserv *serv) +{ + struct child_process *process = gdbserv_target_data (serv); + + /* We always send the signal to the main thread. It's not correct + to use process->pid; that's whatever thread last reported a + status, and it may well have been exiting. */ + if (process->debug_backend) + fprintf (stderr, " -- send SIGINT to child %d\n", proc_handle.pid); + kill (proc_handle.pid, SIGINT); +} + /* Function: check_child_state This function checks for signal events in the running child processes. @@ -2635,6 +2648,8 @@ thread_db_attach (struct gdbserv *serv, struct gdbserv_target *target) target->continue_thread = thread_db_continue_thread; target->singlestep_thread = thread_db_singlestep_thread; + target->break_program = thread_db_break_program; + /* Take over get_reg / set_reg methods with threaded versions. */ if (target->next_gg_reg != NULL && target->reg_format != NULL && |