if (record_debug) \
fprintf_unfiltered (gdb_stdlog, "record: " msg "\n", ##args)
-/* Find the record target in the target stack. */
+/* See record.h. */
-static struct target_ops *
+struct target_ops *
find_record_target (void)
{
- struct target_ops *t;
-
- for (t = current_target.beneath; t != NULL; t = t->beneath)
- if (t->to_stratum == record_stratum)
- return t;
-
- return NULL;
+ return find_target_at (record_stratum);
}
/* Check that recording is active. Throw an error, if it isn't. */
/* See record.h. */
+void
+record_preopen (void)
+{
+ /* Check if a record target is already running. */
+ if (find_record_target () != NULL)
+ error (_("The process is already being recorded. Use \"record stop\" to "
+ "stop recording first."));
+}
+
+/* See record.h. */
+
int
record_read_memory (struct gdbarch *gdbarch,
CORE_ADDR memaddr, gdb_byte *myaddr,
{
DEBUG ("stop %s", t->to_shortname);
- if (t->to_stop_recording != NULL)
- t->to_stop_recording ();
+ t->to_stop_recording (t);
}
/* Unpush the record target. */
printf_filtered (_("Active record target: %s\n"), t->to_shortname);
if (t->to_info_record != NULL)
- t->to_info_record ();
+ t->to_info_record (t);
}
/* The "record save" command. */
case 'i':
modifiers |= RECORD_PRINT_INSN_RANGE;
break;
+ case 'c':
+ modifiers |= RECORD_PRINT_INDENT_CALLS;
+ break;
default:
error (_("Invalid modifier: %c."), *args);
}
Without modifiers, it prints the function name.\n\
With a /l modifier, the source file and line number range is included.\n\
With a /i modifier, the instruction number range is included.\n\
+With a /c modifier, the output is indented based on the call stack depth.\n\
With no argument, prints ten more lines after the previous ten-line print.\n\
\"record function-call-history -\" prints ten lines before a previous ten-line \
print.\n\