diff options
author | Daniel Jacobowitz <drow@false.org> | 2005-11-03 19:51:40 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2005-11-03 19:51:40 +0000 |
commit | 0d486d9e1a9642c6630f67d8ca1fefa997853ec1 (patch) | |
tree | fc2b0da309e672a62c19931b496d7efa4933865b | |
parent | 17a750f647b846d5ac61ac4dd0ee15a97509eeeb (diff) | |
download | gdb-0d486d9e1a9642c6630f67d8ca1fefa997853ec1.zip gdb-0d486d9e1a9642c6630f67d8ca1fefa997853ec1.tar.gz gdb-0d486d9e1a9642c6630f67d8ca1fefa997853ec1.tar.bz2 |
* linux-nat.c (linux_nat_resume): Add more debugging messages. Do
not short-circuit resuming all threads if the signal will be ignored
in linux_nat_wait.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/linux-nat.c | 43 |
2 files changed, 48 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bb34df3..e8d04ef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2005-11-03 Daniel Jacobowitz <dan@codesourcery.com> + + * linux-nat.c (linux_nat_resume): Add more debugging messages. Do + not short-circuit resuming all threads if the signal will be ignored + in linux_nat_wait. + 2005-11-02 Joel Brobecker <brobecker@adacore.com> * NEWS: Changes sinces GDB 6.3 are now labled as changes in GDB 6.4. diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 61c0eff..84ee5d4 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1072,6 +1072,14 @@ linux_nat_resume (ptid_t ptid, int step, enum target_signal signo) struct lwp_info *lp; int resume_all; + if (debug_linux_nat) + fprintf_unfiltered (gdb_stdlog, + "LLR: Preparing to %s %s, %s, inferior_ptid %s\n", + step ? "step" : "resume", + target_pid_to_str (ptid), + signo ? strsignal (signo) : "0", + target_pid_to_str (inferior_ptid)); + /* A specific PTID means `step only this process id'. */ resume_all = (PIDGET (ptid) == -1); @@ -1097,12 +1105,45 @@ linux_nat_resume (ptid_t ptid, int step, enum target_signal signo) lp->resumed = 1; /* If we have a pending wait status for this thread, there is no - point in resuming the process. */ + point in resuming the process. But first make sure that + linux_nat_wait won't preemptively handle the event - we + should never take this short-circuit if we are going to + leave LP running, since we have skipped resuming all the + other threads. This bit of code needs to be synchronized + with linux_nat_wait. */ + + if (lp->status && WIFSTOPPED (lp->status)) + { + int saved_signo = target_signal_from_host (WSTOPSIG (lp->status)); + + if (signal_stop_state (saved_signo) == 0 + && signal_print_state (saved_signo) == 0 + && signal_pass_state (saved_signo) == 1) + { + if (debug_linux_nat) + fprintf_unfiltered (gdb_stdlog, + "LLR: Not short circuiting for ignored " + "status 0x%x\n", lp->status); + + /* FIXME: What should we do if we are supposed to continue + this thread with a signal? */ + gdb_assert (signo == TARGET_SIGNAL_0); + signo = saved_signo; + lp->status = 0; + } + } + if (lp->status) { /* FIXME: What should we do if we are supposed to continue this thread with a signal? */ gdb_assert (signo == TARGET_SIGNAL_0); + + if (debug_linux_nat) + fprintf_unfiltered (gdb_stdlog, + "LLR: Short circuiting for status 0x%x\n", + lp->status); + return; } |