Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 5b280de

Browse files
bjohannesmeyerjpoimboe
authored andcommitted
scripts/faddr2line: Pass --addresses argument to addr2line
In preparation for identifying an addr2line sentinel. See previous work [0], which applies a similar change to perf. [0] commit 8dc26b6 ("perf srcline: Make sentinel reading for binutils addr2line more robust") Signed-off-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com> Link: https://lore.kernel.org/r/20240415145538.1938745-5-bjohannesmeyer@gmail.com Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
1 parent 2c80918 commit 5b280de

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/faddr2line

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,12 @@ __faddr2line() {
260260

261261
# Pass section address to addr2line and strip absolute paths
262262
# from the output:
263-
local args="--functions --pretty-print --inlines --exe=$objfile"
263+
local args="--functions --pretty-print --inlines --addresses --exe=$objfile"
264264
[[ $IS_VMLINUX = 0 ]] && args="$args --section=$sec_name"
265-
local output=$(${ADDR2LINE} $args $addr | sed "s; $dir_prefix\(\./\)*; ;")
265+
local output_with_addr=$(${ADDR2LINE} $args $addr | sed "s; $dir_prefix\(\./\)*; ;")
266+
[[ -z $output_with_addr ]] && continue
267+
268+
local output=$(echo "${output_with_addr}" | sed 's/^0x[0-9a-fA-F]*: //')
266269
[[ -z $output ]] && continue
267270

268271
# Default output (non --list):

0 commit comments

Comments
 (0)