mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-03 05:12:28 +08:00
Reset *THIS_CACHE in frame_unwind_try_unwinder in case of exception
It is required that unwinder->sniffer should set *this_cache to NULL if the unwinder is not applicable or exception is thrown, so 78ac5f831692f70b841044961069e50d4ba6a76f adds clear_pointer_cleanup to set *this_cache to NULL in case of exception in order to fix PR 14100. https://sourceware.org/ml/gdb-patches/2012-08/msg00075.html This patch removes that clear_pointer_cleanup, and catch all exception in the caller of unwinder->sniffer. In case of exception, reset *this_case. gdb: 2017-08-11 Yao Qi <yao.qi@linaro.org> * dwarf2-frame.c (clear_pointer_cleanup): Remove. (dwarf2_frame_cache): Remove reset_cache_cleanup. (dwarf2_frame_cache): * frame-unwind.c (frame_unwind_try_unwinder): Catch RETURN_MASK_ALL and set *this_case to NULL. * frame-unwind.h: Update comments.
This commit is contained in:
@ -106,8 +106,11 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache,
|
||||
{
|
||||
res = unwinder->sniffer (unwinder, this_frame, this_cache);
|
||||
}
|
||||
CATCH (ex, RETURN_MASK_ERROR)
|
||||
CATCH (ex, RETURN_MASK_ALL)
|
||||
{
|
||||
/* Catch all exceptions, caused by either interrupt or error.
|
||||
Reset *THIS_CACHE. */
|
||||
*this_cache = NULL;
|
||||
if (ex.error == NOT_AVAILABLE_ERROR)
|
||||
{
|
||||
/* This usually means that not even the PC is available,
|
||||
@ -128,6 +131,8 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Don't set *THIS_CACHE to NULL here, because sniffer has to do
|
||||
so. */
|
||||
do_cleanups (old_cleanup);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user