This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Remove unnecessary inferior lookup in inferior_command


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5590c2bae0fb41e90bc9698e55d8ec1fe22a9173

commit 5590c2bae0fb41e90bc9698e55d8ec1fe22a9173
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Tue Dec 6 16:19:33 2016 -0500

    Remove unnecessary inferior lookup in inferior_command
    
    In the case where we switch to a non-running inferior, we do a
    "find_inferior_id (num)", although we did the same call right before.
    
    gdb/ChangeLog:
    
    	* inferior.c (inferior_command): Remove duplicate
    	find_inferior_id call.

Diff:
---
 gdb/ChangeLog  | 5 +++++
 gdb/inferior.c | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ea1cff3..c251150 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-06  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* inferior.c (inferior_command): Remove duplicate
+	find_inferior_id call.
+
 2016-12-06  Yao Qi  <yao.qi@linaro.org>
 
 	* frame.c (frame_register_unwind): Set *realnump if *lvalp is
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 0abd2c0..9fcdbd3 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -763,9 +763,6 @@ inferior_command (char *args, int from_tty)
     }
   else
     {
-      struct inferior *inf;
-
-      inf = find_inferior_id (num);
       set_current_inferior (inf);
       switch_to_thread (null_ptid);
       set_current_program_space (inf->pspace);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]