该py脚本用于gdb–在另外一篇文章https://blog.csdn.net/Bgm_Nilbb/article/details/124853547 有说明
#command info: find thread back trace.
#command: findBackTrace.
#created: jing_taiyang.
#
# findBackTrace sp count startText endText
#
define findBackTrace
if $argc == 4
set $addr = $arg0
set $i = 0
while $i < $arg1
if *$addr >= $arg2 && *$addr <= $arg3
set $value = *$addr
printf "stackAddr(0x%x) returnAddr(0x%x)\n",$addr, $value
info line *$value
end
set $i++
set $addr++
set $addr++
set $addr++
set $addr++
end
else
printf "argment not ok\n"
end
end
#
# C++ related beautifiers (optional)
#
set height 0
set print pretty on
set print object on
set print static-members on
set print vtbl on
set print demangle on
set demangle-style gnu-v3
set print sevenbit-strings off