summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorLarry Wall <larry@netlabs.com>1993-11-10 00:00:00 +0000
committerLarry Wall <larry@netlabs.com>1993-11-10 00:00:00 +0000
commit463ee0b2acbd047c27e8b5393cdd8398881824c5 (patch)
treeae17d9179fc861ae5fc5a86da9139631530cb6fe /dump.c
parent93a17b20b6d176db3f04f51a63b0a781e5ffd11c (diff)
downloadperl-463ee0b2acbd047c27e8b5393cdd8398881824c5.tar.gz
perl 5.0 alpha 4
[editor's note: the sparc executables have not been included, and emacs backup files have been removed. This was reconstructed from a tarball found on the September 1994 InfoMagic CD; the date of this is approximate]
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/dump.c b/dump.c
index a6b4b17027..a51a012a9e 100644
--- a/dump.c
+++ b/dump.c
@@ -31,15 +31,29 @@ static void dump();
void
dump_all()
{
- register I32 i;
- register HE *entry;
-
setlinebuf(stderr);
if (main_root)
dump_op(main_root);
- for (i = 0; i <= 127; i++) {
- for (entry = HvARRAY(defstash)[i]; entry; entry = entry->hent_next)
- dump_sub((GV*)entry->hent_val);
+ dump_packsubs(defstash);
+}
+
+void
+dump_packsubs(stash)
+HV* stash;
+{
+ U32 i;
+ HE *entry;
+
+ for (i = 0; i <= HvMAX(stash); i++) {
+ for (entry = HvARRAY(stash)[i]; entry; entry = entry->hent_next) {
+ GV *gv = (GV*)entry->hent_val;
+ HV *hv;
+ if (GvCV(gv))
+ dump_sub(gv);
+ if (*entry->hent_key == '_' && (hv = GvHV(gv)) && HvNAME(hv) &&
+ hv != defstash)
+ dump_packsubs(hv); /* nested package */
+ }
}
}
@@ -50,7 +64,7 @@ GV* gv;
SV *sv = sv_mortalcopy(&sv_undef);
if (GvCV(gv)) {
gv_fullname(sv,gv);
- dump("\nSUB %s = ", SvPV(sv));
+ dump("\nSUB %s = ", SvPVX(sv));
if (CvUSERSUB(GvCV(gv)))
dump("(usersub 0x%x %d)\n",
(long)CvUSERSUB(GvCV(gv)),
@@ -170,7 +184,7 @@ register OP *op;
if (cGVOP->op_gv) {
tmpsv = NEWSV(0,0);
gv_fullname(tmpsv,cGVOP->op_gv);
- dump("GV = %s\n", SvPVn(tmpsv));
+ dump("GV = %s\n", SvPV(tmpsv, na));
sv_free(tmpsv);
}
else
@@ -228,7 +242,7 @@ register OP *op;
case OP_PUSHRE:
case OP_MATCH:
case OP_SUBST:
- dump_pm(op);
+ dump_pm((PMOP*)op);
break;
}
if (op->op_flags & OPf_KIDS) {
@@ -254,10 +268,10 @@ register GV *gv;
dumplvl++;
fprintf(stderr,"{\n");
gv_fullname(sv,gv);
- dump("GV_NAME = %s", SvPV(sv));
+ dump("GV_NAME = %s", SvPVX(sv));
if (gv != GvEGV(gv)) {
gv_efullname(sv,GvEGV(gv));
- dump("-> %s", SvPV(sv));
+ dump("-> %s", SvPVX(sv));
}
dump("\n");
dumplvl--;