GNU Binutils with patches for OS216
修订版 | a09c1169086c02febcb2df4504f5e91bfa208b64 (tree) |
---|---|
时间 | 2018-03-13 23:31:58 |
作者 | Yao Qi <yao.qi@lina...> |
Commiter | Yao Qi |
Throw exception in dwarf2 unwinders
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.
@@ -922,10 +922,6 @@ struct dwarf2_frame_cache | ||
922 | 922 | /* DWARF Call Frame Address. */ |
923 | 923 | CORE_ADDR cfa; |
924 | 924 | |
925 | - /* Set if the return address column was marked as unavailable | |
926 | - (required non-collected memory or registers to compute). */ | |
927 | - int unavailable_retaddr; | |
928 | - | |
929 | 925 | /* Set if the return address column was marked as undefined. */ |
930 | 926 | int undefined_retaddr; |
931 | 927 |
@@ -1037,41 +1033,27 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache) | ||
1037 | 1033 | execute_cfa_program (fde, instr, fde->end, gdbarch, |
1038 | 1034 | get_frame_address_in_block (this_frame), &fs); |
1039 | 1035 | |
1040 | - TRY | |
1041 | - { | |
1042 | - /* Calculate the CFA. */ | |
1043 | - switch (fs.regs.cfa_how) | |
1044 | - { | |
1045 | - case CFA_REG_OFFSET: | |
1046 | - cache->cfa = read_addr_from_reg (this_frame, fs.regs.cfa_reg); | |
1047 | - if (fs.armcc_cfa_offsets_reversed) | |
1048 | - cache->cfa -= fs.regs.cfa_offset; | |
1049 | - else | |
1050 | - cache->cfa += fs.regs.cfa_offset; | |
1051 | - break; | |
1052 | - | |
1053 | - case CFA_EXP: | |
1054 | - cache->cfa = | |
1055 | - execute_stack_op (fs.regs.cfa_exp, fs.regs.cfa_exp_len, | |
1056 | - cache->addr_size, cache->text_offset, | |
1057 | - this_frame, 0, 0); | |
1058 | - break; | |
1059 | - | |
1060 | - default: | |
1061 | - internal_error (__FILE__, __LINE__, _("Unknown CFA rule.")); | |
1062 | - } | |
1063 | - } | |
1064 | - CATCH (ex, RETURN_MASK_ERROR) | |
1036 | + /* Calculate the CFA. */ | |
1037 | + switch (fs.regs.cfa_how) | |
1065 | 1038 | { |
1066 | - if (ex.error == NOT_AVAILABLE_ERROR) | |
1067 | - { | |
1068 | - cache->unavailable_retaddr = 1; | |
1069 | - return cache; | |
1070 | - } | |
1039 | + case CFA_REG_OFFSET: | |
1040 | + cache->cfa = read_addr_from_reg (this_frame, fs.regs.cfa_reg); | |
1041 | + if (fs.armcc_cfa_offsets_reversed) | |
1042 | + cache->cfa -= fs.regs.cfa_offset; | |
1043 | + else | |
1044 | + cache->cfa += fs.regs.cfa_offset; | |
1045 | + break; | |
1046 | + | |
1047 | + case CFA_EXP: | |
1048 | + cache->cfa = | |
1049 | + execute_stack_op (fs.regs.cfa_exp, fs.regs.cfa_exp_len, | |
1050 | + cache->addr_size, cache->text_offset, | |
1051 | + this_frame, 0, 0); | |
1052 | + break; | |
1071 | 1053 | |
1072 | - throw_exception (ex); | |
1054 | + default: | |
1055 | + internal_error (__FILE__, __LINE__, _("Unknown CFA rule.")); | |
1073 | 1056 | } |
1074 | - END_CATCH | |
1075 | 1057 | |
1076 | 1058 | /* Initialize the register state. */ |
1077 | 1059 | { |
@@ -1181,9 +1163,6 @@ dwarf2_frame_unwind_stop_reason (struct frame_info *this_frame, | ||
1181 | 1163 | struct dwarf2_frame_cache *cache |
1182 | 1164 | = dwarf2_frame_cache (this_frame, this_cache); |
1183 | 1165 | |
1184 | - if (cache->unavailable_retaddr) | |
1185 | - return UNWIND_UNAVAILABLE; | |
1186 | - | |
1187 | 1166 | if (cache->undefined_retaddr) |
1188 | 1167 | return UNWIND_OUTERMOST; |
1189 | 1168 |
@@ -1197,11 +1176,7 @@ dwarf2_frame_this_id (struct frame_info *this_frame, void **this_cache, | ||
1197 | 1176 | struct dwarf2_frame_cache *cache = |
1198 | 1177 | dwarf2_frame_cache (this_frame, this_cache); |
1199 | 1178 | |
1200 | - if (cache->unavailable_retaddr) | |
1201 | - (*this_id) = frame_id_build_unavailable_stack (get_frame_func (this_frame)); | |
1202 | - else if (cache->undefined_retaddr) | |
1203 | - return; | |
1204 | - else | |
1179 | + if (!cache->undefined_retaddr) | |
1205 | 1180 | (*this_id) = frame_id_build (cache->cfa, get_frame_func (this_frame)); |
1206 | 1181 | } |
1207 | 1182 |