ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Devel-FindRef/FindRef.xs
(Generate patch)

Comparing Devel-FindRef/FindRef.xs (file contents):
Revision 1.1 by root, Thu Jan 11 22:30:34 2007 UTC vs.
Revision 1.2 by root, Thu Jan 11 23:05:52 2007 UTC

52 /* Remember that the zeroth slot is used as the pointer onwards, so don't 52 /* Remember that the zeroth slot is used as the pointer onwards, so don't
53 include it. */ 53 include it. */
54 while (--idx > 0) 54 while (--idx > 0)
55 { 55 {
56 SV *sv = &arena [idx]; 56 SV *sv = &arena [idx];
57 57
58 if (SvTYPE (sv) >= SVt_LAST)
59 continue;
60
61 /* temporarily disable RMAGICAL, it can easily interfere with us */
58 if ((rmagical = SvRMAGICAL (sv))) 62 if ((rmagical = SvRMAGICAL (sv)))
59 SvRMAGICAL_off (sv); 63 SvRMAGICAL_off (sv);
60 64
61 //TODO: magic 65 if (SvTYPE (sv) >= SVt_PVMG)
66 {
67 MAGIC *mg = SvMAGIC (sv);
68 while (mg)
69 {
70 if (mg->mg_obj == targ)
71 res_pair (form ("referenced (in mg_obj) by '%c' type magic attached to", mg->mg_type));
72 if ((SV *)mg->mg_ptr == targ && mg->mg_flags & MGf_REFCOUNTED)
73 res_pair (form ("referenced (in mg_ptr) by '%c' type magic attached to", mg->mg_type));
74
75 mg = mg->mg_moremagic;
76 }
77 }
62 78
63 switch (SvTYPE (sv)) 79 switch (SvTYPE (sv))
64 { 80 {
65 case SVt_RV: 81 case SVt_RV:
66 if (sv != target && SvRV (sv) == targ) 82 if (sv != target && SvRV (sv) == targ)
82 if (HeVAL (he) == targ) 98 if (HeVAL (he) == targ)
83 res_pair (form ("in the member '%.*s' of", HeKLEN (he), HeKEY (he))); 99 res_pair (form ("in the member '%.*s' of", HeKLEN (he), HeKEY (he)));
84 } 100 }
85 break; 101 break;
86 102
87 case SVt_PVGV:
88 if (GvGP (sv))
89 {
90 if (GvSV (sv) == targ)
91 res_gv ('$');
92 if (GvAV (sv) == (AV *)targ)
93 res_gv ('@');
94 if (GvHV (sv) == (HV *)targ)
95 res_gv ('%');
96 if (GvCV (sv) == (CV *)targ)
97 res_gv ('&');
98 }
99 break;
100
101 case SVt_PVCV: 103 case SVt_PVCV:
102 { 104 {
103 int depth = CvDEPTH (sv); 105 int depth = CvDEPTH (sv);
104 if (depth) 106 if (depth)
105 { 107 {
115 --depth; 117 --depth;
116 } 118 }
117 } 119 }
118 } 120 }
119 break; 121 break;
122
123 case SVt_PVGV:
124 if (GvGP (sv))
125 {
126 if (GvSV (sv) == targ)
127 res_gv ('$');
128 if (GvAV (sv) == (AV *)targ)
129 res_gv ('@');
130 if (GvHV (sv) == (HV *)targ)
131 res_gv ('%');
132 if (GvCV (sv) == (CV *)targ)
133 res_gv ('&');
134 }
135 break;
120 } 136 }
121 137
122 if (rmagical) 138 if (rmagical)
123 SvRMAGICAL_off (sv); 139 SvRMAGICAL_off (sv);
124 } 140 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines