summaryrefslogtreecommitdiff
path: root/tools/perf/util/annotate-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/annotate-data.c')
-rw-r--r--tools/perf/util/annotate-data.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-data.c
index 1047ea9d578c..b69a1cd1577a 100644
--- a/tools/perf/util/annotate-data.c
+++ b/tools/perf/util/annotate-data.c
@@ -1314,6 +1314,8 @@ static int find_data_type_insn(struct data_loc_info *dloc, int reg,
list_for_each_entry(bb, basic_blocks, list) {
struct disasm_line *dl = bb->begin;
+ BUG_ON(bb->begin->al.offset == -1 || bb->end->al.offset == -1);
+
pr_debug_dtp("bb: [%"PRIx64" - %"PRIx64"]\n",
bb->begin->al.offset, bb->end->al.offset);
@@ -1321,6 +1323,10 @@ static int find_data_type_insn(struct data_loc_info *dloc, int reg,
u64 this_ip = sym->start + dl->al.offset;
u64 addr = map__rip_2objdump(dloc->ms->map, this_ip);
+ /* Skip comment or debug info lines */
+ if (dl->al.offset == -1)
+ continue;
+
/* Update variable type at this address */
update_var_state(&state, dloc, addr, dl->al.offset, var_types);