Last active
April 5, 2024 06:52
-
-
Save filimonov/c37a31d30692b78fddec1fd439c1f7eb to your computer and use it in GitHub Desktop.
perl stack trace from gdb (also from coredump)
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
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