3 # This script will translate any SYMBOL_VECTOR item that has a translation
4 # in CXX$DEMANGLER_DB. The latter is generated by and CC/DECC command that
5 # uses the qualifier /REPOSITORY with the build directory as value. When
6 # /NAMES=SHORTENED has been used, this file will hold the translations from
7 # the original symbols to the shortened variants.
9 # CXX$DEMAGLER_DB. is an ISAM file, but with the magic of RMS, it can be
10 # read as a text file, with each record as one line.
12 # The lines will have the following syntax for any symbol found that's longer
15 # LONG_symbol_34567890123{cksum}$LONG_symbol_34567890123_more_than_31_chars
17 # $ is present at the end of the shortened symbol name, and is preceded by a
18 # 7 character checksum. The $ makes it easy to separate the shortened name
19 # from the original one.
24 usage() if scalar @ARGV < 1;
26 my %translations = ();
28 open DEMANGLER_DATA, $ARGV[0]
29 or die "Couldn't open $ARGV[0]: $!\n";
30 while(<DEMANGLER_DATA>) {
32 (my $translated, my $original) = split /\$/;
33 $translations{$original} = $translated.'$';
40 ((?:[A-Za-z0-9_]+)\/)?([A-Za-z0-9_]+)=(PROCEDURE|DATA)
42 if (defined($translations{$2})) {
43 my $trans = $translations{$2};
44 my $trans_uc = uc $trans;
45 if (defined($1) && $trans ne $trans_uc) {