set $stacktrace_full=1 define stacktrace set $n_esp=$arg0 set $n_words=$arg1 set $n_end = $n_esp + $n_words while $n_esp < $n_end set $n_value = *(uint32 *)$n_esp if (&_start <= $n_value) && ($n_value <= &_etext) printf "%#8x: ", $n_esp output/a $n_value printf "\n" else if $stacktrace_full printf "%#8x: %#-10x\n", $n_esp, $n_value end end set $n_esp = $n_esp + 1 end end document stacktrace stacktrace start-esp number-of-words Dumps a number of words in memory as a stack trace. If the data at a memory location is from the text section, a symbolic name will be printed. If the data is not from the text segment, hexadecimal data will be output. set $stacktrace_full=0 to only output symbolic names, thus effectively skipping raw data. end