X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fframe-unwind.c;h=4d21349fe6c4833742a4ec3cf3bcede9e8c900f1;hb=6a2c1b8790e58ce0688507b5b1f8369aa621a665;hp=ebc01ff7d91374c8dc9004158475056b6c8222d1;hpb=dccbb60975cdbcd6a906a79d0c4308b040fdac1b;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index ebc01ff7d9..4d21349fe6 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -1,6 +1,6 @@ /* Definitions for frame unwinder, for GDB, the GNU debugger. - Copyright (C) 2003-2014 Free Software Foundation, Inc. + Copyright (C) 2003-2017 Free Software Foundation, Inc. This file is part of GDB. @@ -24,7 +24,6 @@ #include "inline-frame.h" #include "value.h" #include "regcache.h" -#include "exceptions.h" #include "gdb_obstack.h" #include "target.h" @@ -65,7 +64,8 @@ void frame_unwind_prepend_unwinder (struct gdbarch *gdbarch, const struct frame_unwind *unwinder) { - struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data); + struct frame_unwind_table *table + = (struct frame_unwind_table *) gdbarch_data (gdbarch, frame_unwind_data); struct frame_unwind_table_entry *entry; /* Insert the new entry at the start of the list. */ @@ -79,7 +79,8 @@ void frame_unwind_append_unwinder (struct gdbarch *gdbarch, const struct frame_unwind *unwinder) { - struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data); + struct frame_unwind_table *table + = (struct frame_unwind_table *) gdbarch_data (gdbarch, frame_unwind_data); struct frame_unwind_table_entry **ip; /* Find the end of the list and insert the new entry there. */ @@ -97,27 +98,30 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache, const struct frame_unwind *unwinder) { struct cleanup *old_cleanup; - volatile struct gdb_exception ex; int res = 0; old_cleanup = frame_prepare_for_sniffer (this_frame, unwinder); - TRY_CATCH (ex, RETURN_MASK_ERROR) + TRY { res = unwinder->sniffer (unwinder, this_frame, this_cache); } - if (ex.reason < 0 && ex.error == NOT_AVAILABLE_ERROR) + CATCH (ex, RETURN_MASK_ERROR) { - /* This usually means that not even the PC is available, - thus most unwinders aren't able to determine if they're - the best fit. Keep trying. Fallback prologue unwinders - should always accept the frame. */ - do_cleanups (old_cleanup); - return 0; + if (ex.error == NOT_AVAILABLE_ERROR) + { + /* This usually means that not even the PC is available, + thus most unwinders aren't able to determine if they're + the best fit. Keep trying. Fallback prologue unwinders + should always accept the frame. */ + do_cleanups (old_cleanup); + return 0; + } + throw_exception (ex); } - else if (ex.reason < 0) - throw_exception (ex); - else if (res) + END_CATCH + + if (res) { discard_cleanups (old_cleanup); return 1; @@ -138,7 +142,8 @@ void frame_unwind_find_by_frame (struct frame_info *this_frame, void **this_cache) { struct gdbarch *gdbarch = get_frame_arch (this_frame); - struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data); + struct frame_unwind_table *table + = (struct frame_unwind_table *) gdbarch_data (gdbarch, frame_unwind_data); struct frame_unwind_table_entry *entry; const struct frame_unwind *unwinder_from_target; @@ -202,10 +207,11 @@ frame_unwind_got_optimized (struct frame_info *frame, int regnum) "". */ val = allocate_value_lazy (type); set_value_lazy (val, 0); - set_value_optimized_out (val, 1); + mark_value_bytes_optimized_out (val, 0, TYPE_LENGTH (type)); VALUE_LVAL (val) = lval_register; VALUE_REGNUM (val) = regnum; - VALUE_FRAME_ID (val) = get_frame_id (frame); + VALUE_NEXT_FRAME_ID (val) + = get_frame_id (get_next_frame_sentinel_okay (frame)); return val; }