Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 9/9] Throw exception in aarch64 unwinder
Date: Mon, 31 Jul 2017 22:22:00 -0000	[thread overview]
Message-ID: <1501539715-8049-10-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1501539715-8049-1-git-send-email-yao.qi@linaro.org>

gdb:

2017-07-31  Yao Qi  <yao.qi@linaro.org>

	* aarch64-tdep.c (aarch64_prologue_cache) <available_p>: 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.  */
-- 
1.9.1


  parent reply	other threads:[~2017-07-31 22:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31 22:22 [PATCH 0/9] Centralize unwinder api exceptions handling Yao Qi
2017-07-31 22:22 ` [PATCH 8/9] Throw exception in i386 unwinders Yao Qi
2017-07-31 22:22 ` [PATCH 6/9] Throw exception in dwarf2 unwinders Yao Qi
2017-07-31 22:22 ` [PATCH 1/9] Move dwarf2_frame_state_reg.exp_len to union .loc Yao Qi
2017-07-31 22:22 ` [PATCH 3/9] Class-fy dwarf2_frame_state_reg_info Yao Qi
2017-07-31 22:22 ` [PATCH 5/9] Handle unwinding exceptions Yao Qi
2017-07-31 22:22 ` Yao Qi [this message]
2017-07-31 22:22 ` [PATCH 7/9] Throw exception in amd64 unwinders Yao Qi
2017-07-31 22:22 ` [PATCH 4/9] Reset *THIS_CACHE in frame_unwind_try_unwinder in case of exception Yao Qi
2017-08-11 16:47   ` Pedro Alves
2017-08-17 15:27     ` Yao Qi
2017-07-31 22:22 ` [PATCH 2/9] Class-fy dwarf2_frame_state Yao Qi
2017-08-11  8:35 ` [PATCH 0/9] Centralize unwinder api exceptions handling Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501539715-8049-10-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox