From 45d3ef7b3c35e81f822283193c10166ebd982b07 Mon Sep 17 00:00:00 2001 From: Tomas Hruby Date: Thu, 23 Sep 2010 10:49:55 +0000 Subject: [PATCH] sprofalyze detects what nm to use --- commands/profile/sprofalyze.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/profile/sprofalyze.pl b/commands/profile/sprofalyze.pl index a8861a77c..908804bf7 100755 --- a/commands/profile/sprofalyze.pl +++ b/commands/profile/sprofalyze.pl @@ -12,7 +12,8 @@ # Configuration options: # Location and parameters of nm program to extract symbol tables -$nm = "/usr/bin/acknm -dn"; +$acknm = "/usr/bin/acknm -dn"; +$gnm = "/usr/pkg/bin/nm --radix=d -n"; # Location of src (including trailing /) $src_root = qw( @@ -140,6 +141,11 @@ sub read_symbols return 1; } + if (`file $fullname | grep NSYM`) { + $nm = $gnm; + } else { + $nm = $acknm; + } # Create a hash entry for each symbol table (text) entry. foreach $_ (`$nm $fullname`) { if (/^0{0,7}(\d{0,8})\s[tT]\s(\w{1,8})\n$/) { -- 2.44.0