summaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authormmetzger <mmetzger>2013-03-11 08:50:04 +0000
committermmetzger <mmetzger>2013-03-11 08:50:04 +0000
commit201e18ad00737a6c18d8f07d040747c9305c4c86 (patch)
tree486bf8f0a4f1670fff23898c2ef1f239d00446fc /gdb/target.c
parentd63ee17bdefcc06c7f15ac49b98fc339337cc5df (diff)
downloadgdb-201e18ad00737a6c18d8f07d040747c9305c4c86.tar.gz
Add command to print the function names from recorded instructions.
This command provides a quick high-level overview over the recorded execution log at function granularity without having to reverse-step. gdb/ * target.c (target_call_history, target_call_history_from, target_call_history_range): New. * target.h (target_ops) <to_call_history, to_call_history_from, to_call_history_range>: New fields. (target_call_history, target_call_history_from, target_call_history_range): New declaration. * record.c (get_call_history_modifiers, cmd_record_call_history, record_call_history_size): New. (_initialize_record): Add the "record function-call-history" command. Add "set/show record function-call-history-size" commands. * record.h (record_print_flag): New.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 4bf4574857e..0329da32adf 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -4439,6 +4439,57 @@ target_insn_history_range (ULONGEST begin, ULONGEST end, int flags)
tcomplain ();
}
+/* See target.h. */
+
+void
+target_call_history (int size, int flags)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ if (t->to_call_history != NULL)
+ {
+ t->to_call_history (size, flags);
+ return;
+ }
+
+ tcomplain ();
+}
+
+/* See target.h. */
+
+void
+target_call_history_from (ULONGEST begin, int size, int flags)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ if (t->to_call_history_from != NULL)
+ {
+ t->to_call_history_from (begin, size, flags);
+ return;
+ }
+
+ tcomplain ();
+}
+
+/* See target.h. */
+
+void
+target_call_history_range (ULONGEST begin, ULONGEST end, int flags)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ if (t->to_call_history_range != NULL)
+ {
+ t->to_call_history_range (begin, end, flags);
+ return;
+ }
+
+ tcomplain ();
+}
+
static void
debug_to_prepare_to_store (struct regcache *regcache)
{