New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger Loses Names for Anonymous Subroutines #8357
Comments
From chromatic@wgz.orgCreated by chromatic@wgz.orgAssigning to the *__ANON__ typeglob within an otherwise-anonymous subroutine use strict; my $sub = sub sub bar $sub->(); This prints: Called from main::foo! Running this through the debugger gives much different results however: Loading DB routines from perl5db.pl version 1.28 Enter h or `h h' for help, or `man perldebug' for more help. main::(debanonsub.pl:10): }; Perl Info
|
From chromatic@wgz.orgOn Saturday 04 March 2006 16:07, chromatic wrote:
Applying this patch (which merely deletes code) fixes my problem. All tests Then again, I'm having a bit of trouble figuring out how to write a test for -- c |
From chromatic@wgz.orgfix_anon_debugger.patch--- op.c~ 2006-03-11 03:01:46.000000000 -0800
+++ op.c 2006-03-11 03:03:01.000000000 -0800
@@ -4918,7 +4918,6 @@
Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
{
dVAR;
- const char *aname;
GV *gv;
const char *ps;
STRLEN ps_len;
@@ -4942,19 +4941,8 @@
else
ps = NULL;
- if (!name && PERLDB_NAMEANON && CopLINE(PL_curcop)) {
- SV * const sv = sv_newmortal();
- Perl_sv_setpvf(aTHX_ sv, "%s[%s:%"IVdf"]",
- PL_curstash ? "__ANON__" : "__ANON__::__ANON__",
- CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
- aname = SvPVX_const(sv);
- }
- else
- aname = NULL;
-
gv = name ? gv_fetchsv(cSVOPo->op_sv, gv_fetch_flags, SVt_PVCV)
- : gv_fetchpv(aname ? aname
- : (PL_curstash ? "__ANON__" : "__ANON__::__ANON__"),
+ : gv_fetchpv(PL_curstash ? "__ANON__" : "__ANON__::__ANON__",
gv_fetch_flags, SVt_PVCV);
if (!PL_madskills) {
@@ -5225,9 +5213,9 @@
CvCONST_on(cv);
}
- if (name || aname) {
+ if (name) {
const char *s;
- const char * const tname = (name ? name : aname);
+ const char * const tname = name;
if (PERLDB_SUBLINE && PL_curstash != PL_debstash) {
SV * const sv = newSV(0);
|
From @rgschromatic wrote:
I don't like it. Basically your patch removes the functionality given by the IMO if you want avoid the debugger messing with your anon sub names (OTOH a doc patch for DollarCaretP's allowed values would be welcome.) |
The RT System itself - Status changed from 'new' to 'open' |
From chromatic@wgz.orgOn Tuesday 14 March 2006 02:24, Rafael Garcia-Suarez wrote:
I'm not sure the problem is the debugger. If the code I deleted instead I must admit to getting very lost in figuring out how *__ANON__ and the
I will look at that. -- c |
From @nwc10On Tue, Mar 14, 2006 at 12:00:49PM -0800, chromatic wrote:
I'm not convinced that it's bug free. Sometimes I can see very strange Nicholas Clark |
p5p@spam.wizbit.be - Status changed from 'open' to 'stalled' |
Migrated from rt.perl.org#38673 (status was 'stalled')
Searchable as RT38673$
The text was updated successfully, but these errors were encountered: