This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] Remove unnecessary call to save_current_inferior
- From: Doug Evans <dje at google dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 29 Aug 2013 11:11:58 -0700
- Subject: [RFA] Remove unnecessary call to save_current_inferior
- Authentication-results: sourceware.org; auth=none
Hi.
AFAICT the call to save_current_inferior here is unnecessary.
Regression tested on amd64-linux.
Ok to check in?
2013-08-29 Doug Evans <dje@google.com>
* progspace.c (save_current_space_and_thread): Remove unnecessary
call to save_current_inferior.
Index: progspace.c
===================================================================
RCS file: /cvs/src/src/gdb/progspace.c,v
retrieving revision 1.18
diff -u -p -r1.18 progspace.c
--- progspace.c 28 Aug 2013 17:52:03 -0000 1.18
+++ progspace.c 29 Aug 2013 17:58:15 -0000
@@ -471,7 +471,8 @@ save_current_space_and_thread (void)
/* If restoring to null thread, we need to restore the pspace as
well, hence, we need to save the current program space first. */
old_chain = save_current_program_space ();
- save_current_inferior ();
+ /* There's no need to save the current inferior here.
+ That is handled by make_cleanup_restore_current_thread. */
make_cleanup_restore_current_thread ();
return old_chain;