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>|auto] [<modules path>]"
12 if type llvm-cxxfilt >/dev/null 2>&1 ; then
13 cppfilt=llvm-cxxfilt
16 cppfilt_opts=-i
20 if [[ -z ${LLVM:-} ]]; then
21 UTIL_PREFIX=${CROSS_COMPILE:-}
23 UTIL_PREFIX=llvm-
26 elif [[ ${LLVM} == -* ]]; then
34 if [[ $1 == "-r" ]] ; then
40 …for fn in {,/usr/lib/debug}/boot/vmlinux-$release{,.debug} /lib/modules/$release{,/build}/vmlinux …
41 if [ -e "$fn" ] ; then
54 basepath=${2-auto}
59 # Can we use debuginfod-find?
60 if type debuginfod-find >/dev/null 2>&1 ; then
61 debuginfod=${1-only}
64 if [[ $vmlinux == "" && -z $debuginfod ]] ; then
72 declare -A cache 2>/dev/null
76 declare -A modcache
80 if [[ -n $debuginfod ]] ; then
81 if [[ -n $modbuildid ]] ; then
82 debuginfod-find debuginfo $modbuildid && return
92 for fn in $(find "$modpath" -name "${module//_/[-_]}.ko*") ; do
93 if ${READELF} -WS "$fn" | grep -qwF .debug_line ; then
105 …release=$(gdb -ex 'print init_uts_ns.name.release' -ex 'quit' -quiet -batch "$vmlinux" 2>/dev/null…
109 if [ -e "$dn" ] ; then
121 # ([name]+[offset]/[total length])
152 # Strip the symbol name so that we could look it up
153 local name=${symbol%+*}
158 if [[ $aarray_support == true && "${cache[$module,$name]+isset}" == "isset" ]]; then
159 local base_addr=${cache[$module,$name]}
161 …local base_addr=$(nm "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {pr…
167 cache[$module,$name]="$base_addr"
174 # Now, replace the symbol name with the base address we found
176 expr=${expr/$name/0x$base_addr}
182 # Pass it to addr2line to get filename and line number
187 local code=$(${ADDR2LINE} -i -e "$objfile" "$address" 2>/dev/null)
200 # Strip out the base of the path on each line
201 code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
203 # In the case of inlines, move everything to same line
206 # Demangle if the name looks like a Rust symbol and if
208 if [[ $name =~ ^_R && $cppfilt != "" ]] ; then
209 name=$("$cppfilt" "$cppfilt_opts" "$name")
212 # Replace old address with pretty line numbers
213 symbol="$segment$name ($code)"
223 if [[ $vmlinux_buildid =~ ^[0-9a-f]+ ]]; then
224 vmlinux=$(debuginfod-find debuginfo $vmlinux_buildid)
225 if [[ $? -ne 0 ]] ; then
226 echo "ERROR! vmlinux image not found via debuginfod-find" >&2
232 echo "ERROR! Build ID for vmlinux not found. Try passing -r or specifying vmlinux" >&2
255 read -a words <<<"$1"
262 local last=$(( ${#words[@]} - 1 ))
277 if [[ ${words[$last]} =~ ^[0-9a-f]+\] ]]; then
278 words[$last-1]="${words[$last-1]} ${words[$last]}"
280 last=$(( $last - 1 ))
292 symbol=${words[$last-1]}
293 unset words[$last-1]
304 # Add up the line number to the symbol
308 while read line; do
309 # Strip unexpected carriage return at end of line
310 line=${line%$'\r'}
312 # Let's see if we have an address in the line
313 if [[ $line =~ \[\<([^]]+)\>\] ]] ||
314 [[ $line =~ [^+\ ]+\+0x[0-9a-f]+/0x[0-9a-f]+ ]]; then
315 # Translate address to line numbers
316 handle_line "$line"
317 # Is it a code line?
318 elif [[ $line == *Code:* ]]; then
319 decode_code "$line"
320 # Is it a version line?
321 elif [[ -n $debuginfod && $line =~ PID:\ [0-9]+\ Comm: ]]; then
322 debuginfod_get_vmlinux "$line"
324 # Nothing special in this line, show it as is
325 echo "$line"