Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts: decode_stacktrace: demangle Rust symbols

Recent versions of both Binutils (`c++filt`) and LLVM (`llvm-cxxfilt`)
provide Rust v0 mangling support.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Co-developed-by: Alex Gaynor <alex.gaynor@gmail.com>
Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
Co-developed-by: Wedson Almeida Filho <wedsonaf@google.com>
Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

+14
+14
scripts/decode_stacktrace.sh
··· 8 8 echo " $0 -r <release> | <vmlinux> [<base path>|auto] [<modules path>]" 9 9 } 10 10 11 + # Try to find a Rust demangler 12 + if type llvm-cxxfilt >/dev/null 2>&1 ; then 13 + cppfilt=llvm-cxxfilt 14 + elif type c++filt >/dev/null 2>&1 ; then 15 + cppfilt=c++filt 16 + cppfilt_opts=-i 17 + fi 18 + 11 19 if [[ $1 == "-r" ]] ; then 12 20 vmlinux="" 13 21 basepath="auto" ··· 187 179 188 180 # In the case of inlines, move everything to same line 189 181 code=${code//$'\n'/' '} 182 + 183 + # Demangle if the name looks like a Rust symbol and if 184 + # we got a Rust demangler 185 + if [[ $name =~ ^_R && $cppfilt != "" ]] ; then 186 + name=$("$cppfilt" "$cppfilt_opts" "$name") 187 + fi 190 188 191 189 # Replace old address with pretty line numbers 192 190 symbol="$segment$name ($code)"