cvsuser 04/11/07 07:18:47
Modified: tools/dev nm.pl
Log:
Allow -B for --type=bsd and -L for --type=long.
Revision Changes Path
1.5 +11 -6 parrot/tools/dev/nm.pl
Index: nm.pl
===================================================================
RCS file: /cvs/public/parrot/tools/dev/nm.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- nm.pl 15 Mar 2004 22:50:22 -0000 1.4
+++ nm.pl 7 Nov 2004 15:18:46 -0000 1.5
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
# Copyright: 2004 The Perl Foundation. All Rights Reserved.
-# $Id: nm.pl,v 1.4 2004/03/15 22:50:22 mikescott Exp $
+# $Id: nm.pl,v 1.5 2004/11/07 15:18:46 jhi Exp $
=head1 NAME
@@ -117,10 +117,10 @@
require 5.005;
-$VERSION = sprintf "%d.%d", q$Revision: 1.4 $ =~ /(\d+)/g; # [EMAIL
PROTECTED];
+$VERSION = sprintf "%d.%d", q$Revision: 1.5 $ =~ /(\d+)/g; # [EMAIL
PROTECTED];
my $ME = basename($0);
-my $RCS_DATE = q$Date: 2004/03/15 22:50:22 $;
+my $RCS_DATE = q$Date: 2004/11/07 15:18:46 $;
my $nm_cmd = 'nm';
my $nm_opt = '';
@@ -130,7 +130,7 @@
my ($Code, $Data, $Init, $Uninit, $Const, $Mutable,
$Global, $Local, $Undef, $Def, $File,
- $ObjectName, $Type, $LongType, $Help, $Version);
+ $ObjectName, $Type, $BSD, $Long, $Help, $Version);
sub show_version {
print "$ME: $VERSION ( $RCS_DATE)\n";
@@ -155,8 +155,9 @@
You can try GNU nm if you want this feature.
--objectname prepend the object name before the symbol name
--t append the short BSD-style type (in parentheses above)
---type=bsd same as --t
+--type=bsd same as --t (also -B works)
--type=long append a long type (e.g. "global_const_init_data" versus "R")
+ (also -L works)
--help show this help
--version show version
All the options can be shortened to their unique prefixes,
@@ -198,6 +199,8 @@
'file!' => \$File,
'objectname' => \$ObjectName,
't' => \$Type,
+ 'bsd|B' => \$BSD,
+ 'long|L' => \$Long,
'type:s' => \$Type,
'help' => \$Help,
'version' => \$Version,
@@ -240,7 +243,9 @@
$Undef ||= !$Def if defined $Def && !defined $Undef;
my %Type; @Type{qw(bsd long)} = ();
-$Type = 'bsd' if defined $Type && $Type eq '1'; # So they used --t.
+$Type = 'bsd' if $BSD ||
+ (defined $Type && $Type eq '1'); # So they used --t.
+$Type = 'long' if $Long;
die "$ME: --type=$Type unknown\n"
if defined $Type && $Type ne '' && !exists $Type{$Type};