Skip to content

Commit

Permalink
Improve typedef logic for MacOS
Browse files Browse the repository at this point in the history
Tom Lane
  • Loading branch information
adunstan committed Jan 15, 2023
1 parent 3e0329c commit dcca861
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions run_build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,32 @@ sub find_typedefs
next if $bin =~ m!bin/(ipcclean|pltcl_)!;
next unless -f $bin;
next if -l $bin; # ignore symlinks to plain files (e.g. postmaster)
if (@err == 1) # Linux and sometimes windows
if ($using_osx)
{
# no run_log due to redirections.
@dumpout =
`dwarfdump $bin 2>/dev/null | egrep -A2 TAG_typedef 2>/dev/null`;
foreach (@dumpout)
{
## no critic (RegularExpressions::ProhibitCaptureWithoutTest)
@flds = split;
if (@flds == 3)
{
# old format
next unless ($flds[0] eq "AT_name(");
next unless ($flds[1] =~ m/^"(.*)"$/);
$syms{$1} = 1;
}
elsif (@flds == 2)
{
# new format
next unless ($flds[0] eq "DW_AT_name");
next unless ($flds[1] =~ m/^\("(.*)"\)$/);
$syms{$1} = 1;
}
}
}
elsif (@err == 1) # Linux and sometimes windows
{
my $cmd = "$objdump -Wi $bin 2>/dev/null | "
. "egrep -A3 DW_TAG_typedef 2>/dev/null";
Expand Down Expand Up @@ -2217,31 +2242,6 @@ sub find_typedefs
$syms{ $flds[-1] } = 1;
}
}
elsif ($using_osx)
{
# no run_log due to redirections.
@dumpout =
`dwarfdump $bin 2>/dev/null | egrep -A2 TAG_typedef 2>/dev/null`;
foreach (@dumpout)
{
## no critic (RegularExpressions::ProhibitCaptureWithoutTest)
@flds = split;
if (@flds == 3)
{
# old format
next unless ($flds[0] eq "AT_name(");
next unless ($flds[1] =~ m/^"(.*)"$/);
$syms{$1} = 1;
}
elsif (@flds == 2)
{
# new format
next unless ($flds[0] eq "DW_AT_name");
next unless ($flds[1] =~ m/^\("(.*)"\)$/);
$syms{$1} = 1;
}
}
}
else
{
# no run_log due to redirections.
Expand Down

0 comments on commit dcca861

Please sign in to comment.