Don't create duplicate pipes for objects with external debuginfo.
authordbaron@dbaron.org
Thu, 22 Mar 2007 23:24:27 -0700
changeset 23 3cc95ffbc74f780bd1305b29273f7222949cd25b
parent 22 b1a52f0be0de986bee8928d18c7d223d82138155
child 24 8473a4abe3eacc527e8e4973e650fcc19065cf36
push idunknown
push userunknown
push dateunknown
milestone1.9a3pre
Don't create duplicate pipes for objects with external debuginfo.
tools/rb/fix-linux-stack.pl
--- a/tools/rb/fix-linux-stack.pl
+++ b/tools/rb/fix-linux-stack.pl
@@ -221,24 +221,21 @@ sub debuginfo_file_for($) {
 # Return a reference to a hash whose {read} and {write} entries are a
 # bidirectional pipe to an addr2line process that gives symbol
 # information for a file.
 my %pipes;
 sub addr2line_pipe($) {
     my ($file) = @_;
     my $pipe;
     unless (exists $pipes{$file}) {
-        # If it's a system library, see if we have separate debuginfo.
-        if ($file =~ /^\//) {
-            my $debuginfo_file = debuginfo_file_for($file);
-            $file = $debuginfo_file if ($debuginfo_file ne '');
-        }
+        my $debug_file = debuginfo_file_for($file);
+        $debug_file = $file if ($debug_file eq '');
 
         my $pid = open2($pipe->{read}, $pipe->{write},
-                        '/usr/bin/addr2line', '-C', '-f', '-e', $file);
+                        '/usr/bin/addr2line', '-C', '-f', '-e', $debug_file);
         $pipes{$file} = $pipe;
     } else {
         $pipe = $pipes{$file};
     }
     return $pipe;
 }
 
 while (<>) {