From a7dc40f29086515c31667490c03211812b84e2ed Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 4 Oct 2005 02:12:44 +0000 Subject: added the remainder of the files (or almost) from GF 0.8.0 svn path=/trunk/; revision=3651 --- externals/gridflow/bin/backtrace | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 externals/gridflow/bin/backtrace (limited to 'externals/gridflow/bin/backtrace') 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 " + 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 -- cgit v1.2.1