/* Process record and replay target for GDB, the GNU debugger.
- Copyright (C) 2013-2018 Free Software Foundation, Inc.
+ Copyright (C) 2013-2019 Free Software Foundation, Inc.
This file is part of GDB.
class record_full_base_target : public target_ops
{
public:
- record_full_base_target ()
- { to_stratum = record_stratum; }
-
const target_info &info () const override = 0;
+ strata stratum () const override { return record_stratum; }
+
void close () override;
void async (int) override;
ptid_t wait (ptid_t, struct target_waitstatus *, int) override;
int ret;
struct gdbarch *gdbarch = regcache->arch ();
- TRY
+ try
{
record_full_arch_list_head = NULL;
record_full_arch_list_tail = NULL;
if (ret < 0)
error (_("Process record: failed to record execution log."));
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &ex)
{
record_full_list_release (record_full_arch_list_tail);
- throw_exception (ex);
+ throw;
}
- END_CATCH
record_full_list->next = record_full_arch_list_head;
record_full_arch_list_head->prev = record_full_list;
record_full_message_wrapper_safe (struct regcache *regcache,
enum gdb_signal signal)
{
- TRY
+ try
{
record_full_message (regcache, signal);
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &ex)
{
exception_print (gdb_stderr, ex);
return false;
}
- END_CATCH
return true;
}
}
/* Release record_full_core_buf_list. */
- if (record_full_core_buf_list)
+ while (record_full_core_buf_list)
{
- for (entry = record_full_core_buf_list->prev; entry;
- entry = entry->prev)
- {
- xfree (record_full_core_buf_list);
- record_full_core_buf_list = entry;
- }
- record_full_core_buf_list = NULL;
+ entry = record_full_core_buf_list;
+ record_full_core_buf_list = record_full_core_buf_list->prev;
+ xfree (entry);
}
if (record_full_async_inferior_event_token)
}
/* Make sure the target beneath reports all signals. */
- target_pass_signals (0, NULL);
+ target_pass_signals ({});
this->beneath ()->resume (ptid, step, signal);
}
while (1)
{
- struct thread_info *tp;
-
ret = ops->beneath ()->wait (ptid, status, options);
if (status->kind == TARGET_WAITKIND_IGNORE)
{
return ret;
}
- ALL_NON_EXITED_THREADS (tp)
+ for (thread_info *tp : all_non_exited_threads ())
delete_single_step_breakpoints (tp);
if (record_full_resume_step)
int continue_flag = 1;
int first_record_full_end = 1;
- TRY
+ try
{
CORE_ADDR tmp_pc;
else
status->value.sig = GDB_SIGNAL_TRAP;
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &ex)
{
if (execution_direction == EXEC_REVERSE)
{
else
record_full_list = record_full_list->prev;
- throw_exception (ex);
+ throw;
}
- END_CATCH
}
signal (SIGINT, handle_sigint);
record_full_arch_list_tail = NULL;
record_full_insn_num = 0;
- TRY
+ try
{
regcache = get_current_regcache ();
record_full_arch_list_add (rec);
}
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &ex)
{
record_full_list_release (record_full_arch_list_tail);
- throw_exception (ex);
+ throw;
}
- END_CATCH
/* Add record_full_arch_list_head to the end of record list. */
record_full_first.next = record_full_arch_list_head;