r40924 - in /branches/upstream/libdevel-declare-perl/current: Changes Declare.xs MANIFEST META.yml Makefile.PL lib/Devel/Declare.pm t/debug.pl t/debug.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Jul 28 20:21:49 UTC 2009


Author: jawnsy-guest
Date: Tue Jul 28 20:21:42 2009
New Revision: 40924

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=40924
Log:
[svn-upgrade] Integrating new upstream version, libdevel-declare-perl (0.005008)

Added:
    branches/upstream/libdevel-declare-perl/current/t/debug.pl
    branches/upstream/libdevel-declare-perl/current/t/debug.t
Modified:
    branches/upstream/libdevel-declare-perl/current/Changes
    branches/upstream/libdevel-declare-perl/current/Declare.xs
    branches/upstream/libdevel-declare-perl/current/MANIFEST
    branches/upstream/libdevel-declare-perl/current/META.yml
    branches/upstream/libdevel-declare-perl/current/Makefile.PL
    branches/upstream/libdevel-declare-perl/current/lib/Devel/Declare.pm

Modified: branches/upstream/libdevel-declare-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/Changes?rev=40924&op=diff
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/Changes (original)
+++ branches/upstream/libdevel-declare-perl/current/Changes Tue Jul 28 20:21:42 2009
@@ -1,4 +1,7 @@
 Changes for Devel-Declare
+
+  - Depend on the latest ExtUtils::Depends for win32+gcc support.
+  - Conditionally expand linestrings under perl debugger.
 
 0.005007 - 13 Jul 2009
   - Fix line numbers not being updated from skipspace calls

Modified: branches/upstream/libdevel-declare-perl/current/Declare.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/Declare.xs?rev=40924&op=diff
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/Declare.xs (original)
+++ branches/upstream/libdevel-declare-perl/current/Declare.xs Tue Jul 28 20:21:42 2009
@@ -11,6 +11,11 @@
 # define Newx(v,n,t) New(0,v,n,t)
 #endif /* !Newx */
 
+#define DD_DEBUGf_UPDATED_LINESTR 1
+#define DD_DEBUGf_TRACE 2
+
+#define DD_DEBUG_UPDATED_LINESTR (dd_debug & DD_DEBUGf_UPDATED_LINESTR)
+#define DD_DEBUG_TRACE (dd_debug & DD_DEBUGf_TRACE)
 static int dd_debug = 0;
 
 #define LEX_NORMAL    10
@@ -128,6 +133,17 @@
   SvCUR_set(PL_linestr, new_len);
 
   PL_bufend = SvPVX(PL_linestr) + new_len;
+
+  if ( DD_DEBUG_UPDATED_LINESTR && PERLDB_LINE && PL_curstash != PL_debstash) {
+    // Cribbed from toke.c
+    SV * const sv = NEWSV(85,0);
+
+    sv_upgrade(sv, SVt_PVMG);
+    sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr);
+    (void)SvIOK_on(sv);
+    SvIV_set(sv, 0);
+    av_store(CopFILEAV(&PL_compiling),(I32)CopLINE(&PL_compiling),sv);
+  }
 }
 
 char* dd_get_lex_stuff(pTHX) {
@@ -218,7 +234,7 @@
   PERL_UNUSED_VAR(user_data);
 
   if (in_declare) {
-    if (dd_debug) {
+    if (DD_DEBUG_TRACE) {
       printf("Deconstructing declare\n");
       printf("PL_bufptr: %s\n", PL_bufptr);
       printf("bufend at: %i\n", PL_bufend - PL_bufptr);
@@ -236,7 +252,7 @@
     FREETMPS;
     LEAVE;
 
-    if (dd_debug) {
+    if (DD_DEBUG_TRACE) {
       printf("PL_bufptr: %s\n", PL_bufptr);
       printf("bufend at: %i\n", PL_bufend - PL_bufptr);
       printf("linestr: %s\n", SvPVX(PL_linestr));
@@ -254,7 +270,7 @@
   if (!DD_AM_LEXING)
     return o; /* not lexing? */
 
-  if (dd_debug) {
+  if (DD_DEBUG_TRACE) {
     printf("Checking GV %s -> %s\n", HvNAME(GvSTASH(kGVOP_gv)), GvNAME(kGVOP_gv));
   }
 
@@ -263,7 +279,7 @@
   if (dd_flags == -1)
     return o;
 
-  if (dd_debug) {
+  if (DD_DEBUG_TRACE) {
     printf("dd_flags are: %i\n", dd_flags);
     printf("PL_tokenbuf: %s\n", PL_tokenbuf);
   }
@@ -286,7 +302,7 @@
 #endif
   sv = POPs;
   if (SvPOK(sv)) {
-    if (dd_debug) {
+    if (DD_DEBUG_TRACE) {
       printf("mangling eval sv\n");
     }
     if (SvREADONLY(sv))
@@ -472,6 +488,11 @@
     in_declare = value;
 
 BOOT:
-  if (getenv ("DD_DEBUG")) {
-    dd_debug = 1;
-  }
+  char *endptr;
+  char *debug_str = getenv ("DD_DEBUG");
+  if (debug_str) {
+    dd_debug = strtol (debug_str, &endptr, 10);
+    if (*endptr != '\0') {
+      dd_debug = 0;
+    }
+  }

Modified: branches/upstream/libdevel-declare-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/MANIFEST?rev=40924&op=diff
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/MANIFEST (original)
+++ branches/upstream/libdevel-declare-perl/current/MANIFEST Tue Jul 28 20:21:42 2009
@@ -17,6 +17,8 @@
 t/build_sub_installer.t
 t/combi.t
 t/ctx-simple.t
+t/debug.pl
+t/debug.t
 t/eval.t
 t/fail.t
 t/lines.t

Modified: branches/upstream/libdevel-declare-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/META.yml?rev=40924&op=diff
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/META.yml (original)
+++ branches/upstream/libdevel-declare-perl/current/META.yml Tue Jul 28 20:21:42 2009
@@ -3,14 +3,14 @@
 author:
   - 'Matt S Trout - <mst at shadowcat.co.uk> - original author'
 build_requires:
-  B::Hooks::OP::Check: 0.10
+  B::Hooks::OP::Check: 0.18
   ExtUtils::MakeMaker: 6.42
 configure_requires:
-  B::Hooks::OP::Check: 0.10
-  ExtUtils::Depends: 0
+  B::Hooks::OP::Check: 0.18
+  ExtUtils::Depends: 0.302
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.910'
+generated_by: 'Module::Install version 0.91'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -22,10 +22,11 @@
     - t
 requires:
   B::Hooks::EndOfScope: 0.05
-  B::Hooks::OP::Check: 0.10
-  Scalar::Util: 0
+  B::Hooks::OP::Check: 0.18
+  Scalar::Util: 1.11
   Sub::Name: 0
   perl: 5.8.1
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.005007
+  repository: git://github.com/rafl/devel-declare.git
+version: 0.005008

Modified: branches/upstream/libdevel-declare-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/Makefile.PL?rev=40924&op=diff
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/Makefile.PL (original)
+++ branches/upstream/libdevel-declare-perl/current/Makefile.PL Tue Jul 28 20:21:42 2009
@@ -7,15 +7,20 @@
 name 'Devel-Declare';
 all_from 'lib/Devel/Declare.pm';
 
-requires 'Scalar::Util';
-requires 'B::Hooks::OP::Check' => '0.10';
+requires 'Scalar::Util' => 1.11; # set_prototype appeared in this version
+requires 'B::Hooks::OP::Check' => '0.18';
 requires 'B::Hooks::EndOfScope' => '0.05';
 requires 'Sub::Name';
 
-build_requires 'B::Hooks::OP::Check' => '0.10';
+build_requires 'B::Hooks::OP::Check' => '0.18';
 
-configure_requires 'ExtUtils::Depends';
-configure_requires 'B::Hooks::OP::Check' => '0.10';
+# minimum version that works on Win32+gcc
+configure_requires 'ExtUtils::Depends' => 0.302;
+
+# minimum version that depends on ExtUtils::Depends 0.302
+configure_requires 'B::Hooks::OP::Check' => '0.18';
+
+repository 'git://github.com/rafl/devel-declare.git';
 
 postamble(<<'EOM');
 $(OBJECT) : stolen_chunk_of_toke.c

Modified: branches/upstream/libdevel-declare-perl/current/lib/Devel/Declare.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/lib/Devel/Declare.pm?rev=40924&op=diff
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/lib/Devel/Declare.pm (original)
+++ branches/upstream/libdevel-declare-perl/current/lib/Devel/Declare.pm Tue Jul 28 20:21:42 2009
@@ -4,7 +4,7 @@
 use warnings;
 use 5.008001;
 
-our $VERSION = '0.005007';
+our $VERSION = '0.005008';
 
 use constant DECLARE_NAME => 1;
 use constant DECLARE_PROTO => 2;

Added: branches/upstream/libdevel-declare-perl/current/t/debug.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/t/debug.pl?rev=40924&op=file
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/t/debug.pl (added)
+++ branches/upstream/libdevel-declare-perl/current/t/debug.pl Tue Jul 28 20:21:42 2009
@@ -1,0 +1,43 @@
+use strict;
+use warnings;
+
+use Devel::Declare;
+
+BEGIN {
+
+  Devel::Declare->install_declarator(
+    'DeclareTest', 'method', DECLARE_PACKAGE | DECLARE_PROTO,
+    sub {
+      my ($name, $proto) = @_;
+      return 'my $self = shift;' unless defined $proto && $proto ne '@_';
+      return 'my ($self'.(length $proto ? ", ${proto}" : "").') = @_;';
+    },
+    sub {
+      my ($name, $proto, $sub, @rest) = @_;
+      if (defined $name && length $name) {
+        unless ($name =~ /::/) {
+          $name = "DeclareTest::${name}";
+        }
+        no strict 'refs';
+        *{$name} = $sub;
+      }
+      return wantarray ? ($sub, @rest) : $sub;
+    }
+  );
+
+}
+
+my ($test_method1, $test_method2, @test_list);
+
+{
+  package DeclareTest;
+
+  method new {
+  };
+
+}
+
+{ no strict;
+  no warnings 'uninitialized';
+  print @{"_<t/debug.pl"};
+}

Added: branches/upstream/libdevel-declare-perl/current/t/debug.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-declare-perl/current/t/debug.t?rev=40924&op=file
==============================================================================
--- branches/upstream/libdevel-declare-perl/current/t/debug.t (added)
+++ branches/upstream/libdevel-declare-perl/current/t/debug.t Tue Jul 28 20:21:42 2009
@@ -1,0 +1,28 @@
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+use Cwd qw/cwd/;
+use FindBin qw/$Bin/;
+
+$ENV{PERLDB_OPTS} = "NonStop";
+$ENV{DD_DEBUG} = 1;
+cwd("$Bin/..");
+
+# Write a .perldb file so we make sure we dont use the users one
+open PERLDB, ">", "$Bin/../.perldb" or die "Cannot open $Bin/../.perldb: $!";
+close PERLDB;
+
+$SIG{CHLD} = 'IGNORE';
+$SIG{ALRM} = sub {
+  fail("SIGALRM timeout triggered");
+  kill(9, $$);
+};
+
+alarm 10;
+my $output = `$^X -d t/debug.pl`;
+
+like($output, qr/method new {}, sub {my \$self = shift;/,
+  "replaced line string visible in debug lines");
+1;




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