History

scripts/decode_stacktrace.sh: better support to ARM32 module stack trace

Sometimes there are special characters around module names in stack traces, such as ARM32 with BACKTRACE_VERBOSE in "(%pS)" format, such as: [<806e4845>] (dump_stack_lvl) from [<7f806013>] (hello_init+0x13/0x1000 [test]) In this case, $module will be "[test])", the trace can be decoded by stripping the right parenthesis first: (dump_stack_lvl) from hello_init (/foo/test.c:10) test.

Xiong Nandi committed 2 years ago

Commit 78efbfb1 parent b41838f1 file · +3 −0Browse files

Showing the changes to scripts/decode_stacktrace.sh (1 of 1 file). Show all

Unified · Split

scripts/decode_stacktrace.sh+3−0
@@ -283,6 +283,9 @@ handle_line() { · 282 unmodified lines
283 283
284 if [[ ${words[$last]} =~ \[([^]]+)\] ]]; then284 if [[ ${words[$last]} =~ \[([^]]+)\] ]]; then
285 module=${words[$last]}285 module=${words[$last]}
286 # some traces format is "(%pS)", which like "(foo+0x0/0x1 [bar])"
287 # so $module may like "[bar])". Strip the right parenthesis firstly
288 module=${module%\)}
286 module=${module#\[}289 module=${module#\[}
287 module=${module%\]}290 module=${module%\]}
288 modbuildid=${module#* }291 modbuildid=${module#* }