aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-02-16 14:35:00 +0000
committerTom Tromey <tromey@redhat.com>2012-02-16 14:35:00 +0000
commit9addecb9fb140b0f92a0f06ee90809768bd16eae (patch)
treef82b5b561c5827241ddb09e7eefd13f1db1fabee /gdb/thread.c
parentbf4c19f73effc1808b4093463e68a7c161b9503a (diff)
downloadgdb-9addecb9fb140b0f92a0f06ee90809768bd16eae.zip
gdb-9addecb9fb140b0f92a0f06ee90809768bd16eae.tar.gz
gdb-9addecb9fb140b0f92a0f06ee90809768bd16eae.tar.bz2
PR c++/13653:
* thread.c (struct current_thread_cleanup) <was_removable>: New field. (do_restore_current_thread_cleanup): Restore 'removable' field. (restore_current_thread_cleanup_dtor): Likewise. (make_cleanup_restore_current_thread): Initialize new field. testsuite/gdb * gdb.base/inferior-died.c: New file. * gdb.base/inferior-died.exp: New file.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index 9a29383..22d8b23 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1072,6 +1072,7 @@ struct current_thread_cleanup
int selected_frame_level;
int was_stopped;
int inf_id;
+ int was_removable;
};
static void
@@ -1112,10 +1113,14 @@ restore_current_thread_cleanup_dtor (void *arg)
{
struct current_thread_cleanup *old = arg;
struct thread_info *tp;
+ struct inferior *inf;
tp = find_thread_ptid (old->inferior_ptid);
if (tp)
tp->refcount--;
+ inf = find_inferior_id (old->inf_id);
+ if (inf != NULL)
+ inf->removable = old->was_removable;
xfree (old);
}
@@ -1129,6 +1134,7 @@ make_cleanup_restore_current_thread (void)
old = xmalloc (sizeof (struct current_thread_cleanup));
old->inferior_ptid = inferior_ptid;
old->inf_id = current_inferior ()->num;
+ old->was_removable = current_inferior ()->removable;
if (!ptid_equal (inferior_ptid, null_ptid))
{
@@ -1156,6 +1162,8 @@ make_cleanup_restore_current_thread (void)
tp->refcount++;
}
+ current_inferior ()->removable = 0;
+
return make_cleanup_dtor (do_restore_current_thread_cleanup, old,
restore_current_thread_cleanup_dtor);
}