From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22938 invoked by alias); 6 Sep 2010 14:56:44 -0000 Received: (qmail 22929 invoked by uid 22791); 6 Sep 2010 14:56:43 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Sep 2010 14:56:03 +0000 Received: (qmail 28869 invoked from network); 6 Sep 2010 14:56:01 -0000 Received: from unknown (HELO ?192.168.0.100?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Sep 2010 14:56:01 -0000 Message-ID: <4C8500F5.3030508@codesourcery.com> Date: Mon, 06 Sep 2010 15:22:00 -0000 From: Yao Qi User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Pedro Alves CC: gdb-patches@sourceware.org Subject: Re: [gdbserver] Remove unused variables References: <4C7F7273.6090708@codesourcery.com> <201009061046.06062.pedro@codesourcery.com> In-Reply-To: <201009061046.06062.pedro@codesourcery.com> Content-Type: multipart/mixed; boundary="------------080803000805060306070407" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-09/txt/msg00161.txt.bz2 This is a multi-part message in MIME format. --------------080803000805060306070407 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Content-length: 561 Pedro Alves wrote: > > ... this bit, that revealed a bug. saved_inferior should be used. Please > add a "current_inferior = saved_inferior;" statement before > every return path in this function instead. Bonus points > if you do that in a separate patch from the "remove unused > variables" one. Pedro, I've submit a separate patch against this issue which you pointed out. http://sourceware.org/ml/gdb-patches/2010-09/msg00156.html My updated patch to remove unused variables is attached. -- Yao Qi CodeSourcery yao@codesourcery.com (650) 331-3385 x739 --------------080803000805060306070407 Content-Type: text/x-patch; name="werror.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="werror.patch" Content-length: 3071 gdbserver/ 2010-09-06 Yao Qi * linux-low.c (linux_kill): Remove unused variable. (linux_stabilize_threads): Likewise. * server.c (start_inferior): Likewise. (queue_stop_reply_callback): Likewise. * tracepoint.c (do_action_at_tracepoint): Likewise. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 76a4df1..b798c16 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -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", @@ -1935,13 +1933,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) { diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 528b658..dc6017a 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -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 inferior_list_entry *entry, void *arg) 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); diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 138d920..0e607d6 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -4126,13 +4126,10 @@ do_action_at_tracepoint (struct tracepoint_hit_ctx *ctx, } 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"); --------------080803000805060306070407--