Source
30
30
[[ $modpath == "" ]] && return
31
31
local objfile=$(find "$modpath" -name $module.ko -print -quit)
32
32
[[ $objfile == "" ]] && return
33
33
modcache[$module]=$objfile
34
34
fi
35
35
36
36
# Remove the englobing parenthesis
37
37
symbol=${symbol#\(}
38
38
symbol=${symbol%\)}
39
39
40
+
# Strip segment
41
+
local segment
42
+
if [[ $symbol == *:* ]] ; then
43
+
segment=${symbol%%:*}:
44
+
symbol=${symbol#*:}
45
+
fi
46
+
40
47
# Strip the symbol name so that we could look it up
41
48
local name=${symbol%+*}
42
49
43
50
# Use 'nm vmlinux' to figure out the base address of said symbol.
44
51
# It's actually faster to call it every time than to load it
45
52
# all into bash.
46
53
if [[ "${cache[$module,$name]+isset}" == "isset" ]]; then
47
54
local base_addr=${cache[$module,$name]}
48
55
else
49
56
local base_addr=$(nm "$objfile" | grep -i ' t ' | awk "/ $name\$/ {print \$1}" | head -n1)
77
84
return
78
85
fi
79
86
80
87
# Strip out the base of the path
81
88
code=${code//^$basepath/""}
82
89
83
90
# In the case of inlines, move everything to same line
84
91
code=${code//$'\n'/' '}
85
92
86
93
# Replace old address with pretty line numbers
87
-
symbol="$name ($code)"
94
+
symbol="$segment$name ($code)"
88
95
}
89
96
90
97
decode_code() {
91
98
local scripts=`dirname "${BASH_SOURCE[0]}"`
92
99
93
100
echo "$1" | $scripts/decodecode
94
101
}
95
102
96
103
handle_line() {
97
104
local words