Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charclass_invlists.inc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions configpm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ my $export_funcs = uncomment <<'EOT';
# my %Export_Cache = (myconfig => 1, config_sh => 1, config_vars => 1,
# config_re => 1, compile_date => 1, local_patches => 1,
# bincompat_options => 1, non_bincompat_options => 1,
# header_files => 1);
# header_files => 1, DEBUGGING => 1);
EOT

my %export_ok = eval $export_funcs or die;
Expand Down Expand Up @@ -176,11 +176,12 @@ $config_txt .= sprintf uncomment << 'EOT', $], $export_funcs;
#
EOT

$config_txt .= "sub $_;\n" foreach sort keys %export_ok;
$config_txt .= "sub $_;\n" foreach sort grep $_ ne "DEBUGGING", keys %export_ok;

my $myver = sprintf "%vd", $^V;

$config_txt .= sprintf uncomment <<'ENDOFBEG', ($myver) x 3;
# sub DEBUGGING ();
#
# # Define our own import method to avoid pulling in the full Exporter:
# sub import {
Expand Down Expand Up @@ -472,8 +473,7 @@ $heavy_txt .= sprintf uncomment <<'ENDOFBEG', $osname, $osname, $from, $osname,
# # made to this file will be lost the next time perl is built.
#
# package Config;
# use strict;
# use warnings;
# use v5.44;
# our %%Config;
#
# sub bincompat_options {
Expand Down Expand Up @@ -808,6 +808,10 @@ $heavy_txt .= uncomment <<'ENDOFEND';
# }
# }
#
# sub DEBUGGING :prototype() {
# state $is_debugging //= (Internals::V())[1] =~ /\bDEBUGGING\b/aa;
# }
#
# # Called by the real AUTOLOAD
# sub launcher {
# undef &AUTOLOAD;
Expand Down Expand Up @@ -988,6 +992,11 @@ print CONFIG_POD uncomment <<'ENDOFTAIL';
# Returns a list of the header files that should be used as dependencies for
# XS code, for this version of Perl on this platform.
#
# =item DEBUGGING()
#
# Returns a true value if perl was built with -DDEBUGGING or it's platform
# equivalent.
#
# =back
#
# =head1 EXAMPLE
Expand Down
2 changes: 1 addition & 1 deletion lib/unicore/mktables
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ no warnings qw( experimental::builtin );

sub DEBUG () { 0 } # Set to 0 for production; 1 for development
$| = 1 if DEBUG;
my $debugging_build = $Config{"ccflags"} =~ /-DDEBUGGING/;
my $debugging_build = Config::DEBUGGING;

sub NON_ASCII_PLATFORM { ord("A") != 65 }

Expand Down
2 changes: 1 addition & 1 deletion lib/unicore/uni_keywords.pl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion regcharclass.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion regexp_constants.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions t/op/aassign.t
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ sub sh {
# mark it as safe even though it isn't really. Hence it's a TODO.

SKIP: {
use Config;
eval { require Config; 1 }
or skip "Cannot load Config: $@";
# debugging builds will detect this failure and panic
skip "DEBUGGING build" if $::Config{ccflags} =~ /(?<!\S)-DDEBUGGING(?!\S)/
or $^O eq 'VMS' && $::Config{usedebugging_perl} eq 'Y';
skip "DEBUGGING build" if Config::DEBUGGING();
local $::TODO = 'cheat and optimise my (....) = @_';
local @_ = 1..3;
&f17;
Expand Down
3 changes: 1 addition & 2 deletions t/op/glob.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ BEGIN {
}

use Config;
my $is_debugging_build = $Config{config_args} =~ /\bDDEBUGGING\b(*nla:=none)/;

@oops = @ops = <op/*>;

Expand Down Expand Up @@ -155,7 +154,7 @@ SKIP: {
skip "Debugging builds on Linux and Cygwin still problematic: GH 16869", 1
if (
($Config{osname} eq 'linux' or $Config{osname} eq 'cygwin') and
$is_debugging_build
Config::DEBUGGING
);
fresh_perl(<<~'HERE', {});
my $glob = ("0" x 4094) . "?";
Expand Down
3 changes: 3 additions & 0 deletions t/porting/bincompat.t
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ while (my ($index, $sub) = each @to_check) {
is("@strs","@sorted_strs", "Strings are sorted for $var[$index] in $file[$index]");
}

my $v_is_debugging = !!grep /\bDEBUGGING\b/, $V[1];
is(Config::DEBUGGING, $v_is_debugging, "check Config::DEBUGGING");

done_testing();
3 changes: 1 addition & 2 deletions t/run/switchDx.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use Config;
my $perlio_log = "perlio$$.txt";

skip_all "DEBUGGING build required"
unless $::Config{ccflags} =~ /(?<!\S)-DDEBUGGING(?!\S)/
or $^O eq 'VMS' && $::Config{usedebugging_perl} eq 'Y';
unless Config::DEBUGGING;

plan tests => 9;

Expand Down
10 changes: 4 additions & 6 deletions t/run/todo.t
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ use warnings;

my $switches = "";

my $is_debugging_build = $Config{config_args} =~ /\bDDEBUGGING\b(*nla:=none)/;

our $TODO;

TODO: {
Expand Down Expand Up @@ -294,7 +292,7 @@ TODO: {
}

TODO: {
todo_skip "Test needs -DDEBUGGING", 1 unless $is_debugging_build;
todo_skip "Test needs -DDEBUGGING", 1 unless Config::DEBUGGING;
local $::TODO = 'GH 16522';
fresh_perl(<<~'HERE', { stderr => 'devnull' });
END { exit 0 } # Consider compilation errors a success
Expand All @@ -304,7 +302,7 @@ TODO: {
}

TODO: {
todo_skip "Test needs -DDEBUGGING", 1 unless $is_debugging_build;
todo_skip "Test needs -DDEBUGGING", 1 unless Config::DEBUGGING;
local $::TODO = 'GH 16863';
fresh_perl(<<~'HERE', { stderr => 'devnull' });
END { exit 0 }
Expand All @@ -322,7 +320,7 @@ TODO: {
TODO: {
todo_skip "Test needs -DDEBUGGING on Linux and on Cygwin, no miniperl", 1
unless (
$is_debugging_build and
Config::DEBUGGING and
($Config{osname} eq 'linux' or $Config{osname} eq 'cygwin') and
! is_miniperl()
);
Expand All @@ -335,7 +333,7 @@ TODO: {
}

TODO: {
todo_skip "Test needs -DDEBUGGING", 1 unless $is_debugging_build;
todo_skip "Test needs -DDEBUGGING", 1 unless Config::DEBUGGING;
local $::TODO = 'GH 16876';
fresh_perl('$_ = "a"; s{ x | (?{ s{}{x} }) }{}gx;',
{ stderr => 'devnull' });
Expand Down
4 changes: 2 additions & 2 deletions t/win32/system_tests
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ for my $cmds (@commands) {
">\n";
if (system(@cmds,@args) != 0) {
print "Failed, status($?)\n";
if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {
if (Config::DEBUGGING) {
print "Running again in debug mode\n";
$^D = 1; # -Dp
system(@cmds,@args);
Expand All @@ -112,7 +112,7 @@ for my $cmds (@commands) {
note "####### '$cmdstr'";
if (system($cmdstr) != 0) {
print "Failed, status($?)\n";
if ($Config{ccflags} =~ /\bDDEBUGGING\b/) {
if (Config::DEBUGGING) {
print "Running again in debug mode\n";
$^D = 1; # -Dp
system($cmdstr);
Expand Down
2 changes: 1 addition & 1 deletion uni_keywords.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.