This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[gdbserver, patch] Restore current_inferior on return
- From: Yao Qi <yao at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Pedro Alves <pedro at codesourcery dot com>
- Date: Mon, 06 Sep 2010 22:51:27 +0800
- Subject: [gdbserver, patch] Restore current_inferior on return
Hi,
This patch is to fix a bug revealed when my patch "Remove unused
variables" is reviewed.
http://sourceware.org/ml/gdb-patches/2010-09/msg00081.html
--
Yao Qi
CodeSourcery
yao@codesourcery.com
(650) 331-3385 x739
gdbserver/
* linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
on return.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index f2177ff..76a4df1 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1244,6 +1244,7 @@ Checking whether LWP %ld needs to move out of the jump pad.\n",
fprintf (stderr, "\
Checking whether LWP %ld needs to move out of the jump pad...it does\n",
lwpid_of (lwp));
+ current_inferior = saved_inferior;
return 1;
}
@@ -1314,6 +1315,8 @@ Checking whether LWP %ld needs to move out of the jump pad...it does\n",
fprintf (stderr, "\
Checking whether LWP %ld needs to move out of the jump pad...no\n",
lwpid_of (lwp));
+
+ current_inferior = saved_inferior;
return 0;
}