NAME

Devel::SubBreaker - set breakpoints in many arbitrary subroutines simultaneously

VERSION

0.03

SYNOPSIS

$ perl -d:SubBreaker=sub1,sub2,Module3,regexp4 script_to_debug.pl

DESCRPITION

Devel::SubBreaker seeks to simplify the process of settings breakpoints in a collection of subroutines from a distribution, a single module, or just any subroutine name that matches an arbitrary pattern. It does not require the debugger user to enumerate the subroutines to be stepped through, so it is useful for unfamiliar distributions or distributions under development where subroutine names may be in flux.

This module was inspired by a StackOverflow question.

USAGE

To use this module, pass this command-line argument to perl

-d:SubBreaker=pattern[,pattern2[,...]]

where pattern, pattern2, etc. are any valid perl regular expressions. In the CHECK phase of the program, a breakpoint will be set at the start of any subroutine whose fully qualified subroutine name (given by %DB::sub) matches one of the given regular expressions. This includes anonymous subroutines that are known at compile time.

EXAMPLES

  • Set a breakpoint in all subs in module Floop::Blert and all Floop::Blert submodules:

    perl -d:SubBreaker=^Floop::Blert ...
  • Set a breakpoint in all subs just in module Floop::Blert:

    perl -d:SubBreaker=^Floop::Blert::\\w+$ ...
  • Set a breakpoint in every known subroutine:

    perl -d:SubBreaker=^ ...
  • Set a breakpoint in all anonymous subroutines

    perl -d:SubBreaker=__ANON__ ...

SUPPORT

This module is part of the Devel::ModuleBreaker distribution. See Devel::ModuleBreaker for support information about this module.

SEE ALSO

Devel::ModuleBreaker, Devel::FileBreaker

AUTHOR

Marty O'Brien, <mob at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2018 Marty O'Brien

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.