aboutsummaryrefslogtreecommitdiff
path: root/gdb/btrace.h
diff options
context:
space:
mode:
authorTim Wiederhake <tim.wiederhake@intel.com>2016-11-21 16:39:57 +0100
committerTim Wiederhake <tim.wiederhake@intel.com>2017-02-14 10:57:56 +0100
commit69090ceead6fa841669eea0c81b3e8e9695def5f (patch)
treeb5bb94c2a93218867f8d4bb4217283feb58d63f9 /gdb/btrace.h
parent4c2c7ac69d7318d61a5c0e4f5ddcee1c1597f4e0 (diff)
downloadbinutils-69090ceead6fa841669eea0c81b3e8e9695def5f.zip
binutils-69090ceead6fa841669eea0c81b3e8e9695def5f.tar.gz
binutils-69090ceead6fa841669eea0c81b3e8e9695def5f.tar.bz2
btrace: Count gaps as one instruction explicitly.
This gives all instructions, including gaps, a unique number. Add a function to retrieve the error code if a btrace instruction iterator points to an invalid instruction. Signed-off-by: Tim Wiederhake <tim.wiederhake@intel.com> gdb/ChangeLog: * btrace.c (ftrace_call_num_insn, btrace_insn_get_error): New function. (ftrace_new_function, btrace_insn_number, btrace_insn_cmp, btrace_find_insn_by_number): Remove special case for gaps. * btrace.h (btrace_insn_get_error): New export. (btrace_insn_number, btrace_find_insn_by_number): Adjust comment. * record-btrace.c (btrace_insn_history): Print number for gaps. (record_btrace_info, record_btrace_goto): Handle gaps. Change-Id: I8eb0e48a95f4278522fea74ea13526bfe6898ecc
Diffstat (limited to 'gdb/btrace.h')
-rw-r--r--gdb/btrace.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/btrace.h b/gdb/btrace.h
index dcc776a..f9af46c 100644
--- a/gdb/btrace.h
+++ b/gdb/btrace.h
@@ -405,9 +405,12 @@ extern void parse_xml_btrace_conf (struct btrace_config *conf, const char *xml);
extern const struct btrace_insn *
btrace_insn_get (const struct btrace_insn_iterator *);
+/* Return the error code for a branch trace instruction iterator. Returns zero
+ if there is no error, i.e. the instruction is valid. */
+extern int btrace_insn_get_error (const struct btrace_insn_iterator *);
+
/* Return the instruction number for a branch trace iterator.
- Returns one past the maximum instruction number for the end iterator.
- Returns zero if the iterator does not point to a valid instruction. */
+ Returns one past the maximum instruction number for the end iterator. */
extern unsigned int btrace_insn_number (const struct btrace_insn_iterator *);
/* Initialize a branch trace instruction iterator to point to the begin/end of
@@ -433,7 +436,7 @@ extern unsigned int btrace_insn_prev (struct btrace_insn_iterator *,
extern int btrace_insn_cmp (const struct btrace_insn_iterator *lhs,
const struct btrace_insn_iterator *rhs);
-/* Find an instruction in the function branch trace by its number.
+/* Find an instruction or gap in the function branch trace by its number.
If the instruction is found, initialize the branch trace instruction
iterator to point to this instruction and return non-zero.
Return zero otherwise. */