Skip to content

Commit

Permalink
scripts/faddr2line: Add CONFIG_DEBUG_INFO check
Browse files Browse the repository at this point in the history
Otherwise without DWARF it spits out gibberish and gives no indication
of what the problem is.

Suggested-by: John Garry <john.garry@huawei.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/ffa7734c929445caa374bf9e68078300174f09b4.1658426357.git.jpoimboe@kernel.org
  • Loading branch information
Josh Poimboeuf authored and Ingo Molnar committed Aug 2, 2022
1 parent b6a5068 commit a41a2e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/faddr2line
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ die() {
READELF="${CROSS_COMPILE:-}readelf"
ADDR2LINE="${CROSS_COMPILE:-}addr2line"
AWK="awk"
GREP="grep"

command -v ${AWK} >/dev/null 2>&1 || die "${AWK} isn't installed"
command -v ${READELF} >/dev/null 2>&1 || die "${READELF} isn't installed"
Expand Down Expand Up @@ -271,6 +272,8 @@ LIST=0
[[ ! -f $objfile ]] && die "can't find objfile $objfile"
shift

${READELF} --section-headers --wide $objfile | ${GREP} -q '\.debug_info' || die "CONFIG_DEBUG_INFO not enabled"

DIR_PREFIX=supercalifragilisticexpialidocious
find_dir_prefix $objfile

Expand Down

0 comments on commit a41a2e2

Please sign in to comment.