From patchwork Mon Jul 31 22:21:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 21837 Received: (qmail 9805 invoked by alias); 31 Jul 2017 22:22:20 -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 9740 invoked by uid 89); 31 Jul 2017 22:22:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Halt, H*r:sk:static. X-HELO: mail-it0-f51.google.com Received: from mail-it0-f51.google.com (HELO mail-it0-f51.google.com) (209.85.214.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Jul 2017 22:22:18 +0000 Received: by mail-it0-f51.google.com with SMTP id h199so2018811ith.0 for ; Mon, 31 Jul 2017 15:22:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=TLd1+sVIFnBX62lbIoAm+HFZ0PBEQCFMnm0Rwm8BUXQ=; b=RyoEZT0YfHWXT5Ef18+CPpK8yh1vOn4zMQHSAPwtY3usIazHcAHKestELTKxhKSfmF YBPxuN5jVZEOEpWLloVFHEWr+cR0CKOJ7TrNto4py5zKZJmfb/S6r3ErAN5pzW3V+NlN 0uR0lpN3WyuId54ZWVNZt9bwHg/1YmbLrH+xi4Dv42/fNWuK8wc+uiNSs6xmAooPb1dn EQwb6t5GX7SiZ8EYvNfXLu8ka6IcJP+7/xTIp2mZin1cIOEyfmN6kyP2l+i37PqSjm7k HBpSaHx8db6WcDSK6282xg2aJVZ1croCnZYdEhxHALEzGSf/kGZVQGGjLM+2nnVg1PnW USHA== X-Gm-Message-State: AIVw110rg+oNBza+UH24N9n53mmD8mYRR1/x2Qs8GpViOE7IWlJlnn4H fwUvo7b3zuXmQdXc X-Received: by 10.36.85.214 with SMTP id e205mr19890303itb.120.1501539736416; Mon, 31 Jul 2017 15:22:16 -0700 (PDT) Received: from E107787-LIN.Home (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id s204sm5963117itd.34.2017.07.31.15.22.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Jul 2017 15:22:15 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 9/9] Throw exception in aarch64 unwinder Date: Mon, 31 Jul 2017 23:21:55 +0100 Message-Id: <1501539715-8049-10-git-send-email-yao.qi@linaro.org> In-Reply-To: <1501539715-8049-1-git-send-email-yao.qi@linaro.org> References: <1501539715-8049-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes gdb: 2017-07-31 Yao Qi * aarch64-tdep.c (aarch64_prologue_cache) : Remove. (aarch64_make_prologue_cache_1): Update. (aarch64_make_prologue_cache): Don't catch exception. (aarch64_prologue_frame_unwind_stop_reason): Don't check cache->available_p. (aarch64_prologue_this_id): Likewise. (aarch64_make_stub_cache): Don't catch exceptions. (aarch64_stub_frame_unwind_stop_reason): Don't check cache->available_p. (aarch64_stub_this_id): Likewise. --- gdb/aarch64-tdep.c | 48 ++++++------------------------------------------ 1 file changed, 6 insertions(+), 42 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 75bb00f..19533af 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -174,9 +174,6 @@ struct aarch64_prologue_cache to identify this frame. */ CORE_ADDR prev_sp; - /* Is the target available to read from? */ - int available_p; - /* The frame base for this frame is just prev_sp - frame size. FRAMESIZE is the distance from the frame pointer to the initial stack pointer. */ @@ -744,8 +741,6 @@ aarch64_make_prologue_cache_1 (struct frame_info *this_frame, cache->saved_regs[reg].addr += cache->prev_sp; cache->func = get_frame_func (this_frame); - - cache->available_p = 1; } /* Allocate and fill in *THIS_CACHE with information about the prologue of @@ -765,16 +760,7 @@ aarch64_make_prologue_cache (struct frame_info *this_frame, void **this_cache) cache->saved_regs = trad_frame_alloc_saved_regs (this_frame); *this_cache = cache; - TRY - { - aarch64_make_prologue_cache_1 (this_frame, cache); - } - CATCH (ex, RETURN_MASK_ERROR) - { - if (ex.error != NOT_AVAILABLE_ERROR) - throw_exception (ex); - } - END_CATCH + aarch64_make_prologue_cache_1 (this_frame, cache); return cache; } @@ -788,9 +774,6 @@ aarch64_prologue_frame_unwind_stop_reason (struct frame_info *this_frame, struct aarch64_prologue_cache *cache = aarch64_make_prologue_cache (this_frame, this_cache); - if (!cache->available_p) - return UNWIND_UNAVAILABLE; - /* Halt the backtrace at "_start". */ if (cache->prev_pc <= gdbarch_tdep (get_frame_arch (this_frame))->lowest_pc) return UNWIND_OUTERMOST; @@ -812,10 +795,7 @@ aarch64_prologue_this_id (struct frame_info *this_frame, struct aarch64_prologue_cache *cache = aarch64_make_prologue_cache (this_frame, this_cache); - if (!cache->available_p) - *this_id = frame_id_build_unavailable_stack (cache->func); - else - *this_id = frame_id_build (cache->prev_sp, cache->func); + *this_id = frame_id_build (cache->prev_sp, cache->func); } /* Implement the "prev_register" frame_unwind method. */ @@ -889,19 +869,9 @@ aarch64_make_stub_cache (struct frame_info *this_frame, void **this_cache) cache->saved_regs = trad_frame_alloc_saved_regs (this_frame); *this_cache = cache; - TRY - { - cache->prev_sp = get_frame_register_unsigned (this_frame, - AARCH64_SP_REGNUM); - cache->prev_pc = get_frame_pc (this_frame); - cache->available_p = 1; - } - CATCH (ex, RETURN_MASK_ERROR) - { - if (ex.error != NOT_AVAILABLE_ERROR) - throw_exception (ex); - } - END_CATCH + cache->prev_sp = get_frame_register_unsigned (this_frame, + AARCH64_SP_REGNUM); + cache->prev_pc = get_frame_pc (this_frame); return cache; } @@ -915,9 +885,6 @@ aarch64_stub_frame_unwind_stop_reason (struct frame_info *this_frame, struct aarch64_prologue_cache *cache = aarch64_make_stub_cache (this_frame, this_cache); - if (!cache->available_p) - return UNWIND_UNAVAILABLE; - return UNWIND_NO_REASON; } @@ -930,10 +897,7 @@ aarch64_stub_this_id (struct frame_info *this_frame, struct aarch64_prologue_cache *cache = aarch64_make_stub_cache (this_frame, this_cache); - if (cache->available_p) - *this_id = frame_id_build (cache->prev_sp, cache->prev_pc); - else - *this_id = frame_id_build_unavailable_stack (cache->prev_pc); + *this_id = frame_id_build (cache->prev_sp, cache->prev_pc); } /* Implement the "sniffer" frame_unwind method. */