Lines Matching +full:line +full:- +full:name

2 # SPDX-License-Identifier: GPL-2.0
4 #set -x
8 echo " $0 -r <release> | <vmlinux> [base path] [modules path]"
12 if [[ $1 == "-r" ]] ; then
18 …for fn in {,/usr/lib/debug}/boot/vmlinux-$release{,.debug} /lib/modules/$release{,/build}/vmlinux …
19 if [ -e "$fn" ] ; then
31 basepath=${2-auto}
36 declare -A cache
37 declare -A modcache
41 for fn in $(find "$modpath" -name "${module//_/[-_]}.ko*") ; do
42 if readelf -WS "$fn" | grep -qwF .debug_line ; then
54 …release=$(gdb -ex 'print init_uts_ns.name.release' -ex 'quit' -quiet -batch "$vmlinux" | sed -n 's…
58 if [ -e "$dn" ] ; then
70 # ([name]+[offset]/[total length])
99 # Strip the symbol name so that we could look it up
100 local name=${symbol%+*}
105 if [[ "${cache[$module,$name]+isset}" == "isset" ]]; then
106 local base_addr=${cache[$module,$name]}
108 …local base_addr=$(nm "$objfile" | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {print $1; exit…
113 cache[$module,$name]="$base_addr"
119 # Now, replace the symbol name with the base address we found
121 expr=${expr/$name/0x$base_addr}
127 # Pass it to addr2line to get filename and line number
132 local code=$(${CROSS_COMPILE}addr2line -i -e "$objfile" "$address")
143 # Strip out the base of the path on each line
144 code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
146 # In the case of inlines, move everything to same line
149 # Replace old address with pretty line numbers
150 symbol="$segment$name ($code)"
163 read -a words <<<"$1"
170 local last=$(( ${#words[@]} - 1 ))
189 symbol=${words[$last-1]}
190 unset words[$last-1]
200 # Add up the line number to the symbol
212 while read line; do
213 # Let's see if we have an address in the line
214 if [[ $line =~ \[\<([^]]+)\>\] ]] ||
215 [[ $line =~ [^+\ ]+\+0x[0-9a-f]+/0x[0-9a-f]+ ]]; then
216 # Translate address to line numbers
217 handle_line "$line"
218 # Is it a code line?
219 elif [[ $line == *Code:* ]]; then
220 decode_code "$line"
222 # Nothing special in this line, show it as is
223 echo "$line"