Lines Matching +full:line +full:- +full:name
2 # SPDX-License-Identifier: GPL-2.0
4 #set -x
8 echo " $0 -r <release>"
10 echo " $0 -h"
14 if type llvm-cxxfilt >/dev/null 2>&1 ; then
15 cppfilt=llvm-cxxfilt
18 cppfilt_opts=-i
22 if [[ -z ${LLVM:-} ]]; then
23 UTIL_PREFIX=${CROSS_COMPILE:-}
25 UTIL_PREFIX=llvm-
28 elif [[ ${LLVM} == -* ]]; then
37 if [[ $1 == "-h" ]] ; then
40 elif [[ $1 == "-r" ]] ; then
46 …for fn in {,/usr/lib/debug}/boot/vmlinux-$release{,.debug} /lib/modules/$release{,/build}/vmlinux …
47 if [ -e "$fn" ] ; then
60 basepath=${2-auto}
65 # Can we use debuginfod-find?
66 if type debuginfod-find >/dev/null 2>&1 ; then
67 debuginfod=${1-only}
70 if [[ $vmlinux == "" && -z $debuginfod ]] ; then
78 declare -A cache 2>/dev/null
82 declare -A modcache
86 if [[ -n $debuginfod ]] ; then
87 if [[ -n $modbuildid ]] ; then
88 debuginfod-find debuginfo $modbuildid && return
97 if [ -z $release ] ; then
98 …release=$(gdb -ex 'print init_uts_ns.name.release' -ex 'quit' -quiet -batch "$vmlinux" 2>/dev/null…
100 if [ -n "${release}" ] ; then
106 if [ -n "${dir}" ] && [ -e "${dir}" ]; then
107 for fn in $(find "$dir" -name "${module//_/[-_]}.ko*") ; do
108 if ${READELF} -WS "$fn" | grep -qwF .debug_line ; then
128 # ([name]+[offset]/[total length])
158 # Strip the symbol name so that we could look it up
159 local name=${symbol%+*}
164 if [[ $aarray_support == true && "${cache[$module,$name]+isset}" == "isset" ]]; then
165 local base_addr=${cache[$module,$name]}
167 …local base_addr=$(${NM} "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") …
173 cache[$module,$name]="$base_addr"
180 # Now, replace the symbol name with the base address we found
182 expr=${expr/$name/0x$base_addr}
188 # Pass it to addr2line to get filename and line number
193 local code=$(${ADDR2LINE} -i -e "$objfile" "$address" 2>/dev/null)
206 # Strip out the base of the path on each line
207 code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
209 # In the case of inlines, move everything to same line
212 # Demangle if the name looks like a Rust symbol and if
214 if [[ $name =~ ^_R && $cppfilt != "" ]] ; then
215 name=$("$cppfilt" "$cppfilt_opts" "$name")
218 # Replace old address with pretty line numbers
219 symbol="$segment$name ($code)"
229 if [[ $vmlinux_buildid =~ ^[0-9a-f]+ ]]; then
230 vmlinux=$(debuginfod-find debuginfo $vmlinux_buildid)
231 if [[ $? -ne 0 ]] ; then
232 echo "ERROR! vmlinux image not found via debuginfod-find" >&2
238 echo "ERROR! Build ID for vmlinux not found. Try passing -r or specifying vmlinux" >&2
261 read -a words <<<"$1"
268 local last=$(( ${#words[@]} - 1 ))
283 if [[ ${words[$last]} =~ ^[0-9a-f]+\] ]]; then
284 words[$last-1]="${words[$last-1]} ${words[$last]}"
286 last=$(( $last - 1 ))
301 symbol=${words[$last-1]}
302 unset words[$last-1]
313 # Add up the line number to the symbol
317 while read line; do
318 # Strip unexpected carriage return at end of line
319 line=${line%$'\r'}
321 # Let's see if we have an address in the line
322 if [[ $line =~ \[\<([^]]+)\>\] ]] ||
323 [[ $line =~ [^+\ ]+\+0x[0-9a-f]+/0x[0-9a-f]+ ]]; then
324 # Translate address to line numbers
325 handle_line "$line"
326 # Is it a code line?
327 elif [[ $line == *Code:* ]]; then
328 decode_code "$line"
329 # Is it a version line?
330 elif [[ -n $debuginfod && $line =~ PID:\ [0-9]+\ Comm: ]]; then
331 debuginfod_get_vmlinux "$line"
333 # Nothing special in this line, show it as is
334 echo "$line"