Created
November 13, 2015 21:40
-
-
Save wolfiestyle/f3320780313f8af8ccd0 to your computer and use it in GitHub Desktop.
gdb script to get bracktraces from Lua core dumps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set $p = L->ci | |
while ($p > L->base_ci ) | |
if ( $p->func->value.gc->cl.c.isC == 1 ) | |
printf "0x%x C FUNCTION ", $p | |
output $p->func->value.gc->cl.c.f | |
printf "\n" | |
else | |
if ($p->func.tt==6) | |
set $proto = $p->func->value.gc->cl.l.p | |
set $filename = (char*)(&($proto->source->tsv) + 1) | |
set $lineno = $proto->lineinfo[ $p->savedpc - $proto->code -1 ] | |
printf "0x%x LUA FUNCTION : %d %s\n", $p, $lineno, $filename | |
else | |
printf "0x%x LUA BASE\n", $p | |
end | |
end | |
set $p = $p - 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment