Skip to content

Instantly share code, notes, and snippets.

@filimonov
Last active April 5, 2024 06:52
Show Gist options
  • Save filimonov/c37a31d30692b78fddec1fd439c1f7eb to your computer and use it in GitHub Desktop.
Save filimonov/c37a31d30692b78fddec1fd439c1f7eb to your computer and use it in GitHub Desktop.
perl stack trace from gdb (also from coredump)
define perl_stack
set $end=my_perl->Icurstackinfo->si_cxix
set $i=0
while ($i<$end)
printf "%d:%s\n", my_perl->Icurstackinfo->si_cxstack[$i].cx_u.cx_blk.blku_oldcop->cop_line, my_perl->Icurstackinfo->si_cxstack[$i].cx_u.cx_blk.blku_oldcop->cop_file
set $i=$i+1
end
printf "%d:%s\n",my_perl->Icurcop->cop_line, my_perl->Icurcop->cop_file
end
# inspired by https://github.com/ahiguti/gdbperl/blob/master/gdbperl.pl
# https://www.slideshare.net/hirose31/inspect-runningperl
# http://perl.apache.org/docs/2.0/devel/debug/c.html#Analyzing_the_core_File
# https://stackoverflow.com/a/11375936/1555175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment