summaryrefslogtreecommitdiff
path: root/deb.c
diff options
context:
space:
mode:
Diffstat (limited to 'deb.c')
-rw-r--r--deb.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/deb.c b/deb.c
index 10b52cf49d..0eaa056f58 100644
--- a/deb.c
+++ b/deb.c
@@ -47,17 +47,16 @@ Perl_vdeb(pTHX_ const char *pat, va_list *args)
#ifdef DEBUGGING
dTHR;
register I32 i;
- GV* gv = PL_curcop->cop_filegv;
+ char* file = CopFILE(PL_curcop);
#ifdef USE_THREADS
PerlIO_printf(Perl_debug_log, "0x%"UVxf" (%s:%ld)\t",
PTR2UV(thr),
- SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
- (long)PL_curcop->cop_line);
+ (file ? file : "<free>"),
+ (long)CopLINE(PL_curcop));
#else
- PerlIO_printf(Perl_debug_log, "(%s:%ld)\t",
- SvTYPE(gv) == SVt_PVGV ? SvPVX(GvSV(gv)) : "<free>",
- (long)PL_curcop->cop_line);
+ PerlIO_printf(Perl_debug_log, "(%s:%ld)\t", (file ? file : "<free>"),
+ (long)CopLINE(PL_curcop));
#endif /* USE_THREADS */
(void) PerlIO_vprintf(Perl_debug_log, pat, *args);
#endif /* DEBUGGING */