aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorMarkus Metzger <mmetzger@sourceware.org>2013-03-11 08:50:05 +0000
committerMarkus Metzger <mmetzger@sourceware.org>2013-03-11 08:50:05 +0000
commit15984c13c729e1f05eb789a3883df82994d5a593 (patch)
treef80d1649597fb49b4f33b80f3845f724565a1d34 /gdb/target.c
parent67c86d068313124e6c73e6ec0294866fc0471268 (diff)
downloadgdb-15984c13c729e1f05eb789a3883df82994d5a593.zip
gdb-15984c13c729e1f05eb789a3883df82994d5a593.tar.gz
gdb-15984c13c729e1f05eb789a3883df82994d5a593.tar.bz2
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 4bf4574..0329da3 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)
{