提交 4d8ab0d9 authored 作者: Anthony Minessale's avatar Anthony Minessale

add gcore arg to fscore_pb

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15141 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 9d99fe8e
core=`ls -rt core.* 2> /dev/null`
#!/bin/bash
arg=$1
shift
prefix=$(cat config.status | grep @prefix@ | awk -F, '{print $3}')
if [ -z "$prefix" ] ; then
echo "Cannot determine prefix!"
exit 255
fi
if [ "$arg" = "gcore" ] ; then
user=$1
shift
fspid=`cat $prefix/log/freeswitch.pid`
echo "pulling gcore $fspid"
gcore -o core $fspid
exit
else
user=$arg
fi
core=`ls -1t core.* | head -1 2> /dev/null`
if [ -z "$core" ] ; then
core=`ls -rt core 2> /dev/null`
core=`ls -1 core 2> /dev/null`
fi
if [ -z "$core" ] ; then
core=`ls -rt freeswitch.core 2> /dev/null`
core=`ls -1 freeswitch.core 2> /dev/null`
fi
if [ -z "$core" ] ; then
......@@ -18,14 +42,14 @@ if [ -z "which gdb" ] ; then
exit 255
fi
echo "core is $core"
line="--------------------------------------------------------------------------------"
mypwd=`pwd`
tmpdir=/tmp/fscore_pb.tmp
post_file=$pwd/fscore_pb.post
user=$1
shift
if [ -z $user ] ; then
user=$SUDO_USER
......@@ -61,7 +85,7 @@ svn stat | grep -v \? >> $post_file
echo "GDB BACKTRACE:" >> $post_file
echo $line >> $post_file
gdb /usr/local/freeswitch/bin/freeswitch `echo $core | tail -n1` \
gdb $prefix/bin/freeswitch `echo $core | tail -n1` \
--eval-command="echo \n\n" \
--eval-command="set pagination off" \
--eval-command="echo Stack Trace\n" \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论