mirror of
https://github.com/xdtianyu/scripts.git
synced 2025-08-08 20:00:54 +08:00
Create gdb.sh
This commit is contained in:
18
opensips/gdb.sh
Normal file
18
opensips/gdb.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
OUTPUT=/tmp/gdb.output
|
||||
|
||||
for file in $(find /tmp -maxdepth 1 -name core.*);do
|
||||
#echo $file;
|
||||
gdb -batch -ex "set logging file $file.trace" -ex "set logging on" -ex "set pagination off" -ex "bt full" -ex quit "opensips" "$file" > /dev/null 2>&1
|
||||
if [ ! -d "/tmp/opensips_coredump" ];then
|
||||
mkdir /tmp/opensips_coredump
|
||||
fi
|
||||
mv $file /tmp/opensips_coredump
|
||||
done
|
||||
|
||||
for file in $(find /tmp -maxdepth 1 -name *.trace);do
|
||||
echo -e "########## "$file" ##########\n\n" >> $OUTPUT
|
||||
cat $file >> $OUTPUT
|
||||
echo -e "\n\n" >> $OUTPUT
|
||||
rm -f $file
|
||||
done
|
Reference in New Issue
Block a user