+2015-03-07 Pedro Alves <palves@redhat.com>
+
+ * breakpoint.c (save_breakpoints): Adjust to avoid code between
+ TRY and CATCH.
+ * gdbtypes.c (safe_parse_type): Remove empty line.
+ (types_deeply_equal):
+ * guile/scm-frame.c (gdbscm_frame_name):
+ * linux-thread-db.c (find_new_threads_once):
+ * python/py-breakpoint.c (bppy_get_commands):
+ * record-btrace.c (record_btrace_insert_breakpoint)
+ (record_btrace_remove_breakpoint, record_btrace_start_replaying)
+ (record_btrace_start_replaying): Adjust to avoid code between TRY
+ and CATCH.
+
2015-03-07 Pedro Alves <palves@redhat.com>
* common/common-exceptions.c (struct catcher) <exception>: No
if (tp->type != bp_dprintf && tp->commands)
{
+ struct gdb_exception exception;
fprintf_unfiltered (fp, " commands\n");
{
print_command_lines (current_uiout, tp->commands->commands, 2);
}
- ui_out_redirect (current_uiout, NULL);
-
CATCH (ex, RETURN_MASK_ALL)
{
+ ui_out_redirect (current_uiout, NULL);
throw_exception (ex);
}
END_CATCH
+ ui_out_redirect (current_uiout, NULL);
fprintf_unfiltered (fp, " end\n");
}
{
type = parse_and_eval_type (p, length);
}
-
CATCH (except, RETURN_MASK_ERROR)
{
type = builtin_type (gdbarch)->builtin_void;
int
types_deeply_equal (struct type *type1, struct type *type2)
{
+ struct gdb_exception except = exception_none;
int result = 0;
struct bcache *cache;
VEC (type_equality_entry_d) *worklist = NULL;
entry.type2 = type2;
VEC_safe_push (type_equality_entry_d, worklist, &entry);
+ /* check_types_worklist calls several nested helper functions, some
+ of which can raise a GDB exception, so we just check and rethrow
+ here. If there is a GDB exception, a comparison is not capable
+ (or trusted), so exit. */
TRY
{
result = check_types_worklist (&worklist, cache);
}
- /* check_types_worklist calls several nested helper functions,
- some of which can raise a GDB Exception, so we just check
- and rethrow here. If there is a GDB exception, a comparison
- is not capable (or trusted), so exit. */
- bcache_xfree (cache);
- VEC_free (type_equality_entry_d, worklist);
- /* Rethrow if there was a problem. */
- CATCH (except, RETURN_MASK_ALL)
+ CATCH (ex, RETURN_MASK_ALL)
{
- throw_exception (except);
+ except = ex;
}
END_CATCH
+ bcache_xfree (cache);
+ VEC_free (type_equality_entry_d, worklist);
+
+ /* Rethrow if there was a problem. */
+ if (except.reason < 0)
+ throw_exception (except);
+
return result;
}
\f
enum language lang = language_minimal;
struct frame_info *frame = NULL;
SCM result;
- struct gdb_exception except = exception_none;
f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
if (frame != NULL)
find_frame_funname (frame, &name, &lang, NULL);
}
- CATCH (ex, RETURN_MASK_ALL)
+ CATCH (except, RETURN_MASK_ALL)
{
- except = ex;
+ xfree (name);
+ GDBSCM_HANDLE_GDB_EXCEPTION (except);
}
END_CATCH
- xfree (name);
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
-
if (frame == NULL)
{
gdbscm_invalid_object_error (FUNC_NAME, SCM_ARG1, self,
TD_SIGNO_MASK,
TD_THR_ANY_USER_FLAGS);
}
-
- if (libthread_db_debug)
+ CATCH (except, RETURN_MASK_ERROR)
{
- CATCH (except, RETURN_MASK_ERROR)
+ if (libthread_db_debug)
{
exception_fprintf (gdb_stdlog, except,
"Warning: find_new_threads_once: ");
}
- END_CATCH
+ }
+ END_CATCH
+ if (libthread_db_debug)
+ {
fprintf_unfiltered (gdb_stdlog,
_("Found %d new threads in iteration %d.\n"),
data.new_threads, iteration);
{
print_command_lines (current_uiout, breakpoint_commands (bp), 0);
}
- ui_out_redirect (current_uiout, NULL);
CATCH (except, RETURN_MASK_ALL)
{
+ ui_out_redirect (current_uiout, NULL);
do_cleanups (chain);
gdbpy_convert_exception (except);
return NULL;
}
END_CATCH
+ ui_out_redirect (current_uiout, NULL);
cmdstr = ui_file_xstrdup (string_file, &length);
make_cleanup (xfree, cmdstr);
result = PyString_Decode (cmdstr, strlen (cmdstr), host_charset (), NULL);
{
ret = ops->beneath->to_insert_breakpoint (ops->beneath, gdbarch, bp_tgt);
}
-
- replay_memory_access = old;
-
CATCH (except, RETURN_MASK_ALL)
{
+ replay_memory_access = old;
throw_exception (except);
}
END_CATCH
+ replay_memory_access = old;
return ret;
}
{
ret = ops->beneath->to_remove_breakpoint (ops->beneath, gdbarch, bp_tgt);
}
-
- replay_memory_access = old;
-
CATCH (except, RETURN_MASK_ALL)
{
+ replay_memory_access = old;
throw_exception (except);
}
END_CATCH
+ replay_memory_access = old;
return ret;
}
if (upd_step_stack_frame_id)
tp->control.step_stack_frame_id = frame_id;
}
-
- /* Restore the previous execution state. */
- set_executing (tp->ptid, executing);
-
CATCH (except, RETURN_MASK_ALL)
{
+ /* Restore the previous execution state. */
+ set_executing (tp->ptid, executing);
+
xfree (btinfo->replay);
btinfo->replay = NULL;
}
END_CATCH
+ /* Restore the previous execution state. */
+ set_executing (tp->ptid, executing);
+
return replay;
}