From patchwork Mon Apr 18 07:52:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 11783 Received: (qmail 121839 invoked by alias); 18 Apr 2016 07:53:17 -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 121793 invoked by uid 89); 18 Apr 2016 07:53:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1706, 2016-04-18, 20160418 X-HELO: mail-pa0-f51.google.com Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 18 Apr 2016 07:53:06 +0000 Received: by mail-pa0-f51.google.com with SMTP id er2so47913587pad.3 for ; Mon, 18 Apr 2016 00:53:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Bq1haEPdJqnII+RRJ+pDbrDYwP+FNlgZwFBfQXJxGXM=; b=OQAHvm+wcuLZrPJOkTMryQAPSpxTsK0zJj4wi21BS87793ah4iHzA3rhBVqS7Ywa4N Svq0qy5CA4aq5A/T5J93uOQGyEPUmbx5VU4nRpof6vf3JBDR2GIKAuTVwfPn0b9tu0w3 iluDaBO0ed5+7gh7RF97gfVIdrKuBEPLQGinpJ7IBxbxegUYDgnxok8Wq/54LiGl61Bj ofetRMUGnycNMzG251uyU4/AotZ/dO4q9i1WnBuYhNt4VL0IiKpo+TaKlFEjSCJ22mnT AUOc2ITQmHJy7KLMTaIvb7idX7+Ae9qi6yRDlMyWISoISEof51SQWiqKZXChFRHrWbi0 ftcg== X-Gm-Message-State: AOPr4FUgRDYyST1oV2FJqAnFsG77++0Al/mIOd5x31XpMKZm+Wf0KqcITHxUmAuKoicFfA== X-Received: by 10.66.123.105 with SMTP id lz9mr47809552pab.37.1460965984627; Mon, 18 Apr 2016 00:53:04 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id y3sm60004222par.2.2016.04.18.00.53.01 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 18 Apr 2016 00:53:03 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] [ARM] minor opt in thumb_stack_frame_destroyed_p References: <1460730578-28723-1-git-send-email-yao.qi@linaro.org> <571115C3.8010500@redhat.com> Date: Mon, 18 Apr 2016 08:52:45 +0100 In-Reply-To: <571115C3.8010500@redhat.com> (Pedro Alves's message of "Fri, 15 Apr 2016 17:24:35 +0100") Message-ID: <86fuujl5f6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Pedro Alves writes: > This assumes epilogue sequences are always at the end of the function. Ur, right. Looks compiler can place prologue and epilogue in the middle of the function, no at the first or last blocks. The patch is reverted. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bafbbe6..daf86d9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2016-04-18 Yao Qi + + Revert: + 2016-04-15 Yao Qi + + * arm-tdep.c (thumb_stack_frame_destroyed_p): Return zero if + PC is far from the end of function. + 2016-04-16 Pedro Alves * ada-exp.y (yydefred): Define as ada_yydefred. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 36b0bcd..0412f71 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3135,14 +3135,6 @@ thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) if (!find_pc_partial_function (pc, NULL, &func_start, &func_end)) return 0; - if (func_end - pc > 4 * 4) - { - /* There shouldn't be more than four instructions in epilogue. - If PC is still 16 bytes away from FUNC_END, it isn't in - epilogue. */ - return 0; - } - /* The epilogue is a sequence of instructions along the following lines: - add stack frame size to SP or FP