Skip to content

Commit 7fadce0

Browse files
committed
scripts/faddr2line: improve on base path filtering a bit
Due to our compiler include directives, the build pathnames for header files often end up being of the form "$srcdir/./include/linux/xyz.h", which ends up having that extra "." path component after the build base in it. Teach faddr2line to skip that too, to make code generated in inline functions in header files match the filename for the regular C files. Rabin Vincent pointed out that I can't make a stricter regexp match by using the " at " prefix for the pathname, because that ends up being locale-dependent. But this does require that the path match be preceded by a space, to make it a bit more strict (that matters mainly if we didn't find any base_dir at all, and we only end up with the "./" part of the match) Acked-by: Josh Poimboeuf <[email protected]> Cc: Rabin Vincent <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7bb91e0 commit 7fadce0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/faddr2line

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ __faddr2line() {
145145

146146
local hexsize=0x$(printf %x $sym_size)
147147
echo "$func+$offset/$hexsize:"
148-
addr2line -fpie $objfile $hexaddr | sed "s;$dir_prefix;;"
148+
addr2line -fpie $objfile $hexaddr | sed "s; $dir_prefix\(\./\)*; ;"
149149
DONE=1
150150

151151
done < <(readelf -sW $objfile | awk -v f=$func '$8 == f {print}')

0 commit comments

Comments
 (0)