summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadu Greab <radu@netsoft.ro>2003-08-02 03:17:49 +0300
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-02 05:12:13 +0000
commit19bcb543e1f5bb004bdf7d16ba95ef96ce9e99c8 (patch)
treea7b3a67fba5f52172771aa806ce7898d21b828e7
parent670137c257a6256f68b1db438a3e2732ae609263 (diff)
downloadperl-19bcb543e1f5bb004bdf7d16ba95ef96ce9e99c8.tar.gz
Re: [PATCH @19834] DProf fixes
Message-Id: <20030802.001749.101708736.radu@yx.primIT.ro> p4raw-id: //depot/perl@20440
-rw-r--r--ext/Devel/DProf/Changes19
-rw-r--r--ext/Devel/DProf/DProf.pm2
-rw-r--r--ext/Devel/DProf/DProf.xs8
-rw-r--r--t/lib/dprof/test8_t8
-rw-r--r--t/lib/dprof/test8_v1
5 files changed, 33 insertions, 5 deletions
diff --git a/ext/Devel/DProf/Changes b/ext/Devel/DProf/Changes
index 09b2250dc2..1d1ba0e7b9 100644
--- a/ext/Devel/DProf/Changes
+++ b/ext/Devel/DProf/Changes
@@ -1,3 +1,22 @@
+2003 Aug 1
+ Radu Greab:
+ DProf.xs:
+ - do not assume that $^P stays unchanged inside the profiled subroutine
+ DProf.pm:
+ - increase VERSION
+
+2003 Jul 6
+
+ Radu Greab:
+ DProf.xs:
+ - improved the mapping between subroutines and identifiers
+ - do not assume that $^P stays unchanged during the lifetime of the script
+ - panic when the profiled subroutine is leaved with goto/last/next
+ DProf.pm:
+ - document the problem with the subroutines exited with goto/last/next
+ t/test{7,8}*
+ - added
+
2003 Jan 8
Blair Zajac:
diff --git a/ext/Devel/DProf/DProf.pm b/ext/Devel/DProf/DProf.pm
index 95fcfc253d..1a22b7579e 100644
--- a/ext/Devel/DProf/DProf.pm
+++ b/ext/Devel/DProf/DProf.pm
@@ -206,7 +206,7 @@ sub DB {
use XSLoader ();
# Underscore to allow older Perls to access older version from CPAN
-$Devel::DProf::VERSION = '20030108.00_00'; # this version not authorized by
+$Devel::DProf::VERSION = '20030801.00_00'; # this version not authorized by
# Dean Roehrich. See "Changes" file.
XSLoader::load 'Devel::DProf', $Devel::DProf::VERSION;
diff --git a/ext/Devel/DProf/DProf.xs b/ext/Devel/DProf/DProf.xs
index 304b56ed4e..4e489105ff 100644
--- a/ext/Devel/DProf/DProf.xs
+++ b/ext/Devel/DProf/DProf.xs
@@ -20,7 +20,7 @@ db_get_cv(pTHX_ SV *sv)
{
CV *cv;
- if (PERLDB_SUB_NN) {
+ if (SvIOK(sv)) { /* if (PERLDB_SUB_NN) { */
cv = INT2PTR(CV*,SvIVX(sv));
} else {
if (SvPOK(sv)) {
@@ -315,11 +315,11 @@ prof_dump_until(pTHX_ long ix)
}
}
-static void
+inline static void
set_cv_key(pTHX_ CV *cv, char *pname, char *gname)
{
- SvGROW(g_key_hash, sizeof(CV*) + strlen(pname) + strlen(gname) + 3);
- sv_setpvn(g_key_hash, (char*)&cv, sizeof(CV*));
+ SvGROW(g_key_hash, sizeof(CV**) + strlen(pname) + strlen(gname) + 3);
+ sv_setpvn(g_key_hash, (char*)&cv, sizeof(CV**));
sv_catpv(g_key_hash, pname);
sv_catpv(g_key_hash, "::");
sv_catpv(g_key_hash, gname);
diff --git a/t/lib/dprof/test8_t b/t/lib/dprof/test8_t
index 915a7f7f0e..6154c8a530 100644
--- a/t/lib/dprof/test8_t
+++ b/t/lib/dprof/test8_t
@@ -2,6 +2,14 @@ sub foo {
print "in sub foo\n";
}
+sub bar {
+ print "in sub bar\n";
+ $^P -= 0x40;
+}
+
foo();
$^P -= 0x40;
foo();
+$^P += 0x40;
+bar();
+$^P += 0x40;
diff --git a/t/lib/dprof/test8_v b/t/lib/dprof/test8_v
index a53758bd1a..d5de3087fe 100644
--- a/t/lib/dprof/test8_v
+++ b/t/lib/dprof/test8_v
@@ -5,6 +5,7 @@ use V;
dprofpp( '-t' );
$expected =
qq{main::foo (2x)
+main::bar
};
report 20, sub { $expected eq $results };