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?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|