-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathox.pl
54 lines (37 loc) · 952 Bytes
/
ox.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
=pod
=head1 NAME
ox.pl - Print out object cross reference information
=head1 SYNOPSIS
ox.pl <symbol> [<symbol> ...]
=head1 DESCRIPTION
The I<ox.pl> prints out where a symbol is defined and used.
=head1 FILES
=over 4
=item object_xref.dat
The database containing the symbol information.
=back
=head1 SEE ALSO
L<ox-gen.pl>, L<nm>
=cut
use strict;
use warnings;
use Storable;
# The cross reference data
my $object_xref = retrieve("object_xref.dat");
if (not defined($object_xref)) {
print "Could not find data file\n";
exit (8);
}
# Look through each symbol on the command line
foreach my $sym (@ARGV) {
# Get the information about this symbol
my $info = $object_xref->{$sym};
if (not defined($info)) {
print "$sym: UNDEFINED\n";
next;
}
# Print the information
print "$sym\n";
print " Defined: @{$info->{'defined'}}\n";
print " Used: @{$info->{'used'}}\n";
}