Allow DWARF line 0 in `libdw_a2l_cb()`, as it is a valid
reference for compiler-generated code.
Filter `die_get_call_lineno` error codes (negative values), but
fallback to line 0 if `call_fname` is present to preserve the
caller's filename instead of discarding it entirely.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Zecheng Li <zli94@ncsu.edu>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
struct libdw_a2l_cb_args *args = _args;
struct symbol *inline_sym = new_inline_sym(args->dso, args->sym, dwarf_diename(die));
const char *call_fname = die_get_call_file(die);
+ int call_lineno = die_get_call_lineno(die);
char *call_srcline = srcline__unknown;
if (!inline_sym)
/* Assign caller information to the parent. */
if (call_fname)
- call_srcline = srcline_from_fileline(call_fname, die_get_call_lineno(die));
+ call_srcline = srcline_from_fileline(call_fname, call_lineno >= 0 ? call_lineno : 0);
if (!list_empty(&args->node->val)) {
struct inline_list *parent;