From patchwork Thu Jun 26 08:23:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 1757 Received: (qmail 29761 invoked by alias); 26 Jun 2014 08:25:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 29749 invoked by uid 89); 26 Jun 2014 08:25:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Jun 2014 08:25:31 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1X04zn-00006g-VC from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 26 Jun 2014 01:25:28 -0700 Received: from SVR-ORW-FEM-06.mgc.mentorg.com ([147.34.97.120]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 26 Jun 2014 01:25:24 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.2.247.3; Thu, 26 Jun 2014 01:25:24 -0700 From: Yao Qi To: Subject: [PATCH OBV] Move local variables to inner block Date: Thu, 26 Jun 2014 16:23:41 +0800 Message-ID: <1403771021-30533-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes dummy_frame_sniffer has two local variables dummyframe and this_id, but they are only used in the if block below. This patch is to move them into the inner block. Patch is pushed in. gdb: 2014-06-26 Yao Qi * dummy-frame.c (dummy_frame_sniffer): Move local variables dummyframe and this_id into inner block below. --- gdb/ChangeLog | 5 +++++ gdb/dummy-frame.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 66484b5..2b7e33c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-06-26 Yao Qi + * dummy-frame.c (dummy_frame_sniffer): Move local variables + dummyframe and this_id into inner block below. + +2014-06-26 Yao Qi + * infrun.c (_initialize_infrun): Replace "signal_program[0]" with "signal_pass[0]" in the initialization of signal_pass. diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index 998ca93..dd2ff12 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -195,9 +195,6 @@ dummy_frame_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache) { - struct dummy_frame *dummyframe; - struct frame_id this_id; - /* When unwinding a normal frame, the stack structure is determined by analyzing the frame's function's code (be it using brute force prologue analysis, or the dwarf2 CFI). In the case of a dummy @@ -209,9 +206,11 @@ dummy_frame_sniffer (const struct frame_unwind *self, /* Don't bother unless there is at least one dummy frame. */ if (dummy_frame_stack != NULL) { + struct dummy_frame *dummyframe; /* Use an architecture specific method to extract this frame's dummy ID, assuming it is a dummy frame. */ - this_id = gdbarch_dummy_id (get_frame_arch (this_frame), this_frame); + struct frame_id this_id + = gdbarch_dummy_id (get_frame_arch (this_frame), this_frame); /* Use that ID to find the corresponding cache entry. */ for (dummyframe = dummy_frame_stack;