aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 61d1dcb..193037b 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5138,7 +5138,9 @@ remote_detach_1 (int from_tty, inferior *inf)
breakpoints that should be available for the followed inferior. */
if (!is_fork_parent)
{
- std::string infpid = target_pid_to_str (inferior_ptid);
+ /* Save the pid as a string before mourning, since that will
+ unpush the remote target, and we need the string after. */
+ std::string infpid = target_pid_to_str (pid_to_ptid (pid));
target_mourn_inferior (inferior_ptid);
if (print_inferior_events)