Esteemed monks,
the gdb debugger can connect to any running process, perl scripts included. So if I know that my script has process id 1234, I can simply call
gdb -p 1234
and boom! I'm connected to the script. But can I also figure out which file and which line the script is currently processing? Typing
where shows a stack trace:
(gdb) where
#0 0x55000402 in ?? ()
#1 0x00c75420 in __nanosleep_nocancel () from /lib/tls/libc.so.6
#2 0x00c7526f in sleep () from /lib/tls/libc.so.6
#3 0x080dacea in Perl_pp_sleep ()
#4 0x080a6044 in Perl_runops_standard ()
#5 0x0806103e in S_run_body ()
#6 0x08060e36 in perl_run ()
#7 0x0805e359 in main ()
Does anyone know enough about
perlguts to figure out from here where (file/line) the script is right now?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.