/* Process record and replay target for GDB, the GNU debugger.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2017 Free Software Foundation, Inc.
This file is part of GDB.
record_full_open_1 (const char *name, int from_tty)
{
if (record_debug)
- fprintf_unfiltered (gdb_stdlog, "Process record: record_full_open\n");
+ fprintf_unfiltered (gdb_stdlog, "Process record: record_full_open_1\n");
/* check exec */
if (!target_has_execution)
}
else
{
- /* This arch support soft sigle step. */
+ /* This arch supports soft single step. */
if (thread_has_single_step_breakpoints_set (inferior_thread ()))
{
/* This is a soft single step. */
record_full_resume_step = 1;
}
else
- {
- /* This is a continue.
- Try to insert a soft single step breakpoint. */
- if (!gdbarch_software_single_step (gdbarch,
- get_current_frame ()))
- {
- /* This system don't want use soft single step.
- Use hard sigle step. */
- step = 1;
- }
- }
+ step = !insert_single_step_breakpoints (gdbarch);
}
}
target_async (1);
}
+/* "to_commit_resume" method for process record target. */
+
+static void
+record_full_commit_resume (struct target_ops *ops)
+{
+ if (!RECORD_FULL_IS_REPLAY)
+ ops->beneath->to_commit_resume (ops->beneath);
+}
+
static int record_full_get_sig = 0;
/* SIGINT signal handler, registered by "to_wait" method. */
If insert success, set step to 0. */
set_executing (inferior_ptid, 0);
reinit_frame_cache ();
- if (gdbarch_software_single_step (gdbarch,
- get_current_frame ()))
- step = 0;
+
+ step = !insert_single_step_breakpoints (gdbarch);
+
set_executing (inferior_ptid, 1);
}
"target beneath\n");
ops->beneath->to_resume (ops->beneath, ptid, step,
GDB_SIGNAL_0);
+ ops->beneath->to_commit_resume (ops->beneath);
continue;
}
}
really need to install regular breakpoints in the inferior.
However, we do have to insert software single-step
breakpoints, in case the target can't hardware step. To keep
- things single, we always insert. */
+ things simple, we always insert. */
struct cleanup *old_cleanups;
int ret;
in_target_beneath = 1;
}
- else
- {
- CORE_ADDR addr = bp_tgt->reqstd_address;
- int bplen;
-
- gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen);
-
- bp_tgt->placed_address = addr;
- bp_tgt->placed_size = bplen;
- }
/* Use the existing entries if found in order to avoid duplication
in record_full_breakpoints. */
return ret;
}
- VEC_unordered_remove (record_full_breakpoint_p,
- record_full_breakpoints, ix);
+ if (reason == REMOVE_BREAKPOINT)
+ {
+ VEC_unordered_remove (record_full_breakpoint_p,
+ record_full_breakpoints, ix);
+ }
return 0;
}
}
record_full_ops.to_close = record_full_close;
record_full_ops.to_async = record_full_async;
record_full_ops.to_resume = record_full_resume;
+ record_full_ops.to_commit_resume = record_full_commit_resume;
record_full_ops.to_wait = record_full_wait;
record_full_ops.to_disconnect = record_disconnect;
record_full_ops.to_detach = record_detach;
recfilename);
/* Open the output file. */
- obfd = create_gcore_bfd (recfilename);
+ obfd = create_gcore_bfd (recfilename).release ();
old_cleanups = make_cleanup (record_full_save_cleanups, obfd);
/* Save the current record entry to "cur_record_full_list". */