Permalink
Browse files

added the ngx-addr2line script.

  • Loading branch information...
1 parent 8f579b3 commit 827c105efa97da3bc657f8f91a49e1b8f7ad8af7 @agentzh agentzh committed Jun 20, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 ngx-addr2line
View
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+$ENV{PATH} = "./work/nginx/sbin:$ENV{PATH}";
+while (<>) {
+ s{^nginx(\(\S*\)) \[(0x[0-9a-f]+)\]$}{
+ my $prefix = $1;
+ my $s = `addr2line -e \`which nginx\` $2`;
+ $s =~ s!.*/src\b!/src!;
+ $s =~ s! line (\d+)!:$1!;
+ $s =~ s/\s+//gs; " $prefix [$s]"
+ }e;
+ print;
+}
+

0 comments on commit 827c105

Please sign in to comment.