From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 6/9] Throw exception in dwarf2 unwinders
Date: Mon, 31 Jul 2017 22:22:00 -0000 [thread overview]
Message-ID: <1501539715-8049-7-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1501539715-8049-1-git-send-email-yao.qi@linaro.org>
This patch changes dwarf2 unwinders to not catch exceptions.
gdb:
2017-07-20 Yao Qi <yao.qi@linaro.org>
* dwarf2-frame.c (struct dwarf2_frame_cache) <unavailable_retaddr>:
Remove.
(dwarf2_frame_cache): Don't catch exception.
(dwarf2_frame_unwind_stop_reason): Don't check
cache->unavailable_retaddr.
(dwarf2_frame_this_id): Likewise.
---
gdb/dwarf2-frame.c | 63 ++++++++++++++++--------------------------------------
1 file changed, 19 insertions(+), 44 deletions(-)
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index f8e6522..d380e83 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -922,10 +922,6 @@ struct dwarf2_frame_cache
/* DWARF Call Frame Address. */
CORE_ADDR cfa;
- /* Set if the return address column was marked as unavailable
- (required non-collected memory or registers to compute). */
- int unavailable_retaddr;
-
/* Set if the return address column was marked as undefined. */
int undefined_retaddr;
@@ -1037,41 +1033,27 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
execute_cfa_program (fde, instr, fde->end, gdbarch,
get_frame_address_in_block (this_frame), &fs);
- TRY
- {
- /* Calculate the CFA. */
- switch (fs.regs.cfa_how)
- {
- case CFA_REG_OFFSET:
- cache->cfa = read_addr_from_reg (this_frame, fs.regs.cfa_reg);
- if (fs.armcc_cfa_offsets_reversed)
- cache->cfa -= fs.regs.cfa_offset;
- else
- cache->cfa += fs.regs.cfa_offset;
- break;
-
- case CFA_EXP:
- cache->cfa =
- execute_stack_op (fs.regs.cfa_exp, fs.regs.cfa_exp_len,
- cache->addr_size, cache->text_offset,
- this_frame, 0, 0);
- break;
-
- default:
- internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
- }
- }
- CATCH (ex, RETURN_MASK_ERROR)
+ /* Calculate the CFA. */
+ switch (fs.regs.cfa_how)
{
- if (ex.error == NOT_AVAILABLE_ERROR)
- {
- cache->unavailable_retaddr = 1;
- return cache;
- }
+ case CFA_REG_OFFSET:
+ cache->cfa = read_addr_from_reg (this_frame, fs.regs.cfa_reg);
+ if (fs.armcc_cfa_offsets_reversed)
+ cache->cfa -= fs.regs.cfa_offset;
+ else
+ cache->cfa += fs.regs.cfa_offset;
+ break;
+
+ case CFA_EXP:
+ cache->cfa =
+ execute_stack_op (fs.regs.cfa_exp, fs.regs.cfa_exp_len,
+ cache->addr_size, cache->text_offset,
+ this_frame, 0, 0);
+ break;
- throw_exception (ex);
+ default:
+ internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
}
- END_CATCH
/* Initialize the register state. */
{
@@ -1181,9 +1163,6 @@ dwarf2_frame_unwind_stop_reason (struct frame_info *this_frame,
struct dwarf2_frame_cache *cache
= dwarf2_frame_cache (this_frame, this_cache);
- if (cache->unavailable_retaddr)
- return UNWIND_UNAVAILABLE;
-
if (cache->undefined_retaddr)
return UNWIND_OUTERMOST;
@@ -1197,11 +1176,7 @@ dwarf2_frame_this_id (struct frame_info *this_frame, void **this_cache,
struct dwarf2_frame_cache *cache =
dwarf2_frame_cache (this_frame, this_cache);
- if (cache->unavailable_retaddr)
- (*this_id) = frame_id_build_unavailable_stack (get_frame_func (this_frame));
- else if (cache->undefined_retaddr)
- return;
- else
+ if (!cache->undefined_retaddr)
(*this_id) = frame_id_build (cache->cfa, get_frame_func (this_frame));
}
--
1.9.1
next prev 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 ` Yao Qi [this message]
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 ` [PATCH 9/9] Throw exception in aarch64 unwinder Yao Qi
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-7-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