r18085 - in /trunk/libdevel-backtrace-perl: Build.PL Changes LICENSE MANIFEST META.yml Makefile.PL README debian/changelog examples/basic.pl examples/dollarat.pl examples/skipme.pl lib/Devel/Backtrace.pm lib/Devel/Backtrace/Point.pm lib/Devel/DollarAt.pm

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Fri Mar 28 20:03:14 UTC 2008


Author: gregoa-guest
Date: Fri Mar 28 20:03:13 2008
New Revision: 18085

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=18085
Log:
New upstream release.

Added:
    trunk/libdevel-backtrace-perl/examples/dollarat.pl
      - copied unchanged from r18084, branches/upstream/libdevel-backtrace-perl/current/examples/dollarat.pl
    trunk/libdevel-backtrace-perl/lib/Devel/DollarAt.pm
      - copied unchanged from r18084, branches/upstream/libdevel-backtrace-perl/current/lib/Devel/DollarAt.pm
Modified:
    trunk/libdevel-backtrace-perl/Build.PL
    trunk/libdevel-backtrace-perl/Changes
    trunk/libdevel-backtrace-perl/LICENSE
    trunk/libdevel-backtrace-perl/MANIFEST
    trunk/libdevel-backtrace-perl/META.yml
    trunk/libdevel-backtrace-perl/Makefile.PL
    trunk/libdevel-backtrace-perl/README
    trunk/libdevel-backtrace-perl/debian/changelog
    trunk/libdevel-backtrace-perl/examples/basic.pl
    trunk/libdevel-backtrace-perl/examples/skipme.pl
    trunk/libdevel-backtrace-perl/lib/Devel/Backtrace.pm
    trunk/libdevel-backtrace-perl/lib/Devel/Backtrace/Point.pm

Modified: trunk/libdevel-backtrace-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/Build.PL?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/Build.PL (original)
+++ trunk/libdevel-backtrace-perl/Build.PL Fri Mar 28 20:03:13 2008
@@ -12,6 +12,7 @@
     requires            => {
         'String::Escape'  => 0,
         'Class::Accessor' => 0,
+        'Carp'            => 0,
     },
     build_requires => {
         'Test::More' => 0,

Modified: trunk/libdevel-backtrace-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/Changes?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/Changes (original)
+++ trunk/libdevel-backtrace-perl/Changes Fri Mar 28 20:03:13 2008
@@ -16,3 +16,12 @@
 
 0.05    May 20 19:59:28 CEST 2007
         Make the tests work with perl 5.9
+
+0.06    Mar 27 15:17:04 CET 2008
+        Change the license to public domain.
+        Added Devel::DollarAt.
+        Added skipmysubs to Devel::Backtrace and called_package to
+        Devel::Backtrace::Point.
+
+0.07    Thu Mar 27 16:14:03 CET 2008
+        Some minor changes (nothing in the code).

Modified: trunk/libdevel-backtrace-perl/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/LICENSE?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/LICENSE (original)
+++ trunk/libdevel-backtrace-perl/LICENSE Fri Mar 28 20:03:13 2008
@@ -1,4 +1,3 @@
-Copyright (C) 2007 Christoph Bussenius.
+The Perl module distribution Devel::Backtrace is in the public domain.
 
-This program is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
+The author is Christoph Bussenius.

Modified: trunk/libdevel-backtrace-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/MANIFEST?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/MANIFEST (original)
+++ trunk/libdevel-backtrace-perl/MANIFEST Fri Mar 28 20:03:13 2008
@@ -1,10 +1,12 @@
 Build.PL
 Changes
 examples/basic.pl
+examples/dollarat.pl
 examples/skipme.pl
 INSTALL
 lib/Devel/Backtrace.pm
 lib/Devel/Backtrace/Point.pm
+lib/Devel/DollarAt.pm
 LICENSE
 Makefile.PL
 MANIFEST			This list of files

Modified: trunk/libdevel-backtrace-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/META.yml?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/META.yml (original)
+++ trunk/libdevel-backtrace-perl/META.yml Fri Mar 28 20:03:13 2008
@@ -1,6 +1,6 @@
 ---
 name: Devel-Backtrace
-version: 0.05
+version: 0.07
 author:
   - 'Christoph Bussenius <pepe at cpan.org>'
 abstract: Object-oriented backtrace
@@ -8,6 +8,7 @@
 resources:
   license: http://dev.perl.org/licenses/
 requires:
+  Carp: 0
   Class::Accessor: 0
   String::Escape: 0
 build_requires:
@@ -15,9 +16,12 @@
 provides:
   Devel::Backtrace:
     file: lib/Devel/Backtrace.pm
-    version: 0.05
+    version: 0.07
   Devel::Backtrace::Point:
     file: lib/Devel/Backtrace/Point.pm
+  Devel::DollarAt:
+    file: lib/Devel/DollarAt.pm
+    version: 0.02
 generated_by: Module::Build version 0.2807
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

Modified: trunk/libdevel-backtrace-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/Makefile.PL?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/Makefile.PL (original)
+++ trunk/libdevel-backtrace-perl/Makefile.PL Fri Mar 28 20:03:13 2008
@@ -10,7 +10,8 @@
           'PREREQ_PM' => {
                            'Test::More' => 0,
                            'String::Escape' => 0,
-                           'Class::Accessor' => 0
+                           'Class::Accessor' => 0,
+                           'Carp' => 0
                          }
         )
 ;

Modified: trunk/libdevel-backtrace-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/README?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/README (original)
+++ trunk/libdevel-backtrace-perl/README Fri Mar 28 20:03:13 2008
@@ -2,7 +2,7 @@
     Devel::Backtrace - Object-oriented backtrace
 
 VERSION
-    This is version 0.05.
+    This is version 0.07.
 
 SYNOPSIS
         my $backtrace = Devel::Backtrace->new;
@@ -47,6 +47,17 @@
     This module ships with an example "skipme.pl" that demonstrates how to
     use this method.
 
+  $backtrace->skipmysubs([$package])
+    This method is like "skipme" except that it deletes calls *to* the
+    package rather than calls *from* the package. Usually this means that it
+    deletes exactly one more tracepoint than "skipme".
+
+    Before discarding those calls, "skipme" is called. This is because
+    usually the topmost call in the stack is to Devel::Backtrace->new, which
+    would not be catched by "skipmysubs" otherwise.
+
+    See also the example "skipme.pl".
+
   $backtrace->to_string()
     Returns a string that contains one line for each tracepoint. It will
     contain the information from "Devel::Backtrace::Point"'s to_string()
@@ -78,12 +89,17 @@
     Carp::Trace is a simpler module which gives you a backtrace in string
     form.
 
+    Devel::DollarAt comes with this distribution and is a nice application
+    of this module. You can use it for debugging to get a backtrace out of
+    $@.
+
 AUTHOR
     Christoph Bussenius <pepe at cpan.org>
 
+    If you use this module, I'll be glad if you drop me a note. You should
+    mention this module's name in the subject of your mails, in order to
+    make sure they won't get lost in all the spam.
+
 COPYRIGHT
-    Copyright (C) 2007 Christoph Bussenius.
+    This module is in the public domain.
 
-    This program is free software; you can redistribute it and/or modify it
-    under the same terms as Perl itself.
-

Modified: trunk/libdevel-backtrace-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/debian/changelog?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/debian/changelog (original)
+++ trunk/libdevel-backtrace-perl/debian/changelog Fri Mar 28 20:03:13 2008
@@ -1,8 +1,12 @@
-libdevel-backtrace-perl (0.05-2) UNRELEASED; urgency=low
+libdevel-backtrace-perl (0.07-1) UNRELEASED; urgency=low
 
+  [ Roberto C. Sanchez ]
   * Added watch file.
 
- -- Roberto C. Sanchez <roberto at connexer.com>  Wed, 19 Mar 2008 00:33:14 -0400
+  [ gregor herrmann ]
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Fri, 28 Mar 2008 21:01:35 +0100
 
 libdevel-backtrace-perl (0.05-1) unstable; urgency=low
 

Modified: trunk/libdevel-backtrace-perl/examples/basic.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/examples/basic.pl?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/examples/basic.pl (original)
+++ trunk/libdevel-backtrace-perl/examples/basic.pl Fri Mar 28 20:03:13 2008
@@ -24,6 +24,9 @@
 
     print "The line number from the second line of the first backtrace:\n";
     print $backtrace1->point(1)->line, "\n";
+
+    print "The called package from the first line of the first backtrace:\n";
+    print $backtrace1->point(0)->called_package, "\n";
 }
 
 
@@ -36,20 +39,20 @@
 First backtrace:
 Devel::Backtrace::new called from main (basic.pl:12)
 main::bar called from main (basic.pl:8)
-main::foo called from main (basic.pl:30)
+main::foo called from main (basic.pl:33)
 
 Second (shorter) backtrace:
 main::bar called from main (basic.pl:8)
-main::foo called from main (basic.pl:30)
+main::foo called from main (basic.pl:33)
 
 Third (even shorter) backtrace:
-main::foo called from main (basic.pl:30)
+main::foo called from main (basic.pl:33)
 
 The third backtrace in a very long form:
 (Note that the bitmask may depend on the perl version.)
 package: main
 filename: basic.pl
-line: 30
+line: 33
 subroutine: main::foo
 hasargs: 1
 wantarray: undef
@@ -60,3 +63,6 @@
 
 The line number from the second line of the first backtrace:
 8
+
+The called package from the first line of the first backtrace:
+Devel::Backtrace

Modified: trunk/libdevel-backtrace-perl/examples/skipme.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/examples/skipme.pl?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/examples/skipme.pl (original)
+++ trunk/libdevel-backtrace-perl/examples/skipme.pl Fri Mar 28 20:03:13 2008
@@ -49,7 +49,17 @@
         # calls which Baz method.
         $backtrace->skipme;
 
+        print "skipme result:\n";
         print $backtrace;
+
+        my $backtrace2 = Devel::Backtrace->new;
+
+        # Tell Devel::Backtrace that we are not even interested where the first
+        # Baz method was called.
+        $backtrace2->skipmysubs;
+
+        print "\nskipmycalls result:\n";
+        print $backtrace2;
     }
 }
 
@@ -57,8 +67,15 @@
 
 Output:
 
+skipme result:
 Baz::baz1 called from Bar (skipme.pl:30)
 Bar::bar2 called from Bar (skipme.pl:26)
 Bar::bar1 called from Foo (skipme.pl:18)
 Foo::foo2 called from Foo (skipme.pl:14)
 Foo::foo1 called from main (skipme.pl:8)
+
+skipmycalls result:
+Bar::bar2 called from Bar (skipme.pl:26)
+Bar::bar1 called from Foo (skipme.pl:18)
+Foo::foo2 called from Foo (skipme.pl:14)
+Foo::foo1 called from main (skipme.pl:8)

Modified: trunk/libdevel-backtrace-perl/lib/Devel/Backtrace.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/lib/Devel/Backtrace.pm?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/lib/Devel/Backtrace.pm (original)
+++ trunk/libdevel-backtrace-perl/lib/Devel/Backtrace.pm Fri Mar 28 20:03:13 2008
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-This is version 0.05.
-
-=cut
-
-our $VERSION = '0.05';
+This is version 0.07.
+
+=cut
+
+our $VERSION = '0.07';
 
 =head1 SYNOPSIS
 
@@ -105,7 +105,34 @@
     my $package = @_ ? $_[0] : caller;
 
     my $skip;
-    $skip = shift @$this while @$this and $package eq $this->point(0)->package;
+    while (@$this and $package eq $this->point(0)->package) {
+        $skip = shift @$this;
+    }
+    return $skip;
+}
+
+=head2 $backtrace->skipmysubs([$package])
+
+This method is like C<skipme> except that it deletes calls I<to> the package
+rather than calls I<from> the package.  Usually this means that it deletes
+exactly one more tracepoint than C<skipme>.
+
+Before discarding those calls, C<skipme> is called.  This is because usually
+the topmost call in the stack is to Devel::Backtrace->new, which would not be
+catched by C<skipmysubs> otherwise.
+
+See also the example "skipme.pl".
+
+=cut
+
+sub skipmysubs {
+    my $this = shift;
+    my $package = @_ ? $_[0] : caller;
+
+    my $skip = $this->skipme($package);
+    while (@$this and $package eq $this->point(0)->called_package) {
+        $skip = shift @$this;
+    }
     return $skip;
 }
 
@@ -162,15 +189,19 @@
 
 L<Carp::Trace> is a simpler module which gives you a backtrace in string form.
 
+L<Devel::DollarAt> comes with this distribution and is a nice application of
+this module.  You can use it for debugging to get a backtrace out of $@.
+
 =head1 AUTHOR
 
 Christoph Bussenius <pepe at cpan.org>
 
+If you use this module, I'll be glad if you drop me a note.
+You should mention this module's name in the subject of your mails, in order to
+make sure they won't get lost in all the spam.
+
 =head1 COPYRIGHT
 
-Copyright (C) 2007 Christoph Bussenius.
-
-This program is free software; you can redistribute it and/or modify it under
-the same terms as Perl itself.
-
-=cut
+This module is in the public domain.
+
+=cut

Modified: trunk/libdevel-backtrace-perl/lib/Devel/Backtrace/Point.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdevel-backtrace-perl/lib/Devel/Backtrace/Point.pm?rev=18085&op=diff
==============================================================================
--- trunk/libdevel-backtrace-perl/lib/Devel/Backtrace/Point.pm (original)
+++ trunk/libdevel-backtrace-perl/lib/Devel/Backtrace/Point.pm Fri Mar 28 20:03:13 2008
@@ -65,6 +65,21 @@
 =cut
 
 __PACKAGE__->mk_ro_accessors(FIELDS);
+
+=head2 $p->called_package
+
+This returns the package that $p->subroutine is in.
+
+=cut
+
+sub called_package {
+    my $this = shift;
+    my $sub = $this->subroutine;
+
+    my $idx = rindex($sub, '::');
+    return '(unknown)' if -1 == $idx;
+    return substr($sub, 0, $idx);
+}
 
 =head2 $p->by_index($i)
 




More information about the Pkg-perl-cvs-commits mailing list