diff options
author | N.N. <matju@users.sourceforge.net> | 2009-11-06 18:37:00 +0000 |
---|---|---|
committer | N.N. <matju@users.sourceforge.net> | 2009-11-06 18:37:00 +0000 |
commit | 5a6bee4fe076e06514c6e4e538590dd3a2a5cdc3 (patch) | |
tree | ecf543b363457a0c861bfb187080a45fdeffc349 /externals/gridflow/bin/backtrace | |
parent | 5e6bb4f4786dd39158ffe02913590cc3dea21ebd (diff) |
upgrade gridflow
svn path=/trunk/; revision=12728
Diffstat (limited to 'externals/gridflow/bin/backtrace')
-rwxr-xr-x | externals/gridflow/bin/backtrace | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/externals/gridflow/bin/backtrace b/externals/gridflow/bin/backtrace new file mode 100755 index 00000000..ac1358af --- /dev/null +++ b/externals/gridflow/bin/backtrace @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +if ARGV.length != 1 + puts "usage: core.rb <corefile>" + exit 1 +end +qfile=ARGV[0].gsub /'/, "\\\\'" +x=`gdb --batch -c '#{qfile}'`.split"\n" +m=/`([^']+)/.match x[0] +f=File.open("/tmp/backtrace_#{$$}.gdb","w") +f.puts"bt" +f.puts"quit" +f.close +cmd="gdb #{m[1]} #{qfile} --command=/tmp/backtrace_#{$$}.gdb" +x=`#{cmd}`.split("\n") +i=nil +x.each_with_index {|line,i| break if /^#0/ =~ line } +x[0..i]=[] +puts x |