Lines Matching +full:line +full:- +full:name
2 # SPDX-License-Identifier: GPL-2.0
4 #set -x
15 declare -A cache
16 declare -A modcache
20 # ([name]+[offset]/[total length])
31 local objfile=$(find "$modpath" -name $module.ko -print -quit)
40 # Strip the symbol name so that we could look it up
41 local name=${symbol%+*}
46 if [[ "${cache[$module,$name]+isset}" == "isset" ]]; then
47 local base_addr=${cache[$module,$name]}
49 local base_addr=$(nm "$objfile" | grep -i ' t ' | awk "/ $name\$/ {print \$1}" | head -n1)
50 cache[$module,$name]="$base_addr"
56 # Now, replace the symbol name with the base address we found
58 expr=${expr/$name/0x$base_addr}
64 # Pass it to addr2line to get filename and line number
69 local code=$(${CROSS_COMPILE}addr2line -i -e "$objfile" "$address")
80 # Strip out the base of the path on each line
81 code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
83 # In the case of inlines, move everything to same line
86 # Replace old address with pretty line numbers
87 symbol="$name ($code)"
100 read -a words <<<"$1"
107 local last=$(( ${#words[@]} - 1 ))
126 symbol=${words[$last-1]}
127 unset words[$last-1]
137 # Add up the line number to the symbol
141 while read line; do
142 # Let's see if we have an address in the line
143 if [[ $line =~ \[\<([^]]+)\>\] ]] ||
144 [[ $line =~ [^+\ ]+\+0x[0-9a-f]+/0x[0-9a-f]+ ]]; then
145 # Translate address to line numbers
146 handle_line "$line"
147 # Is it a code line?
148 elif [[ $line == *Code:* ]]; then
149 decode_code "$line"
151 # Nothing special in this line, show it as is
152 echo "$line"