about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-12-27 21:39:55 +0000
committerEric Wong <mwrap-perl@80x24.org>2022-12-27 21:41:43 +0000
commit0acfabde7d5d4bccc4098aba84c47b9787a6136e (patch)
tree619b040ce02ef28f8d0f9d39afdcdff5880905d7
parent50a60a449ec17c98a146936dc9c7c7d932876f65 (diff)
downloadmwrap-0acfabde7d5d4bccc4098aba84c47b9787a6136e.tar.gz
They're useful, IMHO.  The ADDR2LINE environment can override
it, of course.
-rw-r--r--lib/Devel/Mwrap/Rproxy.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Devel/Mwrap/Rproxy.pm b/lib/Devel/Mwrap/Rproxy.pm
index 19fff59..b2bee8c 100644
--- a/lib/Devel/Mwrap/Rproxy.pm
+++ b/lib/Devel/Mwrap/Rproxy.pm
@@ -133,15 +133,17 @@ sub new {
         my ($cls, $exe) = @_;
         pipe(my ($rd, $_wr)) or die "pipe: $!";
         pipe(my ($_rd, $wr)) or die "pipe: $!";
-        my $addr2line = $ENV{ADDR2LINE} // 'addr2line';
+        # -f/--functions needs -p/--pretty-print to go with it
+        my $addr2line = $ENV{ADDR2LINE} // 'addr2line -i -p -f';
+        my @addr2line = split(/\s+/, $addr2line);
         my $pid = fork // die "fork: $!";
         if ($pid == 0) {
                 close $rd;
                 close $wr;
                 open STDIN, '<&', $_rd or die "STDIN: $!";
                 open STDOUT, '>&', $_wr or die "STDOUT: $!";
-                exec $addr2line, '-e', $exe;
-                die "exec $addr2line -e $exe: $!";
+                exec @addr2line, '-e', $exe;
+                die "exec @addr2line -e $exe: $!";
         }
         $_rd = $_wr = undef;
         $wr->autoflush(1);