• Home
  • Raw
  • Download

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]"
13 if type llvm-cxxfilt >/dev/null 2>&1 ; then
14 cppfilt=llvm-cxxfilt
17 cppfilt_opts=-i
21 if [[ -z ${LLVM:-} ]]; then
22 UTIL_PREFIX=${CROSS_COMPILE:-}
24 UTIL_PREFIX=llvm-
27 elif [[ ${LLVM} == -* ]]; then
35 if [[ $1 == "-r" ]] ; then
41 …for fn in {,/usr/lib/debug}/boot/vmlinux-$release{,.debug} /lib/modules/$release{,/build}/vmlinux …
42 if [ -e "$fn" ] ; then
54 basepath=${2-auto}
60 declare -A cache 2>/dev/null
64 declare -A modcache
69 for fn in $(find "$modpath" -name "${module//_/[-_]}.ko*") ; do
70 if ${READELF} -WS "$fn" | grep -qwF .debug_line ; then
82 …release=$(gdb -ex 'print init_uts_ns.name.release' -ex 'quit' -quiet -batch "$vmlinux" 2>/dev/null…
86 if [ -e "$dn" ] ; then
98 # ([name]+[offset]/[total length])
129 # Strip the symbol name so that we could look it up
130 local name=${symbol%+*}
135 if [[ $aarray_support == true && "${cache[$module,$name]+isset}" == "isset" ]]; then
136 local base_addr=${cache[$module,$name]}
138 …local base_addr=$(nm "$objfile" 2>/dev/null | awk '$3 == "'$name'" && ($2 == "t" || $2 == "T") {pr…
144 cache[$module,$name]="$base_addr"
151 # Now, replace the symbol name with the base address we found
153 expr=${expr/$name/0x$base_addr}
159 # Pass it to addr2line to get filename and line number
164 local code=$(${ADDR2LINE} -i -e "$objfile" "$address" 2>/dev/null)
177 # Strip out the base of the path on each line
178 code=$(while read -r line; do echo "${line#$basepath/}"; done <<< "$code")
180 # In the case of inlines, move everything to same line
183 # Demangle if the name looks like a Rust symbol and if
185 if [[ $name =~ ^_R && $cppfilt != "" ]] ; then
186 name=$("$cppfilt" "$cppfilt_opts" "$name")
189 # Replace old address with pretty line numbers
190 symbol="$segment$name ($code)"
203 read -a words <<<"$1"
210 local last=$(( ${#words[@]} - 1 ))
229 symbol=${words[$last-1]}
230 unset words[$last-1]
240 # Add up the line number to the symbol
252 while read line; do
253 # Let's see if we have an address in the line
254 if [[ $line =~ \[\<([^]]+)\>\] ]] ||
255 [[ $line =~ [^+\ ]+\+0x[0-9a-f]+/0x[0-9a-f]+ ]]; then
256 # Translate address to line numbers
257 handle_line "$line"
258 # Is it a code line?
259 elif [[ $line == *Code:* ]]; then
260 decode_code "$line"
262 # Nothing special in this line, show it as is
263 echo "$line"