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]

[gdbserver] Remove unused variables


Hi,
This patch is to remove unused variables in order to fix some build
failures I find today on GDB CVS HEAD.

gdb-mainline/gdb/gdbserver/server.c: In function 'start_inferior':
gdb-mainline/gdb/gdbserver/server.c:276:14: error: variable 'ptid' set
but not used [-Werror=unused-but-set-variable]
gdb-mainline/gdb/gdbserver/server.c: In function
'queue_stop_reply_callback':
gdb-mainline/gdb/gdbserver/server.c:2158:32: error: variable 'status'
set but not used [-Werror=unused-but-set-variable]

Tested on X86-64 native build.  No regressions.

-- 
Yao Qi
CodeSourcery
yao@codesourcery.com
(650) 331-3385 x739
gdbserver/
2010-09-02  Yao Qi  <yao@codesourcery.com>

	* linux-low.c (linux_kill): Remove unused variable.
	(linux_fast_tracepoint_collecting): Likewise.
	(linux_stabilize_threads): Likewise.
	* server.c (start_inferior): Likewise.
	(queue_stop_reply_callback): Likewise.
	* tracepoint.c (do_action_at_tracepoint): Likewise.

Index: gdbserver/linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.162
diff -u -p -r1.162 linux-low.c
--- gdbserver/linux-low.c	1 Sep 2010 01:53:43 -0000	1.162
+++ gdbserver/linux-low.c	2 Sep 2010 08:50:09 -0000
@@ -775,7 +775,6 @@ linux_kill (int pid)
 {
   struct process_info *process;
   struct lwp_info *lwp;
-  struct thread_info *thread;
   int wstat;
   int lwpid;
 
@@ -792,7 +791,6 @@ linux_kill (int pid)
   /* See the comment in linux_kill_one_lwp.  We did not kill the first
      thread in the list, so do so now.  */
   lwp = find_lwp_pid (pid_to_ptid (pid));
-  thread = get_lwp_thread (lwp);
 
   if (debug_threads)
     fprintf (stderr, "lk_1: killing lwp %ld, for pid: %d\n",
@@ -1201,9 +1199,6 @@ linux_fast_tracepoint_collecting (struct
 static int
 maybe_move_out_of_jump_pad (struct lwp_info *lwp, int *wstat)
 {
-  struct thread_info *saved_inferior;
-
-  saved_inferior = current_inferior;
   current_inferior = get_lwp_thread (lwp);
 
   if ((wstat == NULL
@@ -1932,13 +1927,12 @@ linux_stabilize_threads (void)
     {
       struct target_waitstatus ourstatus;
       struct lwp_info *lwp;
-      ptid_t ptid;
       int wstat;
 
       /* Note that we go through the full wait even loop.  While
 	 moving threads out of jump pad, we need to be able to step
 	 over internal breakpoints and such.  */
-      ptid = linux_wait_1 (minus_one_ptid, &ourstatus, 0);
+      linux_wait_1 (minus_one_ptid, &ourstatus, 0);
 
       if (ourstatus.kind == TARGET_WAITKIND_STOPPED)
 	{
Index: gdbserver/server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.132
diff -u -p -r1.132 server.c
--- gdbserver/server.c	1 Sep 2010 17:29:32 -0000	1.132
+++ gdbserver/server.c	2 Sep 2010 08:50:09 -0000
@@ -273,13 +273,12 @@ start_inferior (char **argv)
   if (wrapper_argv != NULL)
     {
       struct thread_resume resume_info;
-      ptid_t ptid;
 
       resume_info.thread = pid_to_ptid (signal_pid);
       resume_info.kind = resume_continue;
       resume_info.sig = 0;
 
-      ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
+      mywait (pid_to_ptid (signal_pid), &last_status, 0, 0);
 
       if (last_status.kind != TARGET_WAITKIND_STOPPED)
 	return signal_pid;
@@ -2155,11 +2154,6 @@ queue_stop_reply_callback (struct inferi
      manage the thread's last_status field.  */
   if (the_target->thread_stopped == NULL)
     {
-      struct target_waitstatus status;
-
-      status.kind = TARGET_WAITKIND_STOPPED;
-      status.value.sig = TARGET_SIGNAL_TRAP;
-
       /* Pass the last stop reply back to GDB, but don't notify
 	 yet.  */
       queue_stop_reply (entry->id, &thread->last_status);
Index: gdbserver/tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/tracepoint.c,v
retrieving revision 1.11
diff -u -p -r1.11 tracepoint.c
--- gdbserver/tracepoint.c	1 Sep 2010 17:29:32 -0000	1.11
+++ gdbserver/tracepoint.c	2 Sep 2010 08:50:09 -0000
@@ -4126,13 +4126,10 @@ do_action_at_tracepoint (struct tracepoi
       }
     case 'R':
       {
-	struct collect_registers_action *raction;
-
 	unsigned char *regspace;
 	struct regcache tregcache;
 	struct regcache *context_regcache;
 
-	raction = (struct collect_registers_action *) taction;
 
 	trace_debug ("Want to collect registers");
 

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