aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-10-10 13:23:53 +0000
committerPedro Alves <palves@redhat.com>2011-10-10 13:23:53 +0000
commit4b60df3d6374f21f2142badb9e3551a77b1fc360 (patch)
tree66b19268e163a2336e2620128adfaac6646d585a /gdb/linux-nat.c
parent3b421ab3bc02af734421775cbdbcfe98553c65a6 (diff)
downloadgdb-4b60df3d6374f21f2142badb9e3551a77b1fc360.zip
gdb-4b60df3d6374f21f2142badb9e3551a77b1fc360.tar.gz
gdb-4b60df3d6374f21f2142badb9e3551a77b1fc360.tar.bz2
2011-10-10 Pedro Alves <pedro@codesourcery.com>
gdb/ * linux-nat.c (linux_nat_wait_1): Copy the event lwp's last_resume_kind before clearing it, and use the copy instead to determine whether to report a SIGSTOP as TARGET_SIGNAL_0. Use resume_clear_callback in the non-stop path too.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index ef0837b..80cd5f5 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -3335,6 +3335,7 @@ linux_nat_wait_1 (struct target_ops *ops,
int target_options)
{
static sigset_t prev_mask;
+ enum resume_kind last_resume_kind;
struct lwp_info *lp = NULL;
int options = 0;
int status = 0;
@@ -3747,14 +3748,20 @@ retry:
why. */
iterate_over_lwps (minus_one_ptid, cancel_breakpoints_callback, lp);
+ /* We'll need this to determine whether to report a SIGSTOP as
+ TARGET_WAITKIND_0. Need to take a copy because
+ resume_clear_callback clears it. */
+ last_resume_kind = lp->last_resume_kind;
+
/* In all-stop, from the core's perspective, all LWPs are now
stopped until a new resume action is sent over. */
iterate_over_lwps (minus_one_ptid, resume_clear_callback, NULL);
}
else
{
- lp->resumed = 0;
- lp->last_resume_kind = resume_stop;
+ /* See above. */
+ last_resume_kind = lp->last_resume_kind;
+ resume_clear_callback (lp, NULL);
}
if (linux_nat_status_is_event (status))
@@ -3778,7 +3785,7 @@ retry:
restore_child_signals_mask (&prev_mask);
- if (lp->last_resume_kind == resume_stop
+ if (last_resume_kind == resume_stop
&& ourstatus->kind == TARGET_WAITKIND_STOPPED
&& WSTOPSIG (status) == SIGSTOP)
{