aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.h
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2014-01-29 12:56:09 +0100
committerMarkus Metzger <markus.t.metzger@intel.com>2015-02-09 09:46:49 +0100
commit7d5c24b3ae60b6cfa41ebf9329b2f7832053b0f6 (patch)
tree3eb45782a6a59d4d86ebef71ec5716b170754ce1 /gdb/btrace.h
parent76235df10b96f85815d799b586a6bb32bc89c90f (diff)
downloadgdb-7d5c24b3ae60b6cfa41ebf9329b2f7832053b0f6.zip
gdb-7d5c24b3ae60b6cfa41ebf9329b2f7832053b0f6.tar.gz
gdb-7d5c24b3ae60b6cfa41ebf9329b2f7832053b0f6.tar.bz2
btrace: extend struct btrace_insn
Add the instruction's size as well as a coarse classification to struct btrace_insn. Use the information in ftrace_update_function and ftrace_find_call. 2015-02-09 Markus Metzger <markus.t.metzger@intel.com> * btrace.h (btrace_insn_class): New. (btrace_insn) <size, iclass>: New. * btrace.c (ftrace_find_call): Update parameters. Update users. Use instruction classification. (ftrace_new_return): Update parameters. Update users. (ftrace_update_function): Update parameters. Update users. Use instruction classification. (ftrace_update_insns): Update parameters. Update users. (ftrace_classify_insn): New. (btrace_compute_ftrace_bts): Fill in new btrace_insn fields. Add TRY_CATCH around call to gdb_insn_length.
Diffstat (limited to 'gdb/btrace.h')
-rw-r--r--gdb/btrace.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/btrace.h b/gdb/btrace.h
index fde0619..694d504 100644
--- a/gdb/btrace.h
+++ b/gdb/btrace.h
@@ -31,6 +31,22 @@
struct thread_info;
struct btrace_function;
+/* A coarse instruction classification. */
+enum btrace_insn_class
+{
+ /* The instruction is something not listed below. */
+ BTRACE_INSN_OTHER,
+
+ /* The instruction is a function call. */
+ BTRACE_INSN_CALL,
+
+ /* The instruction is a function return. */
+ BTRACE_INSN_RETURN,
+
+ /* The instruction is an unconditional jump. */
+ BTRACE_INSN_JUMP
+};
+
/* A branch trace instruction.
This represents a single instruction in a branch trace. */
@@ -38,6 +54,12 @@ struct btrace_insn
{
/* The address of this instruction. */
CORE_ADDR pc;
+
+ /* The size of this instruction in bytes. */
+ gdb_byte size;
+
+ /* The instruction class of this instruction. */
+ enum btrace_insn_class iclass;
};
/* A vector of branch trace instructions. */