diff options
author | Yao Qi <yao.qi@linaro.org> | 2017-07-21 10:18:56 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2018-03-13 14:31:59 +0000 |
commit | 81e4b7e1e7d72e0593f05f5b37ab0d781492aa58 (patch) | |
tree | aa0c7aea53afcfef5fb2f55f8d124c9de53a962b | |
parent | e911bc5d3454287ee48c7263ba5ff52d48d967bc (diff) |
Throw exceptions from rs6000 unwinder
gdb:
2017-07-21 Yao Qi <yao.qi@linaro.org>
* rs6000-tdep.c (struct rs6000_frame_cache) <base_p>: Remove.
(rs6000_frame_cache): Don't catch exceptions.
(rs6000_frame_this_id): Don't check info->base_p.
(rs6000_epilogue_frame_this_id): Likewise.
-rw-r--r-- | gdb/rs6000-tdep.c | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index a5b70917b7e..9b30c5554f2 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -3276,10 +3276,6 @@ struct rs6000_frame_cache CORE_ADDR initial_sp; struct trad_frame_saved_reg *saved_regs; - /* Set BASE_P to true if this frame cache is properly initialized. - Otherwise set to false because some registers or memory cannot - collected. */ - int base_p; /* Cache PC for building unavailable frame. */ CORE_ADDR pc; }; @@ -3302,30 +3298,20 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache) cache->pc = 0; cache->saved_regs = trad_frame_alloc_saved_regs (this_frame); - TRY - { - func = get_frame_func (this_frame); - cache->pc = func; - pc = get_frame_pc (this_frame); - skip_prologue (gdbarch, func, pc, &fdata); - - /* Figure out the parent's stack pointer. */ - - /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most - address of the current frame. Things might be easier if the - ->frame pointed to the outer-most address of the frame. In - the mean time, the address of the prev frame is used as the - base address of this frame. */ - cache->base = get_frame_register_unsigned - (this_frame, gdbarch_sp_regnum (gdbarch)); - } - CATCH (ex, RETURN_MASK_ERROR) - { - if (ex.error != NOT_AVAILABLE_ERROR) - throw_exception (ex); - return (struct rs6000_frame_cache *) (*this_cache); - } - END_CATCH + func = get_frame_func (this_frame); + cache->pc = func; + pc = get_frame_pc (this_frame); + skip_prologue (gdbarch, func, pc, &fdata); + + /* Figure out the parent's stack pointer. */ + + /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most + address of the current frame. Things might be easier if the + ->frame pointed to the outer-most address of the frame. In + the mean time, the address of the prev frame is used as the + base address of this frame. */ + cache->base = get_frame_register_unsigned + (this_frame, gdbarch_sp_regnum (gdbarch)); /* If the function appears to be frameless, check a couple of likely indicators that we have simply failed to find the frame setup. @@ -3474,7 +3460,6 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache) cache->initial_sp = get_frame_register_unsigned (this_frame, fdata.alloca_reg); - cache->base_p = 1; return cache; } @@ -3485,12 +3470,6 @@ rs6000_frame_this_id (struct frame_info *this_frame, void **this_cache, struct rs6000_frame_cache *info = rs6000_frame_cache (this_frame, this_cache); - if (!info->base_p) - { - (*this_id) = frame_id_build_unavailable_stack (info->pc); - return; - } - /* This marks the outermost frame. */ if (info->base == 0) return; @@ -3571,10 +3550,7 @@ rs6000_epilogue_frame_this_id (struct frame_info *this_frame, rs6000_epilogue_frame_cache (this_frame, this_cache); pc = get_frame_func (this_frame); - if (info->base == 0) - (*this_id) = frame_id_build_unavailable_stack (pc); - else - (*this_id) = frame_id_build (info->base, pc); + (*this_id) = frame_id_build (info->base, pc); } /* Implementation of frame_unwind.prev_register, as defined in frame_unwind.h. |