B-Debug-1.26/0000755000076500001200000000000013211060060011772 5ustar rurbanadminB-Debug-1.26/Artistic0000644000076500001200000001373712167565537013546 0ustar rurbanadmin The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End B-Debug-1.26/Changes0000644000076500001200000001776713211057546013326 0ustar rurbanadmin-*- change-log -*- 1.26 2017-12-03 rurban * Avoid too many -I when calling subprocess (sprout, RT#123816) 1.25 2017-07-26 rurban * add 5.27.1c support: B::class instead of class keyword. * add cperl OP->rettype, UNOP_AUX. * deprecate in core. 1.24 2016-12-11 rurban * add 5.25.6 support: split optimization 1.23 2015-01-25 rurban * again being hit by EUMM not being able to do parallel cpansign 1.22 2014-10-12 rurban * add 5.21.5 support: changed test, from blead for split optim., added METHOP * print 0x00000000 as 0x0 * add -d -MOd=Debug support * README: fixed copyright date 1.21 2014-08-05 rurban * add missing META.json to MANIFEST (RT#97722 by KENTNL) 1.20 2014-08-03 rurban * avoid exists on an array element (aaron crane) 1.19 2013-11-07 rurban * install into site (again) since 5.12 * support lexical subs, NAME instead of GV. * fix double SV FLAGS * fix wrong xpv_cur, add xpv_len 1.18 2012-08-17 rurban * support new B::PADLIST (experimentally on blead) 1.17 2011-11-25 rurban * FSF address change 1.16 2010-09-16 rurban * fix test 9 on Win32, shell quoting 1.15 2010-09-12 rurban * fix sv->GvFLAGS => gv->GvFLAGS * fixes for 5.8.0 (COP->io) and 5.6.1 (GV->SAFENAME) * fix $have_B_Flags_extra warning 1.14 2010-09-11 rurban * Remove qw(...) as parentheses deprecated warnings. (PERL#77758 by Paul Johnson) 1.13 2010-09-09 rurban * print name of op_type * print ppaddr consistent with other op addr * fix cop_io * omit cv->OUTSIDE_SEQ for 5.6 * fix NULL specials * fix NV assertion for CV * stabilize tests for space in runperl path * fix t/debug.t test 7 1.12 2010-02-10 rurban * remove archlib installation cruft, and use the proper PM rule. By Todd Rinaldo (toddr) 1.11 2008-07-14 rurban * avoid B::Flags in CORE tests not to crash on old XS in @INC 1.10 2008-06-28 rurban * require 5.006; Test::More not possible in 5.00505 * our => my 1.09 2008-06-18 rurban * minor META.yml syntax fix * 5.8.0 ending nextstate test failure: be more tolerant * PREREQ_PM Test::More 1.08 2008-06-17 rurban * support 5.00558 - 5.6.2 1.07 2008-06-16 rurban * debug.t: fix strawberry perl quoting issue 1.06 2008-06-15 rurban * added B::Flags output * dual-life CPAN as B-Debug-1.06 and CORE. Removed from B-C-1.04_20 * protect scalar(@array) if tied arrays leave out FETCHSIZE * special Makefile INST_ARCHLIB hack to install into ARCHLIB for the default perl @INC searchorder 1.05_03 2008-04-16 rurban * ithread fixes in B::AV * B-C-1.04_15 B-C-1.04_09 2008-02-24 rurban * support 5.8 (import Asmdata) 1.05_02 2008-02-21 rurban * added _printop * B-C-1.04_08 and CORE 1.05_01 2008-02-05 rurban * 5.10 fix for op->seq * B-C-1.04_04 =================================================================== Maybe Relevant Changes from CORE For the exact Changes see http://public.activestate.com/cgi-bin/perlbrowse/b/ext/B/B/Debug.pm http://public.activestate.com/cgi-bin/perlbrowse/b/ext/B/t/debug.t Gurusamy Sarathy 2000-12-17 22:49:13 Subject: [ID 20000928.002] perlcc & ByteCode.pm option mismatch Did not apply cleanly, manual intervention was needed. Subject: [ID 20001003.006] B::Debug not -w clean Test harness update to sync with the new perlcc, from Simon Cozens. Nick Ing-Simmons 1999-01-02 10:04:02 Integrate ext/B changes from //depot/cfgperl 'copy in' ext/B/B.xs (@2460..) 'merge in' ext/B/B/C.pm ext/B/B/CC.pm ext/B/B/Stackobj.pm (@2524..) Nick Ing-Simmons 1999-01-02 10:04:02 @2491 Integrate ext/B changes from //depot/cfgperl Nick Ing-Simmons 1998-12-20 14:21:29 Save _all_ GV's which have SV, AV or HV set. Gurusamy Sarathy 1998-07-22 02:08:00 fix up B modules for PL_* changes Malcolm Beattie 1998-07-21 18:13:16 Compiler docs for 5.005 Message-Id: <199807211713.SAA20735@sable.ox.ac.uk> Gurusamy Sarathy 1998-07-22 01:29:09 s/PL_sv/PL_bytecode_sv/ etc., so we have unique, case-insensitive names Gurusamy Sarathy 1998-07-21 07:12:00 fix bytecode.pl with moved var names Gurusamy Sarathy 1998-07-20 09:38:39 complete s/foo/PL_foo/ changes (all escaped cases identified with brute force search script). Result builds and passes all tests on Solaris. win32 and PERL_OBJECT are still untested. Nick Ing-Simmons 1998-07-18 13:53:03 PL_ prefix to all perlvars, part1 Builds and passes all tests at one limit i.e. -DPERL_GLOBAL_STRUCT Ilya Zakharevich 1998-07-15 06:10:36 Minor improvements to perlcc Message-Id: <199807151010.GAA11270@monk.mps.ohio-state.edu> Gurusamy Sarathy 1998-07-15 10:01:41 add stub docs for ext/B, other minor tweaks Gurusamy Sarathy 1998-07-09 05:37:48 get it building again on win32 Stephen McCamant 1998-06-22 21:19:43 Inheritance of B:: classes Message-Id: Ed Peschko 1998-04-29 21:02:36 [ PATCH 5.004_64 ] Integrated regression tests for compiler added perlcc.PL Charles Bailey 1998-03-02 01:48:27 Miscellaneous minor fixes Spider Boardman 1998-03-01 02:02:47 Almost OK: 5.004_61 (threads, perlio) Gurusamy Sarathy 1998-02-26 03:56:19 [win32] various cleanups so that B can be built as "just another extension" - export symbols needed for building B - bset_obj_store() is needed by byterun(), so define it there instead of at B.xs, and export it - freadpv() is only used in B.xs, so move it there - byte*.h are now included by perl.h - regenerate embed*.h Gurusamy Sarathy 1998-02-22 02:40:56 [win32] get compiler building under win32 (needed Makefile.PL hacks that could be applicable to other platforms) Malcolm Beattie 1998-02-25 17:44:34 More compiler tweaks. Malcolm Beattie 1998-02-20 18:23:47 Remove compiler files from their old lib/B locations. The compiler now builds by default (without the byteperl executable so far) and seems to work at least minimally. Malcolm Beattie 1998-02-20 18:05:33 Move lib/B/... and lib/[BO].pm over to where they should be, under ext/B. Malcolm Beattie 1998-02-20 17:54:58 Start getting compiler to work when built with the core. [Still won't work as of this change.] Malcolm Beattie 1998-02-20 16:42:13 * Merge perlext/Compiler/... into mainline. Some files move to ext/B/..., some to lib/B/..., O.pm and B.pm go in lib and some move to the base perl directory (e.g. headers). Will need some cleaning up before it builds properly, I would guess. Malcolm Beattie 1998-02-20 16:39:38 * [compiler] Win32 changes from Sarathy, tweaked slightly by me. Malcolm Beattie 1998-02-17 17:50:50 * Assorted changes to the compiler Malcolm Beattie 1997-12-17 10:59:40 * Fix typo in compiler B/C.pm. Alpha5 Malcolm Beattie 1997-12-10 18:33:53 * Start overhauling compiler. It was working at least minimally right up until the final tweak of B.xs to add threadsv_names at which point building it provokes a seg fault in perl while doing the xsubpp :-(. Malcolm Beattie 1997-09-03 12:31:48 * Make compiler build/work with devel 5.005 Malcolm Beattie 1997-07-05 11:58:05 * Change %lx to %x in B::CV::save to prevent some CV fields becoming 0 in the init section. Add missing write_back in B::Stackobj::Padsv::load_double to fix test 22 of op/my.t. a4 Malcolm Beattie 1997-05-03 14:47:06 * initial check in of compiler from version Alpha a3 to a4 B-Debug-1.26/Copying0000644000076500001200000003034512167565537013366 0ustar rurbanadmin GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! B-Debug-1.26/Debug.pm0000644000076500001200000002670013211057557013404 0ustar rurbanadminpackage B::Debug; our $VERSION = '1.26'; BEGIN { if ($] >= 5.027001) { require deprecate; import deprecate; } } use strict; require 5.006; use B qw(peekop walkoptree walkoptree_exec main_start main_root cstring sv_undef SVf_NOK SVf_IOK); use Config; my (@optype, @specialsv_name); require B; if ($] < 5.009) { require B::Asmdata; B::Asmdata->import (qw(@optype @specialsv_name)); } else { B->import (qw(@optype @specialsv_name)); } if ($] < 5.006002) { eval q|sub B::GV::SAFENAME { my $name = (shift())->NAME; # The regex below corresponds to the isCONTROLVAR macro from toke.c $name =~ s/^([\cA-\cZ\c\\c[\c]\c?\c_\c^])/"^".chr(64 ^ ord($1))/e; return $name; }|; } my ($have_B_Flags, $have_B_Flags_extra); if (!$ENV{PERL_CORE}){ # avoid CORE test crashes eval { require B::Flags and $have_B_Flags++ }; $have_B_Flags_extra++ if $have_B_Flags and $B::Flags::VERSION gt '0.03'; } my %done_gv; sub _printop { my $op = shift; my $addr = ${$op} ? $op->ppaddr : ''; $addr =~ s/^PL_ppaddr// if $addr; if (${$op}) { return sprintf "0x%08x %6s %s", ${$op}, B::class($op), $addr; } else { return sprintf "0x%x %6s %s", ${$op}, '', $addr; } } sub B::OP::debug { my ($op) = @_; printf <<'EOT', B::class($op), $$op, _printop($op), _printop($op->next), _printop($op->sibling), $op->targ, $op->type, $op->name; %s (0x%lx) op_ppaddr %s op_next %s op_sibling %s op_targ %d op_type %d %s EOT if ($] > 5.009) { printf <<'EOT', $op->opt; op_opt %d EOT } else { printf <<'EOT', $op->seq; op_seq %d EOT } if ($have_B_Flags) { printf <<'EOT', $op->flags, $op->flagspv, $op->private, $op->privatepv; op_flags %u %s op_private %u %s EOT } else { printf <<'EOT', $op->flags, $op->private; op_flags %u op_private %u EOT } if ($op->can('rettype')) { printf <<'EOT', $op->rettype; op_rettype %u EOT } } sub B::UNOP::debug { my ($op) = @_; $op->B::OP::debug(); printf "\top_first\t%s\n", _printop($op->first); } sub B::BINOP::debug { my ($op) = @_; $op->B::UNOP::debug(); printf "\top_last \t%s\n", _printop($op->last); } sub B::LOOP::debug { my ($op) = @_; $op->B::BINOP::debug(); printf <<'EOT', _printop($op->redoop), _printop($op->nextop), _printop($op->lastop); op_redoop %s op_nextop %s op_lastop %s EOT } sub B::LOGOP::debug { my ($op) = @_; $op->B::UNOP::debug(); printf "\top_other\t%s\n", _printop($op->other); } sub B::LISTOP::debug { my ($op) = @_; $op->B::BINOP::debug(); printf "\top_children\t%d\n", $op->children; } sub B::PMOP::debug { my ($op) = @_; $op->B::LISTOP::debug(); printf "\top_pmreplroot\t0x%x\n", $] < 5.008 ? ${$op->pmreplroot} : $op->pmreplroot; printf "\top_pmreplstart\t0x%x\n", ${$op->pmreplstart}; printf "\top_pmnext\t0x%x\n", ${$op->pmnext} if $] < 5.009005; if ($Config{'useithreads'}) { printf "\top_pmstashpv\t%s\n", cstring($op->pmstashpv); printf "\top_pmoffset\t%d\n", $op->pmoffset; } else { printf "\top_pmstash\t%s\n", cstring($op->pmstash); } printf "\top_precomp\t%s\n", cstring($op->precomp); printf "\top_pmflags\t0x%x\n", $op->pmflags; printf "\top_reflags\t0x%x\n", $op->reflags if $] >= 5.009; printf "\top_pmpermflags\t0x%x\n", $op->pmpermflags if $] < 5.009; printf "\top_pmdynflags\t0x%x\n", $op->pmdynflags if $] < 5.009; $op->pmreplroot->debug if $] < 5.008; } sub B::COP::debug { my ($op) = @_; $op->B::OP::debug(); my $warnings = ref $op->warnings ? ${$op->warnings} : 0; printf <<'EOT', $op->label, $op->stashpv, $op->file, $op->cop_seq, $op->arybase, $op->line, $warnings; cop_label "%s" cop_stashpv "%s" cop_file "%s" cop_seq %d cop_arybase %d cop_line %d cop_warnings 0x%x EOT if ($] > 5.008 and $] < 5.011) { my $cop_io = B::class($op->io) eq 'SPECIAL' ? '' : $op->io->as_string; printf(" cop_io %s\n", cstring($cop_io)); } } sub B::SVOP::debug { my ($op) = @_; $op->B::OP::debug(); printf "\top_sv\t\t0x%x\n", ${$op->sv}; $op->sv->debug; } sub B::METHOP::debug { my ($op) = @_; $op->B::OP::debug(); if (${$op->first}) { printf "\top_first\t0x%x\n", ${$op->first}; $op->first->debug; } else { printf "\top_meth_sv\t0x%x\n", ${$op->meth_sv}; $op->meth_sv->debug; } } sub B::UNOP_AUX::debug { my ($op) = @_; $op->B::OP::debug(); # string and perl5 aux_list needs the cv # cperl has aux, Concise,-debug leaves it empty if ($op->can('aux')) { printf "\top_aux\t%s\n", cstring($op->aux); } } sub B::PVOP::debug { my ($op) = @_; $op->B::OP::debug(); printf "\top_pv\t\t%s\n", cstring($op->pv); } sub B::PADOP::debug { my ($op) = @_; $op->B::OP::debug(); printf "\top_padix\t%ld\n", $op->padix; } sub B::NULL::debug { my ($sv) = @_; if ($$sv == ${sv_undef()}) { print "&sv_undef\n"; } else { printf "NULL (0x%x)\n", $$sv; } } sub B::SV::debug { my ($sv) = @_; if (!$$sv) { print B::class($sv), " = NULL\n"; return; } printf <<'EOT', B::class($sv), $$sv, $sv->REFCNT; %s (0x%x) REFCNT %d EOT printf "\tFLAGS\t\t0x%x", $sv->FLAGS; if ($have_B_Flags) { printf "\t%s", $have_B_Flags_extra ? $sv->flagspv(0) : $sv->flagspv; } print "\n"; } sub B::RV::debug { my ($rv) = @_; B::SV::debug($rv); printf <<'EOT', ${$rv->RV}; RV 0x%x EOT $rv->RV->debug; } sub B::PV::debug { my ($sv) = @_; $sv->B::SV::debug(); my $pv = $sv->PV(); printf <<'EOT', cstring($pv), $sv->CUR, $sv->LEN; xpv_pv %s xpv_cur %d xpv_len %d EOT } sub B::IV::debug { my ($sv) = @_; $sv->B::SV::debug(); printf "\txiv_iv\t\t%d\n", $sv->IV if $sv->FLAGS & SVf_IOK; } sub B::NV::debug { my ($sv) = @_; $sv->B::IV::debug(); printf "\txnv_nv\t\t%s\n", $sv->NV if $sv->FLAGS & SVf_NOK; } sub B::PVIV::debug { my ($sv) = @_; $sv->B::PV::debug(); printf "\txiv_iv\t\t%d\n", $sv->IV if $sv->FLAGS & SVf_IOK; } sub B::PVNV::debug { my ($sv) = @_; $sv->B::PVIV::debug(); printf "\txnv_nv\t\t%s\n", $sv->NV if $sv->FLAGS & SVf_NOK; } sub B::PVLV::debug { my ($sv) = @_; $sv->B::PVNV::debug(); printf "\txlv_targoff\t%d\n", $sv->TARGOFF; printf "\txlv_targlen\t%u\n", $sv->TARGLEN; printf "\txlv_type\t%s\n", cstring(chr($sv->TYPE)); } sub B::BM::debug { my ($sv) = @_; $sv->B::PVNV::debug(); printf "\txbm_useful\t%d\n", $sv->USEFUL; printf "\txbm_previous\t%u\n", $sv->PREVIOUS; printf "\txbm_rare\t%s\n", cstring(chr($sv->RARE)); } sub B::CV::debug { my ($cv) = @_; $cv->B::PVNV::debug(); my $stash = $cv->STASH; my $start = $cv->START; my $root = $cv->ROOT; my $padlist = $cv->PADLIST; my $file = $cv->FILE; my $gv; printf <<'EOT', $$stash, $$start, $$root; STASH 0x%x START 0x%x ROOT 0x%x EOT if ($cv->can('NAME_HEK') && $cv->NAME_HEK) { printf("\tNAME\t%%s\n", $cv->NAME_HEK); } elsif ( $]>5.017 && ($cv->FLAGS & 0x40000)) { #lexsub printf("\tNAME\t%%s\n", $cv->NAME_HEK); } else { $gv = $cv->GV; printf("\tGV\t%0x%x\t%s\n", $$gv, $gv->SAFENAME); } printf <<'EOT', $file, $cv->DEPTH, $padlist, ${$cv->OUTSIDE}; FILE %s DEPTH %d PADLIST 0x%x OUTSIDE 0x%x EOT printf("\tOUTSIDE_SEQ\t%d\n", $cv->OUTSIDE_SEQ) if $] > 5.007; if ($have_B_Flags) { my $SVt_PVCV = $] < 5.010 ? 12 : 13; printf("\tCvFLAGS\t0x%x\t%s\n", $cv->CvFLAGS, $have_B_Flags_extra ? $cv->flagspv($SVt_PVCV) : $cv->flagspv); } else { printf("\tCvFLAGS\t0x%x\n", $cv->CvFLAGS); } printf("\tSIGOP\t0x%x\n", $cv->SIGOP) if $cv->can('SIGOP'); $start->debug if $start; $root->debug if $root; $gv->debug if $gv; $padlist->debug if $padlist; } sub B::AV::debug { my ($av) = @_; $av->B::SV::debug; _array_debug($av); } sub _array_debug { my ($av) = @_; # tied arrays may leave out FETCHSIZE my (@array) = eval { $av->ARRAY; }; print "\tARRAY\t\t(", join(", ", map("0x" . $$_, @array)), ")\n"; my $fill = eval { scalar(@array) }; if ($Config{'useithreads'} && B::class($av) ne 'PADLIST') { printf <<'EOT', $fill, $av->MAX, $av->OFF; FILL %d MAX %d OFF %d EOT } else { printf <<'EOT', $fill, $av->MAX; FILL %d MAX %d EOT } if ($] < 5.009) { if ($have_B_Flags) { printf("\tAvFLAGS\t0x%x\t%s\n", $av->AvFLAGS, $have_B_Flags_extra ? $av->flagspv(10) : $av->flagspv); } else { printf("\tAvFLAGS\t0x%x\n", $av->AvFLAGS); } } } sub B::GV::debug { my ($gv) = @_; if ($done_gv{$$gv}++) { printf "GV %s::%s\n", $gv->STASH->NAME, $gv->SAFENAME; return; } my $sv = $gv->SV; my $av = $gv->AV; my $cv = $gv->CV; $gv->B::SV::debug; printf <<'EOT', $gv->SAFENAME, $gv->STASH->NAME, $gv->STASH, $$sv, $gv->GvREFCNT, $gv->FORM, $$av, ${$gv->HV}, ${$gv->EGV}, $$cv, $gv->CVGEN, $gv->LINE, $gv->FILE, $gv->GvFLAGS; NAME %s STASH %s (0x%x) SV 0x%x GvREFCNT %d FORM 0x%x AV 0x%x HV 0x%x EGV 0x%x CV 0x%x CVGEN %d LINE %d FILE %s EOT if ($have_B_Flags) { my $SVt_PVGV = $] < 5.010 ? 13 : 9; printf("\tGvFLAGS\t0x%x\t%s\n", $gv->GvFLAGS, $have_B_Flags_extra ? $gv->flagspv($SVt_PVGV) : $gv->flagspv); } else { printf("\tGvFLAGS\t0x%x\n", $gv->GvFLAGS); } $sv->debug if $sv; $av->debug if $av; $cv->debug if $cv; } sub B::SPECIAL::debug { my $sv = shift; my $i = ref $sv ? $$sv : 0; print defined $specialsv_name[$i] ? $specialsv_name[$i] : "", "\n"; } sub B::PADLIST::debug { my ($padlist) = @_; printf <<'EOT', B::class($padlist), $$padlist, $padlist->REFCNT; %s (0x%x) REFCNT %d EOT _array_debug($padlist); } sub compile { my $order = shift; B::clearsym(); $DB::single = 1 if defined &DB::DB; if ($order && $order eq "exec") { return sub { walkoptree_exec(main_start, "debug") } } else { return sub { walkoptree(main_root, "debug") } } } 1; __END__ =head1 NAME B::Debug - Walk Perl syntax tree, printing debug info about ops =head1 SYNOPSIS perl -MO=Debug foo.pl perl -MO=Debug,-exec foo.pl =head1 DESCRIPTION See F and the newer L. =head1 OPTIONS With option -exec, walks tree in execute order, otherwise in basic order. =head1 AUTHOR Malcolm Beattie, C Reini Urban C =head1 LICENSE Copyright (c) 1996, 1997 Malcolm Beattie Copyright (c) 2008, 2010, 2013, 2014 Reini Urban This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" which comes with this kit. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this kit, in the file named "Artistic". If not, you can get one from the Perl distribution. You should also have received a copy of the GNU General Public License, in the file named "Copying". If not, you can get one from the Perl distribution or else write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. =cut B-Debug-1.26/Makefile.PL0000755000076500001200000000261113136040537013764 0ustar rurbanadminuse ExtUtils::MakeMaker; require 5.006; WriteMakefile ( NAME => "B::Debug", VERSION_FROM => "Debug.pm", PREREQ_PM => {'B' => 0, 'Test::More' => 0, ($] >= 5.0217003 ? ('deprecate' => 0.03) : ()), }, ($] >= 5.005 ? ('AUTHOR' => 'Malcolm Beattie , Reini Urban ', 'ABSTRACT' => 'print debug info about ops') : ()), ($ExtUtils::MakeMaker::VERSION gt '6.30' ? ('LICENSE' => 'perl') : ()), (($ExtUtils::MakeMaker::VERSION gt '6.31' and $ExtUtils::MakeMaker::VERSION lt '6.46') ? ('EXTRA_META' => "recommends:\n" . " B::Flags: 0.04\n" ) : ()), ($ExtUtils::MakeMaker::VERSION gt '6.46' ? ('META_MERGE' => {"recommends" => { "B::Flags" => "0.04"}} ) : ()), # Part of core perl since 5.005005, but core wants it to be in site since 5.12 'INSTALLDIRS' => ( $] > 5.005005 && $] < 5.011 ? "perl" : "site" ), # install into ARCHLIB ($] < 5.011) ? (PM => { 'Debug.pm' => '$(INST_ARCHLIB)/B/Debug.pm', }) : (), SIGN => 1, ); package MY; sub depend { " README : \$(VERSION_FROM) pod2text \$(VERSION_FROM) > README release : dist echo git commit -a -m\"release \$(VERSION)\" git tag \$(VERSION) cpan-upload \$(DISTVNAME).tar\$(SUFFIX) git push git push --tags " } B-Debug-1.26/MANIFEST0000644000076500001200000000026613211060060013127 0ustar rurbanadminArtistic Changes Copying Debug.pm MANIFEST META.json META.yml Makefile.PL README t/debug.t t/pod.t SIGNATURE Public-key signature (added by MakeMaker) B-Debug-1.26/META.json0000644000076500001200000000206713211060060013420 0ustar rurbanadmin{ "abstract" : "print debug info about ops", "author" : [ "Malcolm Beattie , Reini Urban " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 8.3004, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "B-Debug", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "recommends" : { "B::Flags" : "0.04" }, "requires" : { "B" : "0", "Test::More" : "0", "deprecate" : "0.03" } } }, "release_status" : "stable", "version" : "1.26", "x_serialization_backend" : "JSON::PP version 2.94_01" } B-Debug-1.26/META.yml0000644000076500001200000000117313211060057013253 0ustar rurbanadmin--- abstract: 'print debug info about ops' author: - 'Malcolm Beattie , Reini Urban ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 8.3004, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: B-Debug no_index: directory: - t - inc recommends: B::Flags: '0.04' requires: B: '0' Test::More: '0' deprecate: '0.03' version: '1.26' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' B-Debug-1.26/README0000644000076500001200000000311713211057724012671 0ustar rurbanadminNAME B::Debug - Walk Perl syntax tree, printing debug info about ops SYNOPSIS perl -MO=Debug foo.pl perl -MO=Debug,-exec foo.pl DESCRIPTION See ext/B/README and the newer B::Concise. OPTIONS With option -exec, walks tree in execute order, otherwise in basic order. AUTHOR Malcolm Beattie, "retired" Reini Urban "rurban@cpan.org" LICENSE Copyright (c) 1996, 1997 Malcolm Beattie Copyright (c) 2008, 2010, 2013, 2014 Reini Urban This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" which comes with this kit. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this kit, in the file named "Artistic". If not, you can get one from the Perl distribution. You should also have received a copy of the GNU General Public License, in the file named "Copying". If not, you can get one from the Perl distribution or else write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. B-Debug-1.26/SIGNATURE0000644000076500001200000000246613211060060013266 0ustar rurbanadminThis file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.81. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 be0627fff2e8aef3d2a14d5d7486babc8a4873ba Artistic SHA1 6b2ed320026380467ada819f843f9c0e416d0951 Changes SHA1 1fa102688dd2d79dbf4cf269aabd2e5482ab7734 Copying SHA1 304fbfe12add101f6345f449369e209b8bc47a7e Debug.pm SHA1 2fbba8e743be0849676ceeea62da6321598a25d7 MANIFEST SHA1 3497cd1a0bb9242f82b28fc1883a1df250f0e010 META.json SHA1 428da3e05becd60727c48c56ff1158bb85636aa2 META.yml SHA1 4293af202a8cb4b654da9b8506f38efb233e821b Makefile.PL SHA1 ecc2422a68b10ab675b419c3a50b92379e608594 README SHA1 8e2d294b566239f41c3c08405529266e2f7de1ae t/debug.t SHA1 8e6c77dd1d7e2bb99d62e199e1b19b6090e405f5 t/pod.t -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQRZHhhUcL58V8z0UW2abZJij/3JQgUCWiRgMAAKCRCabZJij/3J QiMPAKCCg2g3QKHG9iIWX+4T+E7gYR2yoACfXS3xZgFqJNNkGSuDydub61oABxI= =Ouwt -----END PGP SIGNATURE----- B-Debug-1.26/t/0000755000076500001200000000000013211060057012243 5ustar rurbanadminB-Debug-1.26/t/debug.t0000644000076500001200000000600113211057233013515 0ustar rurbanadmin#!./perl BEGIN { delete $ENV{PERL_DL_NONLAZY} if $] < 5.005_58; #Perl_byterun problem if ($ENV{PERL_CORE}){ chdir('t') if -d 't'; if ($^O eq 'MacOS') { @INC = qw(: ::lib ::macos:lib); } else { @INC = '.'; push @INC, '../lib'; } } else { unshift @INC, 't'; } require Config; if (($Config::Config{'extensions'} !~ /\bB\b/) ){ print "1..0 # Skip -- Perl configured without B module\n"; exit 0; } } $| = 1; use warnings; use strict; use Config; use Test::More tests => 11; use B; use B::Debug; use File::Spec; my $a; my $X = $^X =~ m/\s/ ? qq{"$^X"} : $^X; local $ENV{PERL5LIB} = join $Config{path_sep}, File::Spec->catfile("blib","lib"), @INC; my $redir = $^O =~ /VMS|MSWin32|MacOS/ ? "" : "2>&1"; $a = `$X "-MO=Debug" -e 1 $redir`; like($a, qr/\bLISTOP\b.*\bOP\b.*\bCOP\b.*\bOP\b/s); $a = `$X "-MO=Terse" -e 1 $redir`; like($a, qr/\bLISTOP\b.*leave.*\n OP\b.*enter.*\n COP\b.*nextstate.*\n OP\b.*null/s); $a = `$X "-MO=Terse" -ane "s/foo/bar/" $redir`; $a =~ s/\(0x[^)]+\)//g; $a =~ s/\[[^\]]+\]//g; $a =~ s/-e syntax OK//; $a =~ s/[^a-z ]+//g; $a =~ s/\s+/ /g; $a =~ s/\b(s|foo|bar|ullsv)\b\s?//g; $a =~ s/^\s+//; $a =~ s/\s+$//; $a =~ s/\s+nextstate$//; # if $] < 5.008001; # 5.8.0 adds it. 5.8.8 not anymore my $is_thread = $Config{use5005threads} && $Config{use5005threads} eq 'define'; if ($is_thread) { $b=<= 5.021005) { $b=<= 5.025006; is($a, $b); like(B::Debug::_printop(B::main_root), qr/LISTOP\s+\[OP_LEAVE\]/); like(B::Debug::_printop(B::main_start), qr/OP\s+\[OP_ENTER\]/); $a = `$X "-MO=Debug" -e "B::main_root->debug" $redir`; like($a, qr/op_next\s+0x0/m); $a = `$X "-MO=Debug" -e "B::main_start->debug" $redir`; like($a, qr/\[OP_ENTER\]/m); # pass missing FETCHSIZE, fixed with 1.06 my $e = q(BEGIN{tie @a, __PACKAGE__;sub TIEARRAY {bless{}} sub FETCH{1}};print $a[1]); $a = `$X "-MO=Debug" -e"$e" $redir`; unlike($a, qr/locate object method "FETCHSIZE"/m); # NV assertion with CV, fixed with 1.13 my $tmp = "tmp.pl"; open TMP, ">", $tmp; print TMP 'my $p=1;$g=2;sub p($){my $i=1;$i+1};print p(0)+$g;'; close TMP; $a = `$X "-MO=Debug" $tmp $redir`; ok(! $?); unlike($a, qr/assertion "SvTYPE(sv) != SVt_PVCV" failed.*function: S_sv_2iuv_common/m); unlike($a, qr/Use of uninitialized value in print/m); END { unlink $tmp if $tmp; } B-Debug-1.26/t/pod.t0000644000076500001200000000022512167565537013237 0ustar rurbanadmin# -*- perl -*- use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok();