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>]"
11 if [[ $1 == "-r" ]] ; then
17 …for fn in {,/usr/lib/debug}/boot/vmlinux-$release{,.debug} /lib/modules/$release{,/build}/vmlinux …
18 if [ -e "$fn" ] ; then
31 basepath=${2-auto}
36 # Can we use debuginfod-find?
37 if type debuginfod-find >/dev/null 2>&1 ; then
38 debuginfod=${1-only}
41 if [[ $vmlinux == "" && -z $debuginfod ]] ; then
48 declare -A cache
49 declare -A modcache
52 if [[ -n $debuginfod ]] ; then
53 if [[ -n $modbuildid ]] ; then
54 debuginfod-find debuginfo $modbuildid && return
64 for fn in $(find "$modpath" -name "${module//_/[-_]}.ko*") ; do
65 if readelf -WS "$fn" | grep -qwF .debug_line ; then
77 …release=$(gdb -ex 'print init_uts_ns.name.release' -ex 'quit' -quiet -batch "$vmlinux" 2>/dev/null…
81 if [ -e "$dn" ] ; then
93 # ([name]+[offset]/[total length])
122 # Strip the symbol name so that we could look it up
123 local name=${symbol%+*}
128 if [[ "${cache[$module,$name]+isset}" == "isset" ]]; then
129 local base_addr=${cache[$module,$name]}
131 …local base_addr=$(nm "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {pr…
136 cache[$module,$name]="$base_addr"
142 # Now, replace the symbol name with the base address we found
144 expr=${expr/$name/0x$base_addr}
150 # Pass it to addr2line to get filename and line number
155 local code=$(${CROSS_COMPILE}addr2line -i -e "$objfile" "$address" 2>/dev/null)
166 # Strip out the base of the path on each line
167 code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
169 # In the case of inlines, move everything to same line
172 # Replace old address with pretty line numbers
173 symbol="$segment$name ($code)"
183 if [[ $vmlinux_buildid =~ ^[0-9a-f]+ ]]; then
184 vmlinux=$(debuginfod-find debuginfo $vmlinux_buildid)
185 if [[ $? -ne 0 ]] ; then
186 echo "ERROR! vmlinux image not found via debuginfod-find" >&2
192 echo "ERROR! Build ID for vmlinux not found. Try passing -r or specifying vmlinux" >&2
215 read -a words <<<"$1"
222 local last=$(( ${#words[@]} - 1 ))
237 if [[ ${words[$last]} =~ ^[0-9a-f]+\] ]]; then
238 words[$last-1]="${words[$last-1]} ${words[$last]}"
240 last=$(( $last - 1 ))
252 symbol=${words[$last-1]}
253 unset words[$last-1]
264 # Add up the line number to the symbol
268 while read line; do
269 # Let's see if we have an address in the line
270 if [[ $line =~ \[\<([^]]+)\>\] ]] ||
271 [[ $line =~ [^+\ ]+\+0x[0-9a-f]+/0x[0-9a-f]+ ]]; then
272 # Translate address to line numbers
273 handle_line "$line"
274 # Is it a code line?
275 elif [[ $line == *Code:* ]]; then
276 decode_code "$line"
277 # Is it a version line?
278 elif [[ -n $debuginfod && $line =~ PID:\ [0-9]+\ Comm: ]]; then
279 debuginfod_get_vmlinux "$line"
281 # Nothing special in this line, show it as is
282 echo "$line"