GNU Binutils with patches for OS216
Revision | bea0a5aeece991b2f4f20a746ce655283607d9a6 (tree) |
---|---|
Time | 2017-09-28 06:43:26 |
Author | Pedro Alves <palves@redh...> |
Commiter | Pedro Alves |
zap catch_errors
@@ -103,8 +103,6 @@ static void map_breakpoint_numbers (const char *, | ||
103 | 103 | |
104 | 104 | static void ignore_command (char *, int); |
105 | 105 | |
106 | -static int breakpoint_re_set_one (void *); | |
107 | - | |
108 | 106 | static void breakpoint_re_set_default (struct breakpoint *); |
109 | 107 | |
110 | 108 | static void |
@@ -178,8 +176,6 @@ static void info_breakpoints_command (char *, int); | ||
178 | 176 | |
179 | 177 | static void info_watchpoints_command (char *, int); |
180 | 178 | |
181 | -static int breakpoint_cond_eval (void *); | |
182 | - | |
183 | 179 | static void cleanup_executing_breakpoints (void *); |
184 | 180 | |
185 | 181 | static void commands_command (char *, int); |
@@ -191,8 +187,6 @@ static int remove_breakpoint_1 (struct bp_location *, enum remove_bp_reason); | ||
191 | 187 | |
192 | 188 | static enum print_stop_action print_bp_stop_message (bpstat bs); |
193 | 189 | |
194 | -static int watchpoint_check (void *); | |
195 | - | |
196 | 190 | static int hw_breakpoint_used_count (void); |
197 | 191 | |
198 | 192 | static int hw_watchpoint_use_count (struct breakpoint *); |
@@ -4842,21 +4836,16 @@ bpstat_print (bpstat bs, int kind) | ||
4842 | 4836 | return PRINT_UNKNOWN; |
4843 | 4837 | } |
4844 | 4838 | |
4845 | -/* Evaluate the expression EXP and return 1 if value is zero. | |
4846 | - This returns the inverse of the condition because it is called | |
4847 | - from catch_errors which returns 0 if an exception happened, and if an | |
4848 | - exception happens we want execution to stop. | |
4849 | - The argument is a "struct expression *" that has been cast to a | |
4850 | - "void *" to make it pass through catch_errors. */ | |
4839 | +/* Evaluate the boolean expression EXP and return the result. */ | |
4851 | 4840 | |
4852 | -static int | |
4853 | -breakpoint_cond_eval (void *exp) | |
4841 | +static bool | |
4842 | +breakpoint_cond_eval (expression *exp) | |
4854 | 4843 | { |
4855 | 4844 | struct value *mark = value_mark (); |
4856 | - int i = !value_true (evaluate_expression ((struct expression *) exp)); | |
4845 | + bool res = value_true (evaluate_expression (exp)); | |
4857 | 4846 | |
4858 | 4847 | value_free_to_mark (mark); |
4859 | - return i; | |
4848 | + return res; | |
4860 | 4849 | } |
4861 | 4850 | |
4862 | 4851 | /* Allocate a new bpstat. Link it to the FIFO list by BS_LINK_POINTER. */ |
@@ -4966,30 +4955,28 @@ watchpoints_triggered (struct target_waitstatus *ws) | ||
4966 | 4955 | return 1; |
4967 | 4956 | } |
4968 | 4957 | |
4969 | -/* Possible return values for watchpoint_check (this can't be an enum | |
4970 | - because of check_errors). */ | |
4971 | -/* The watchpoint has been deleted. */ | |
4972 | -#define WP_DELETED 1 | |
4973 | -/* The value has changed. */ | |
4974 | -#define WP_VALUE_CHANGED 2 | |
4975 | -/* The value has not changed. */ | |
4976 | -#define WP_VALUE_NOT_CHANGED 3 | |
4977 | -/* Ignore this watchpoint, no matter if the value changed or not. */ | |
4978 | -#define WP_IGNORE 4 | |
4958 | +/* Possible return values for watchpoint_check. */ | |
4959 | +enum wp_check_result | |
4960 | + { | |
4961 | + /* The watchpoint has been deleted. */ | |
4962 | + WP_DELETED = 1, | |
4963 | + /* The value has changed. */ | |
4964 | + WP_VALUE_CHANGED = 2, | |
4965 | + /* The value has not changed. */ | |
4966 | + WP_VALUE_NOT_CHANGED = 3, | |
4967 | + /* Ignore this watchpoint, no matter if the value changed or not. */ | |
4968 | + WP_IGNORE = 4, | |
4969 | + }; | |
4979 | 4970 | |
4980 | 4971 | #define BP_TEMPFLAG 1 |
4981 | 4972 | #define BP_HARDWAREFLAG 2 |
4982 | 4973 | |
4983 | 4974 | /* Evaluate watchpoint condition expression and check if its value |
4984 | - changed. | |
4985 | - | |
4986 | - P should be a pointer to struct bpstat, but is defined as a void * | |
4987 | - in order for this function to be usable with catch_errors. */ | |
4975 | + changed. */ | |
4988 | 4976 | |
4989 | -static int | |
4990 | -watchpoint_check (void *p) | |
4977 | +static wp_check_result | |
4978 | +watchpoint_check (bpstat bs) | |
4991 | 4979 | { |
4992 | - bpstat bs = (bpstat) p; | |
4993 | 4980 | struct watchpoint *b; |
4994 | 4981 | struct frame_info *fr; |
4995 | 4982 | int within_current_scope; |
@@ -5185,16 +5172,29 @@ bpstat_check_watchpoint (bpstat bs) | ||
5185 | 5172 | |
5186 | 5173 | if (must_check_value) |
5187 | 5174 | { |
5188 | - char *message | |
5189 | - = xstrprintf ("Error evaluating expression for watchpoint %d\n", | |
5190 | - b->number); | |
5191 | - struct cleanup *cleanups = make_cleanup (xfree, message); | |
5192 | - int e = catch_errors ([&] () | |
5193 | - { | |
5194 | - return watchpoint_check (bs); | |
5195 | - }, | |
5196 | - message, RETURN_MASK_ALL); | |
5197 | - do_cleanups (cleanups); | |
5175 | + wp_check_result e; | |
5176 | + | |
5177 | + TRY | |
5178 | + { | |
5179 | + e = watchpoint_check (bs); | |
5180 | + } | |
5181 | + CATCH (ex, RETURN_MASK_ALL) | |
5182 | + { | |
5183 | + exception_fprintf (gdb_stderr, ex, | |
5184 | + "Error evaluating expression " | |
5185 | + "for watchpoint %d\n", | |
5186 | + b->number); | |
5187 | + | |
5188 | + SWITCH_THRU_ALL_UIS () | |
5189 | + { | |
5190 | + printf_filtered (_("Watchpoint %d deleted.\n"), | |
5191 | + b->number); | |
5192 | + } | |
5193 | + watchpoint_del_at_next_stop (b); | |
5194 | + e = WP_DELETED; | |
5195 | + } | |
5196 | + END_CATCH | |
5197 | + | |
5198 | 5198 | switch (e) |
5199 | 5199 | { |
5200 | 5200 | case WP_DELETED: |
@@ -5290,18 +5290,6 @@ bpstat_check_watchpoint (bpstat bs) | ||
5290 | 5290 | break; |
5291 | 5291 | default: |
5292 | 5292 | /* Can't happen. */ |
5293 | - case 0: | |
5294 | - /* Error from catch_errors. */ | |
5295 | - { | |
5296 | - SWITCH_THRU_ALL_UIS () | |
5297 | - { | |
5298 | - printf_filtered (_("Watchpoint %d deleted.\n"), | |
5299 | - b->number); | |
5300 | - } | |
5301 | - watchpoint_del_at_next_stop (b); | |
5302 | - /* We've already printed what needs to be printed. */ | |
5303 | - bs->print_it = print_it_done; | |
5304 | - } | |
5305 | 5293 | break; |
5306 | 5294 | } |
5307 | 5295 | } |
@@ -5327,7 +5315,8 @@ bpstat_check_breakpoint_conditions (bpstat bs, ptid_t ptid) | ||
5327 | 5315 | { |
5328 | 5316 | const struct bp_location *bl; |
5329 | 5317 | struct breakpoint *b; |
5330 | - int value_is_zero = 0; | |
5318 | + /* Assume stop. */ | |
5319 | + bool condition_result = true; | |
5331 | 5320 | struct expression *cond; |
5332 | 5321 | |
5333 | 5322 | gdb_assert (bs->stop); |
@@ -5423,26 +5412,30 @@ bpstat_check_breakpoint_conditions (bpstat bs, ptid_t ptid) | ||
5423 | 5412 | within_current_scope = 0; |
5424 | 5413 | } |
5425 | 5414 | if (within_current_scope) |
5426 | - value_is_zero | |
5427 | - = catch_errors ([&] () | |
5428 | - { | |
5429 | - return breakpoint_cond_eval (cond); | |
5430 | - }, | |
5431 | - "Error in testing breakpoint condition:\n", | |
5432 | - RETURN_MASK_ALL); | |
5415 | + { | |
5416 | + TRY | |
5417 | + { | |
5418 | + condition_result = breakpoint_cond_eval (cond); | |
5419 | + } | |
5420 | + CATCH (ex, RETURN_MASK_ALL) | |
5421 | + { | |
5422 | + exception_fprintf (gdb_stderr, ex, | |
5423 | + "Error in testing breakpoint condition:\n"); | |
5424 | + } | |
5425 | + END_CATCH | |
5426 | + } | |
5433 | 5427 | else |
5434 | 5428 | { |
5435 | 5429 | warning (_("Watchpoint condition cannot be tested " |
5436 | 5430 | "in the current scope")); |
5437 | 5431 | /* If we failed to set the right context for this |
5438 | 5432 | watchpoint, unconditionally report it. */ |
5439 | - value_is_zero = 0; | |
5440 | 5433 | } |
5441 | 5434 | /* FIXME-someday, should give breakpoint #. */ |
5442 | 5435 | value_free_to_mark (mark); |
5443 | 5436 | } |
5444 | 5437 | |
5445 | - if (cond && value_is_zero) | |
5438 | + if (cond && !condition_result) | |
5446 | 5439 | { |
5447 | 5440 | bs->stop = 0; |
5448 | 5441 | } |
@@ -14149,21 +14142,16 @@ prepare_re_set_context (struct breakpoint *b) | ||
14149 | 14142 | return make_cleanup (null_cleanup, NULL); |
14150 | 14143 | } |
14151 | 14144 | |
14152 | -/* Reset a breakpoint given it's struct breakpoint * BINT. | |
14153 | - The value we return ends up being the return value from catch_errors. | |
14154 | - Unused in this case. */ | |
14145 | +/* Reset a breakpoint. */ | |
14155 | 14146 | |
14156 | -static int | |
14157 | -breakpoint_re_set_one (void *bint) | |
14147 | +static void | |
14148 | +breakpoint_re_set_one (breakpoint *b) | |
14158 | 14149 | { |
14159 | - /* Get past catch_errs. */ | |
14160 | - struct breakpoint *b = (struct breakpoint *) bint; | |
14161 | 14150 | struct cleanup *cleanups; |
14162 | 14151 | |
14163 | 14152 | cleanups = prepare_re_set_context (b); |
14164 | 14153 | b->ops->re_set (b); |
14165 | 14154 | do_cleanups (cleanups); |
14166 | - return 0; | |
14167 | 14155 | } |
14168 | 14156 | |
14169 | 14157 | /* Re-set breakpoint locations for the current program space. |
@@ -14189,16 +14177,17 @@ breakpoint_re_set (void) | ||
14189 | 14177 | |
14190 | 14178 | ALL_BREAKPOINTS_SAFE (b, b_tmp) |
14191 | 14179 | { |
14192 | - /* Format possible error msg. */ | |
14193 | - char *message = xstrprintf ("Error in re-setting breakpoint %d: ", | |
14194 | - b->number); | |
14195 | - struct cleanup *cleanups = make_cleanup (xfree, message); | |
14196 | - catch_errors ([&] () | |
14197 | - { | |
14198 | - return breakpoint_re_set_one (b); | |
14199 | - }, | |
14200 | - message, RETURN_MASK_ALL); | |
14201 | - do_cleanups (cleanups); | |
14180 | + TRY | |
14181 | + { | |
14182 | + breakpoint_re_set_one (b); | |
14183 | + } | |
14184 | + CATCH (ex, RETURN_MASK_ALL) | |
14185 | + { | |
14186 | + exception_fprintf (gdb_stderr, ex, | |
14187 | + "Error in re-setting breakpoint %d: ", | |
14188 | + b->number); | |
14189 | + } | |
14190 | + END_CATCH | |
14202 | 14191 | } |
14203 | 14192 | set_language (save_language); |
14204 | 14193 | input_radix = save_input_radix; |
@@ -215,45 +215,6 @@ catch_exceptions_with_msg (struct ui_out *func_uiout, | ||
215 | 215 | return val; |
216 | 216 | } |
217 | 217 | |
218 | -/* This function is superseded by catch_exceptions(). */ | |
219 | - | |
220 | -int | |
221 | -catch_errors (gdb::function_view<catch_errors_ftype> func, | |
222 | - const char *errstring, return_mask mask) | |
223 | -{ | |
224 | - struct gdb_exception exception = exception_none; | |
225 | - volatile int val = 0; | |
226 | - struct ui_out *saved_uiout; | |
227 | - | |
228 | - /* Save the global ``struct ui_out'' builder. */ | |
229 | - saved_uiout = current_uiout; | |
230 | - | |
231 | - TRY | |
232 | - { | |
233 | - val = func (); | |
234 | - } | |
235 | - CATCH (ex, RETURN_MASK_ALL) | |
236 | - { | |
237 | - exception = ex; | |
238 | - } | |
239 | - END_CATCH | |
240 | - | |
241 | - /* Restore the global builder. */ | |
242 | - current_uiout = saved_uiout; | |
243 | - | |
244 | - if (exception.reason < 0 && (mask & RETURN_MASK (exception.reason)) == 0) | |
245 | - { | |
246 | - /* The caller didn't request that the event be caught. | |
247 | - Rethrow. */ | |
248 | - throw_exception (exception); | |
249 | - } | |
250 | - | |
251 | - exception_fprintf (gdb_stderr, exception, "%s", errstring); | |
252 | - if (exception.reason != 0) | |
253 | - return 0; | |
254 | - return val; | |
255 | -} | |
256 | - | |
257 | 218 | /* See exceptions.h. */ |
258 | 219 | |
259 | 220 | int |
@@ -48,21 +48,16 @@ extern void exception_fprintf (struct ui_file *file, struct gdb_exception e, | ||
48 | 48 | copy of the gdb error message. This is used when a silent error is |
49 | 49 | issued and the caller wants to manually issue the error message. |
50 | 50 | |
51 | - MASK specifies what to catch; it is normally set to | |
52 | - RETURN_MASK_ALL, if for no other reason than that the code which | |
53 | - calls catch_errors might not be set up to deal with a quit which | |
54 | - isn't caught. But if the code can deal with it, it generally | |
55 | - should be RETURN_MASK_ERROR, unless for some reason it is more | |
56 | - useful to abort only the portion of the operation inside the | |
57 | - catch_errors. Note that quit should return to the command line | |
51 | + MASK specifies what to catch; it is normally set to RETURN_MASK_ALL | |
52 | + if the code which calls catch_exceptions is not set up to deal with | |
53 | + a quit which isn't caught. But if the code can deal with it, it | |
54 | + generally should be RETURN_MASK_ERROR, unless for some reason it is | |
55 | + more useful to abort only the portion of the operation inside the | |
56 | + catch_exceptions. Note that quit should return to the command line | |
58 | 57 | fairly quickly, even if some further processing is being done. |
59 | 58 | |
60 | 59 | FIXME; cagney/2001-08-13: The need to override the global UIOUT |
61 | - builder variable should just go away. | |
62 | - | |
63 | - This function supersedes catch_errors(). | |
64 | - | |
65 | - This function uses SETJMP() and LONGJUMP(). */ | |
60 | + builder variable should just go away. */ | |
66 | 61 | |
67 | 62 | struct ui_out; |
68 | 63 | typedef int (catch_exceptions_ftype) (struct ui_out *ui_out); |
@@ -75,19 +70,6 @@ extern int catch_exceptions_with_msg | ||
75 | 70 | char **gdberrmsg, |
76 | 71 | return_mask mask); |
77 | 72 | |
78 | -/* If CATCH_ERRORS_FTYPE throws an error, catch_errors() returns zero | |
79 | - otherwize the result from CATCH_ERRORS_FTYPE is returned. It is | |
80 | - probably useful for CATCH_ERRORS_FTYPE to always return a non-zero | |
81 | - value. It's unfortunate that, catch_errors() does not return an | |
82 | - indication of the exact exception that it caught - quit_flag might | |
83 | - help. | |
84 | - | |
85 | - This function is superseded by catch_exceptions(). */ | |
86 | - | |
87 | -typedef int (catch_errors_ftype) (); | |
88 | -extern int catch_errors (gdb::function_view<catch_errors_ftype>, | |
89 | - const char *, return_mask); | |
90 | - | |
91 | 73 | /* Compare two exception objects for print equality. */ |
92 | 74 | extern int exception_print_same (struct gdb_exception e1, |
93 | 75 | struct gdb_exception e2); |
@@ -8308,12 +8308,16 @@ normal_stop (void) | ||
8308 | 8308 | struct cleanup *old_chain |
8309 | 8309 | = make_cleanup (release_stop_context_cleanup, saved_context); |
8310 | 8310 | |
8311 | - catch_errors ([&] () | |
8312 | - { | |
8313 | - execute_cmd_pre_hook (stop_command); | |
8314 | - return 0; | |
8315 | - }, | |
8316 | - "Error while running hook_stop:\n", RETURN_MASK_ALL); | |
8311 | + TRY | |
8312 | + { | |
8313 | + execute_cmd_pre_hook (stop_command); | |
8314 | + } | |
8315 | + CATCH (ex, RETURN_MASK_ALL) | |
8316 | + { | |
8317 | + exception_fprintf (gdb_stderr, ex, | |
8318 | + "Error while running hook_stop:\n"); | |
8319 | + } | |
8320 | + END_CATCH | |
8317 | 8321 | |
8318 | 8322 | /* If the stop hook resumes the target, then there's no point in |
8319 | 8323 | trying to notify about the previous stop; its context is |
@@ -9021,19 +9025,22 @@ restore_infcall_control_state (struct infcall_control_state *inf_status) | ||
9021 | 9025 | |
9022 | 9026 | if (target_has_stack) |
9023 | 9027 | { |
9024 | - /* The point of catch_errors is that if the stack is clobbered, | |
9028 | + /* The point of the try/catch is that if the stack is clobbered, | |
9025 | 9029 | walking the stack might encounter a garbage pointer and |
9026 | 9030 | error() trying to dereference it. */ |
9027 | - if (catch_errors | |
9028 | - ([&] () | |
9029 | - { | |
9030 | - return restore_selected_frame (&inf_status->selected_frame_id); | |
9031 | - }, | |
9032 | - "Unable to restore previously selected frame:\n", | |
9033 | - RETURN_MASK_ERROR) == 0) | |
9034 | - /* Error in restoring the selected frame. Select the innermost | |
9035 | - frame. */ | |
9036 | - select_frame (get_current_frame ()); | |
9031 | + TRY | |
9032 | + { | |
9033 | + restore_selected_frame (&inf_status->selected_frame_id); | |
9034 | + } | |
9035 | + CATCH (ex, RETURN_MASK_ERROR) | |
9036 | + { | |
9037 | + exception_fprintf (gdb_stderr, ex, | |
9038 | + "Unable to restore previously selected frame:\n"); | |
9039 | + /* Error in restoring the selected frame. Select the | |
9040 | + innermost frame. */ | |
9041 | + select_frame (get_current_frame ()); | |
9042 | + } | |
9043 | + END_CATCH | |
9037 | 9044 | } |
9038 | 9045 | |
9039 | 9046 | xfree (inf_status); |
@@ -1147,7 +1147,15 @@ captured_main (void *data) | ||
1147 | 1147 | change - SET_TOP_LEVEL() - has been eliminated. */ |
1148 | 1148 | while (1) |
1149 | 1149 | { |
1150 | - catch_errors (captured_command_loop, "", RETURN_MASK_ALL); | |
1150 | + TRY | |
1151 | + { | |
1152 | + captured_command_loop (); | |
1153 | + } | |
1154 | + CATCH (ex, RETURN_MASK_ALL) | |
1155 | + { | |
1156 | + exception_print (gdb_stderr, ex); | |
1157 | + } | |
1158 | + END_CATCH | |
1151 | 1159 | } |
1152 | 1160 | /* No exit -- exit is through quit_command. */ |
1153 | 1161 | } |
@@ -1315,19 +1315,19 @@ find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *), | ||
1315 | 1315 | CORE_ADDR pc, |
1316 | 1316 | CORE_ADDR *new_pc) |
1317 | 1317 | { |
1318 | - if (catch_errors ([&] () | |
1319 | - { | |
1320 | - if (f (pc, new_pc) == 0) | |
1321 | - return 1; | |
1322 | - else | |
1323 | - return 0; | |
1324 | - }, | |
1325 | - "Unable to determine target of " | |
1326 | - "Objective-C method call (ignoring):\n", | |
1327 | - RETURN_MASK_ALL) == 0) | |
1328 | - return 1; | |
1329 | - else | |
1330 | - return 0; | |
1318 | + TRY | |
1319 | + { | |
1320 | + if (f (pc, new_pc) == 0) | |
1321 | + return 1; | |
1322 | + } | |
1323 | + CATCH (ex, RETURN_MASK_ALL) | |
1324 | + { | |
1325 | + exception_fprintf (gdb_stderr, ex, | |
1326 | + "Unable to determine target of " | |
1327 | + "Objective-C method call (ignoring):\n"); | |
1328 | + } | |
1329 | + | |
1330 | + return 0; | |
1331 | 1331 | } |
1332 | 1332 | |
1333 | 1333 | int |
@@ -565,7 +565,7 @@ record_full_arch_list_cleanups (void *ignore) | ||
565 | 565 | record the running message of inferior and set them to |
566 | 566 | record_full_arch_list, and add it to record_full_list. */ |
567 | 567 | |
568 | -static int | |
568 | +static void | |
569 | 569 | record_full_message (struct regcache *regcache, enum gdb_signal signal) |
570 | 570 | { |
571 | 571 | int ret; |
@@ -633,19 +633,24 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal) | ||
633 | 633 | record_full_list_release_first (); |
634 | 634 | else |
635 | 635 | record_full_insn_num++; |
636 | - | |
637 | - return 1; | |
638 | 636 | } |
639 | 637 | |
640 | -static int | |
638 | +static bool | |
641 | 639 | record_full_message_wrapper_safe (struct regcache *regcache, |
642 | 640 | enum gdb_signal signal) |
643 | 641 | { |
644 | - return catch_errors ([&] () | |
645 | - { | |
646 | - return record_full_message (regcache, signal); | |
647 | - }, | |
648 | - "", RETURN_MASK_ALL); | |
642 | + TRY | |
643 | + { | |
644 | + record_full_message (regcache, signal); | |
645 | + } | |
646 | + CATCH (ex, RETURN_MASK_ALL) | |
647 | + { | |
648 | + exception_print (gdb_stderr, ex); | |
649 | + return false; | |
650 | + } | |
651 | + END_CATCH | |
652 | + | |
653 | + return true; | |
649 | 654 | } |
650 | 655 | |
651 | 656 | /* Set to 1 if record_full_store_registers and record_full_xfer_partial |
@@ -760,12 +760,19 @@ update_solib_list (int from_tty) | ||
760 | 760 | have not opened a symbol file, we may be able to get its |
761 | 761 | symbols now! */ |
762 | 762 | if (inf->attach_flag && symfile_objfile == NULL) |
763 | - catch_errors ([&] () | |
764 | - { | |
765 | - return ops->open_symbol_file_object (from_tty); | |
766 | - }, | |
767 | - "Error reading attached process's symbol file.\n", | |
768 | - RETURN_MASK_ALL); | |
763 | + { | |
764 | + TRY | |
765 | + { | |
766 | + ops->open_symbol_file_object (from_tty); | |
767 | + } | |
768 | + CATCH (ex, RETURN_MASK_ALL) | |
769 | + { | |
770 | + exception_fprintf (gdb_stderr, ex, | |
771 | + "Error reading attached " | |
772 | + "process's symbol file.\n"); | |
773 | + } | |
774 | + END_CATCH | |
775 | + } | |
769 | 776 | } |
770 | 777 | |
771 | 778 | /* GDB and the inferior's dynamic linker each maintain their own |
@@ -54,16 +54,9 @@ FILE *std_err; | ||
54 | 54 | |
55 | 55 | static int block_depth (struct block *); |
56 | 56 | |
57 | -struct print_symbol_args | |
58 | - { | |
59 | - struct gdbarch *gdbarch; | |
60 | - struct symbol *symbol; | |
61 | - int depth; | |
62 | - struct ui_file *outfile; | |
63 | - }; | |
64 | - | |
65 | -static int print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, | |
66 | - int depth, struct ui_file *outfile); | |
57 | +static void print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, | |
58 | + int depth, struct ui_file *outfile); | |
59 | + | |
67 | 60 | |
68 | 61 | |
69 | 62 | void |
@@ -358,13 +351,16 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile) | ||
358 | 351 | block, not any blocks from included symtabs. */ |
359 | 352 | ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym) |
360 | 353 | { |
361 | - catch_errors ([&] () | |
362 | - { | |
363 | - return print_symbol (gdbarch, sym, depth + 1, | |
364 | - outfile); | |
365 | - }, | |
366 | - "Error printing symbol:\n", | |
367 | - RETURN_MASK_ERROR); | |
354 | + TRY | |
355 | + { | |
356 | + print_symbol (gdbarch, sym, depth + 1, outfile); | |
357 | + } | |
358 | + CATCH (ex, RETURN_MASK_ERROR) | |
359 | + { | |
360 | + exception_fprintf (gdb_stderr, ex, | |
361 | + "Error printing symbol:\n"); | |
362 | + } | |
363 | + END_CATCH | |
368 | 364 | } |
369 | 365 | } |
370 | 366 | fprintf_filtered (outfile, "\n"); |
@@ -515,10 +511,9 @@ maintenance_print_symbols (const char *args, int from_tty) | ||
515 | 511 | } |
516 | 512 | } |
517 | 513 | |
518 | -/* Print symbol SYMBOL on OUTFILE. DEPTH says how far to indent. | |
519 | - Returns 0 for error, 1 for success. */ | |
514 | +/* Print symbol SYMBOL on OUTFILE. DEPTH says how far to indent. */ | |
520 | 515 | |
521 | -static int | |
516 | +static void | |
522 | 517 | print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, |
523 | 518 | int depth, struct ui_file *outfile) |
524 | 519 | { |
@@ -541,7 +536,6 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, | ||
541 | 536 | section->the_bfd_section)); |
542 | 537 | else |
543 | 538 | fprintf_filtered (outfile, "\n"); |
544 | - return 1; | |
545 | 539 | } |
546 | 540 | if (SYMBOL_DOMAIN (symbol) == STRUCT_DOMAIN) |
547 | 541 | { |
@@ -689,7 +683,6 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, | ||
689 | 683 | } |
690 | 684 | } |
691 | 685 | fprintf_filtered (outfile, "\n"); |
692 | - return 1; | |
693 | 686 | } |
694 | 687 | |
695 | 688 | static void |