Discussion:
Change 33039: Integrate:
(too old to reply)
nwc10+ (Nicholas Clark)
2008-01-22 17:45:05 UTC
Permalink
Change 33039 by ***@nicholas-saigo on 2008/01/22 17:41:53

Integrate:
[ 29960]
Display the process id as part of the trace output if running with -Dv
(Might be nice to display the thread ID too under ithreads, but I can't
see a clean way to get that)

Affected files ...

... //depot/maint-5.8/perl/deb.c#22 integrate

Differences ...

==== //depot/maint-5.8/perl/deb.c#22 (text) ====
Index: perl/deb.c
--- perl/deb.c#21~30033~ 2007-01-27 08:40:35.000000000 -0800
+++ perl/deb.c 2008-01-22 09:41:53.000000000 -0800
@@ -56,7 +56,9 @@
Perl_vdeb(pTHX_ const char *pat, va_list *args)
{
#ifdef DEBUGGING
- const char* const file = OutCopFILE(PL_curcop);
+ const char* const file = PL_curcop ? OutCopFILE(PL_curcop) : "<null>";
+ const char* const display_file = file ? file : "<free>";
+ const long line = PL_curcop ? (long)CopLINE(PL_curcop) : 0;

#ifdef USE_5005THREADS
PerlIO_printf(Perl_debug_log, "0x%"UVxf" (%s:%ld)\t",
@@ -64,8 +66,11 @@
(file ? file : "<free>"),
(long)CopLINE(PL_curcop));
#else
- PerlIO_printf(Perl_debug_log, "(%s:%ld)\t", (file ? file : "<free>"),
- (long)CopLINE(PL_curcop));
+ if (DEBUG_v_TEST)
+ PerlIO_printf(Perl_debug_log, "(%ld:%s:%ld)\t",
+ (long)PerlProc_getpid(), display_file, line);
+ else
+ PerlIO_printf(Perl_debug_log, "(%s:%ld)\t", display_file, line);
#endif /* USE_5005THREADS */
(void) PerlIO_vprintf(Perl_debug_log, pat, *args);
#else
End of Patch.
John E. Malmberg
2008-01-28 04:52:06 UTC
Permalink
Post by nwc10+ (Nicholas Clark)
[ 29960]
Display the process id as part of the trace output if running with -Dv
(Might be nice to display the thread ID too under ithreads, but I can't
see a clean way to get that)
Affected files ...
... //depot/maint-5.8/perl/deb.c#22 integrate
Note for the VMS todo lists:

VMS needs the process ID to be in hexadecimal in order to be easily used
by someone doing debugging.

-John
***@qsl.net
Personal Opinion Only
Craig A. Berry
2008-01-29 01:21:21 UTC
Permalink
Post by nwc10+ (Nicholas Clark)
[ 29960]
Display the process id as part of the trace output if running with -Dv
(Might be nice to display the thread ID too under ithreads, but I can't
see a clean way to get that)
Affected files ...
... //depot/maint-5.8/perl/deb.c#22 integrate
VMS needs the process ID to be in hexadecimal in order to be easily used by someone doing debugging.
While it's true that native utilities generally use the pid in hex,
Perl doesn't. For example the C<$$> special variable displays in
decimal on VMS and always has as far as I know. I really don't see
any reason for special case code here, and it might even be more
confusing to have it different from the way Perl does things
elsewhere.
--
________________________________________
Craig A. Berry
mailto:***@mac.com

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser
Continue reading on narkive:
Loading...