Commit c05674f2 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Improve debug output from header installer.

parent 14969949
......@@ -69,7 +69,7 @@ BEGIN {
local $_;
my ($text) = @_;
print STDERR 'transliterating "', $text, '"', $trigraphre, "\n"
if ($debug > 3);
if ($debug > 4);
while ($text =~ s{$trigraphre}{$trigraphs{$1}})
{
}
......@@ -255,8 +255,18 @@ sub parsePreProcExpression
}
elsif (validPreProcSym($token))
{
print(STDERR 'In ', whoami(), ', line ', __LINE__, "\n") if $debug > 2;
print(STDERR
Data::Dumper->Dump([\$defines], ['defines']),
"\n") if $debug > 4;
push(@$cppKeyOut, $token) if (defined($cppKeyOut));
insertDefinitionOnDemand($defines, $token);
print(STDERR 'token ', $token,
(defined($defines->{$token}) ?
( ': found definition ',
join(' ', @{$defines->{$token}{'definition'}[0]}))
: ' undefined'), "\n") if $debug > 3;
if (defined($defines->{$token}))
{
my @definition = @{$defines->{$token}{'definition'}};
......@@ -435,8 +445,12 @@ BEGIN {
{
my ($defines, $token) = @_;
print(STDERR 'In ', whoami(), ', line ', __LINE__, "\n") if $debug > 1;
print(STDERR Data::Dumper->Dump([\$defines], ['defines']), "\n")
if $debug > 4;
if (exists($defines->{$token}))
{
print(STDERR 'Returning ', @{$defines->{$token}{'definition'}[0]},
' for token ', $token, "\n") if $debug > 3;
return $defines->{$token};
}
else
......
......@@ -69,7 +69,6 @@ print(STDERR Data::Dumper->Dump([\%configHDefs], [qw(configHDefs)]))
print(STDERR 'srcBaseDir = ', $srcBaseDir, "\n",
'dstBaseDir = ', $dstBaseDir, "\n")
if ($debug);
foreach my $headerFn (@ARGV)
{
my ($instHeaderFn) = catfile($dstBaseDir,
......@@ -238,8 +237,9 @@ foreach my $headerFn (@ARGV)
'expand' => $expand,
});
$thisLineIgnored = $expand;
print(STDERR __LINE__, ': ', Data::Dumper->Dump([\@predicateLevels],
['predicatelevels']))
print(STDERR 'In ', cpp::whoami(), ', line ', __LINE__, ': ',
Data::Dumper->Dump([\@predicateLevels],
['predicatelevels']))
if $debug > 2;
if (!$thisLineIgnored) {
# we don't know enough about this conditional, leave it in
......@@ -259,8 +259,8 @@ foreach my $headerFn (@ARGV)
{
$predValue = defined($configHDefs{$predicate});
$predValue = !$predValue if ($clause eq 'ifndef');
print(STDERR Data::Dumper->Dump([\$predValue],
[qw(predicate)]))
print(STDERR 'In ', cpp::whoami(), ', line ', __LINE__, ': ',
Data::Dumper->Dump([\$predValue], [qw(predicate)]))
if $debug > 1;
$ignored = (!$predValue or $ignored);
$expand = 1;
......@@ -400,10 +400,21 @@ sub checkPredicate(\%$$$)
my $result = 4711;
foreach my $token (@{$tokenMapping[0]})
{
print(STDERR 'Inspecting token ', $token, ' at ', __LINE__+1, "\n")
if $debug > 4;
next if ($token eq 'defined');
print(STDERR 'Inspecting token ', $token, ' at ', __LINE__+1, "\n")
if $debug > 4;
next if (exists($defines->{$token}));
print(STDERR 'Inspecting token ', $token, ' at ', __LINE__+1, "\n")
if $debug > 4;
next if ($token =~ m{$cpp::operator_match});
print(STDERR 'Inspecting token ', $token, ' at ', __LINE__+1, "\n")
if $debug > 4;
next if ($token =~ m{$cpp::integral_constant_match});
print(STDERR 'This predicate cannot be deduced because of token "',
$token, '"', "\n")
if $debug > 3;
$result = undef;
last;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment