Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't fully understand your question but all of the options for 'b' in the perl debugger can be viewed with 'h b':</p> <pre><code>DB&lt;3&gt; h b b Sets breakpoint on current line) b [line] [condition] Set breakpoint; line defaults to the current execution line; condition breaks if it evaluates to true, defaults to '1'. b subname [condition] Set breakpoint at first line of subroutine. b $var Set breakpoint at first line of subroutine referenced by $var. b load filename Set breakpoint on 'require'ing the given file. b postpone subname [condition] Set breakpoint at first line of subroutine after it is compiled. b compile subname Stop after the subroutine is compiled. </code></pre> <p>There doesn't appear to be a 'one usage for all cases' pattern. In my experience you can:</p> <ul> <li>step through the debugger a few statements until the module(s) you are interested in are loaded</li> <li>'use' the module you want to set the break point in</li> </ul> <p>Once your module of interest is loaded you can use the 'b [subname]' pattern. Don't forget that you might need to fully qualify the sub name with the package name:</p> <pre><code> DB&lt;5&gt; use JSON; DB&lt;6&gt; b JSON::import DB&lt;7&gt; JSON-&gt;import JSON::import(/opt/xt/xt-perl/lib/site_perl/5.12.4/JSON.pm:78): 78: my $pkg = shift; auto(-1) DB&lt;&lt;8&gt;&gt; v 75 76 77 sub import { 78==&gt;b my $pkg = shift; 79: my @what_to_export; 80: my $no_export; 81 82: for my $tag (@_) { 83: if ($tag eq '-support_by_pp') { 84: if (!$_ALLOW_UNSUPPORTED++) { </code></pre> <p>You could also</p> <ul> <li>add "$DB::single=1;" in your source code (don't forget to remove it when your done though!)</li> </ul> <p>and just 'c' to continue through the debugger until you hot that line in your code. Having to add and remove special markers in your source goes against the general principle of debugging but is sometimes a useful way of stopping easily at somewhere difficult, or slow, to reach stepping through the debugger.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload