]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix ravenscar-thread.c for multi-target
authorTom Tromey <tromey@adacore.com>
Wed, 22 Jan 2020 19:30:40 +0000 (12:30 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 31 Jan 2020 10:38:37 +0000 (11:38 +0100)
ravenscar-thread.c needed a change to adapt to multi-target:
ravenscar_thread_target::mourn_inferior called the mourn_inferior
method on the target beneat -- but when the target beneath was the
remote target, this resulted in the ravenscar target being deleted.

Switching the order of the calls to unpush_target and the beneath's
mourn_inferior fixes this problem.

gdb/ChangeLog
2020-01-31  Tom Tromey  <tromey@adacore.com>

* ravenscar-thread.c (ravenscar_thread_target::mourn_inferior):
Call beneath target's mourn_inferior after unpushing.

Change-Id: Ia80380515c403adc40505a6b3420c9cb35754370

gdb/ChangeLog
gdb/ravenscar-thread.c

index 5bdca27efc574d50d4eff8f1f6caee2eb2054ff1..ea8ef82c38809e082f5a28db8308a6142c99c305 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-31  Tom Tromey  <tromey@adacore.com>
+
+       * ravenscar-thread.c (ravenscar_thread_target::mourn_inferior):
+       Call beneath target's mourn_inferior after unpushing.
+
 2020-01-31  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        PR tui/9765
index 5d24c59e99693388a1218ef789576d1bd9d61fa5..fd3beb03ec3eb13ad292f368889f7d6f49af3971 100644 (file)
@@ -515,8 +515,9 @@ void
 ravenscar_thread_target::mourn_inferior ()
 {
   m_base_ptid = null_ptid;
-  beneath ()->mourn_inferior ();
+  target_ops *beneath = this->beneath ();
   unpush_target (this);
+  beneath->mourn_inferior ();
 }
 
 /* Implement the to_core_of_thread target_ops "method".  */