This is the mail archive of the gdb-patches@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]

Re: [RFA 01/13] Simple unused variable removals


On 2018-07-14 08:40 AM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
> 
> Simon> -      CORE_ADDR size = extract_unsigned_integer (ovly_table + 16*i + 4,
> Simon> -						 4, byte_order);
> 
> Simon> I wondered this was a bug (should that variable really be used), but I
> Simon> wouldn't know without some quite extensive research...  so all-in-all, LGTM.
> 
> Yes, this one was on the bubble and I almost put it in its own patch...
> I can't recall offhand if there were others like this.
> 
> Tom
> 


And here's another one that I think is less obvious.  The call has side-effects
(it allocates the per-inferior data), but I don't think it's really needed.


>From 4014eefe405a66c6e2ade325e14ed891e9f0f62a Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Fri, 13 Jul 2018 23:09:04 -0400
Subject: [PATCH] semi-obvious

---
 gdb/remote-sim.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index cc7a6f27fc99..d30b38ecb7ce 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -831,9 +831,6 @@ gdbsim_close_inferior (struct inferior *inf, void *arg)
 void
 gdbsim_target::close ()
 {
-  struct sim_inferior_data *sim_data
-    = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
-
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "gdbsim_close\n");

@@ -1184,9 +1181,6 @@ gdbsim_target::files_info ()
 void
 gdbsim_target::mourn_inferior ()
 {
-  struct sim_inferior_data *sim_data
-    = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
-
   if (remote_debug)
     fprintf_unfiltered (gdb_stdlog, "gdbsim_mourn_inferior:\n");

-- 
2.18.0


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