From patchwork Wed Sep 24 12:52:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 2961 Received: (qmail 13185 invoked by alias); 24 Sep 2014 12:56:37 -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 13167 invoked by uid 89); 24 Sep 2014 12:56:36 -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; Wed, 24 Sep 2014 12:56:34 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1XWm7T-0004Ly-Gm from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 24 Sep 2014 05:56:31 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.181.6; Wed, 24 Sep 2014 05:56:31 -0700 Message-ID: <5422BE7D.1020302@codesourcery.com> Date: Wed, 24 Sep 2014 20:52:13 +0800 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Subject: Re: [PATCH 2/4] Match instruction adjusts SP in thumb References: <1404367792-23234-1-git-send-email-yao@codesourcery.com> <1404367792-23234-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1404367792-23234-3-git-send-email-yao@codesourcery.com> X-IsSubscribed: yes On 07/03/2014 02:09 PM, Yao Qi wrote: > - else if ((insn & 0xfe00) == 0xbc00) /* pop */ > + else if (thumb_instruction_restores_sp (insn)) > { > found_stack_adjust = 1; > - if (insn & 0x0100) /* include PC. */ > + if ((insn & 0xfe00) == 0xbd00) /* pop */ > found_return = 1; > } This patch fixes a typo in the bit mask I've made in my previous code refactor. If PC is in the register list, the bit 8 is one, so bit mask 0xff00 should be used. Current condition is a constant false. Regression tested on arm-linux-gnueabi. Patch is pushed in. gdb: 2014-09-24 Yao Qi * arm-tdep.c (thumb_in_function_epilogue_p): Fix typo in the bitmask. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 742053f..5dccf0a 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3273,7 +3273,7 @@ thumb_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) found_return = 1; else if (thumb_instruction_restores_sp (insn)) { - if ((insn & 0xfe00) == 0xbd00) /* pop */ + if ((insn & 0xff00) == 0xbd00) /* pop */ found_return = 1; } else if (thumb_insn_size (insn) == 4) /* 32-bit Thumb-2 instruction */