enum record_method record_method (ptid_t ptid) override;
- void stop_recording () override;
+ bool stop_recording () override;
void info_record () override;
void insn_history (int size, gdb_disassembly_flags flags) override;
/* The stop_recording method of target record-btrace. */
-void
+bool
record_btrace_target::stop_recording ()
{
DEBUG ("stop recording");
+ bool is_replaying = record_is_replaying (inferior_ptid);
record_stop_replaying ();
record_btrace_auto_disable ();
for (thread_info *tp : current_inferior ()->non_exited_threads ())
if (tp->btrace.target != NULL)
btrace_disable (tp);
+
+ return is_replaying;
}
/* The disconnect method of target record-btrace. */
/* Stop recording. */
-static void
+static bool
record_stop (struct target_ops *t)
{
DEBUG ("stop %s", t->shortname ());
- t->stop_recording ();
+ return t->stop_recording ();
}
/* Unpush the record target. */
DEBUG ("disconnect %s", t->shortname ());
- record_stop (t);
+ (void) record_stop (t);
record_unpush (t);
target_disconnect (args, from_tty);
DEBUG ("detach %s", t->shortname ());
- record_stop (t);
+ (void) record_stop (t);
record_unpush (t);
target_detach (inf, from_tty);
static void
cmd_record_stop (const char *args, int from_tty)
{
- struct target_ops *t;
-
- t = require_record_target ();
-
- record_stop (t);
+ struct target_ops *t = require_record_target ();
+ bool notify_stop = record_stop (t);
record_unpush (t);
gdb_printf (_("Process record is stopped and all execution "
"logs are deleted.\n"));
+ /* INFERIOR_PTID may have moved when we stopped recording. */
+ if (notify_stop)
+ notify_normal_stop (nullptr, true);
+
interps_notify_record_changed (current_inferior (), 0, NULL, NULL);
}
enum btrace_error read_btrace (struct btrace_data *arg0, struct btrace_target_info *arg1, enum btrace_read_type arg2) override;
const struct btrace_config *btrace_conf (const struct btrace_target_info *arg0) override;
enum record_method record_method (ptid_t arg0) override;
- void stop_recording () override;
+ bool stop_recording () override;
void info_record () override;
void save_record (const char *arg0) override;
bool supports_delete_record () override;
enum btrace_error read_btrace (struct btrace_data *arg0, struct btrace_target_info *arg1, enum btrace_read_type arg2) override;
const struct btrace_config *btrace_conf (const struct btrace_target_info *arg0) override;
enum record_method record_method (ptid_t arg0) override;
- void stop_recording () override;
+ bool stop_recording () override;
void info_record () override;
void save_record (const char *arg0) override;
bool supports_delete_record () override;
return result;
}
-void
+bool
target_ops::stop_recording ()
{
- this->beneath ()->stop_recording ();
+ return this->beneath ()->stop_recording ();
}
-void
+bool
dummy_target::stop_recording ()
{
+ return false;
}
-void
+bool
debug_target::stop_recording ()
{
target_debug_printf_nofunc ("-> %s->stop_recording (...)", this->beneath ()->shortname ());
- this->beneath ()->stop_recording ();
- target_debug_printf_nofunc ("<- %s->stop_recording ()",
- this->beneath ()->shortname ());
+ bool result
+ = this->beneath ()->stop_recording ();
+ target_debug_printf_nofunc ("<- %s->stop_recording () = %s",
+ this->beneath ()->shortname (),
+ target_debug_print_bool (result).c_str ());
+ return result;
}
void
virtual enum record_method record_method (ptid_t ptid)
TARGET_DEFAULT_RETURN (RECORD_METHOD_NONE);
- /* Stop trace recording. */
- virtual void stop_recording ()
- TARGET_DEFAULT_IGNORE ();
+ /* Stop trace recording. Return whether the selected thread moved. */
+ virtual bool stop_recording ()
+ TARGET_DEFAULT_RETURN (false);
/* Print information about the recording. */
virtual void info_record ()
# Stop recording and try to step live (pr19340).
with_test_prefix "live" {
- gdb_test "record stop" "Process record is stopped.*"
+ gdb_test "record stop" "Process record is stopped.*fun4\.4.*"
gdb_test "reverse-next" "Target .* does not support this command.*"
gdb_test "step" ".*fun3\.2.*"
}