mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Merge "ast_coredumper: Remove .gdbinit file on exit" into 16
This commit is contained in:
@@ -419,8 +419,12 @@ fi
|
|||||||
# Extract the gdb scripts from the end of this script
|
# Extract the gdb scripts from the end of this script
|
||||||
# and save them to /tmp/.gdbinit
|
# and save them to /tmp/.gdbinit
|
||||||
|
|
||||||
|
gdbinit=${OUTPUTDIR:-/tmp}/.ast_coredumper.gdbinit
|
||||||
|
|
||||||
|
trap "rm $gdbinit" EXIT
|
||||||
|
|
||||||
ss=`egrep -n "^#@@@SCRIPTSTART@@@" $0 |cut -f1 -d:`
|
ss=`egrep -n "^#@@@SCRIPTSTART@@@" $0 |cut -f1 -d:`
|
||||||
tail -n +${ss} $0 >${OUTPUTDIR:-/tmp}/.ast_coredumper.gdbinit
|
tail -n +${ss} $0 >$gdbinit
|
||||||
|
|
||||||
# Now iterate over the coredumps and dump the debugging info
|
# Now iterate over the coredumps and dump the debugging info
|
||||||
for i in ${!COREDUMPS[@]} ; do
|
for i in ${!COREDUMPS[@]} ; do
|
||||||
@@ -431,7 +435,7 @@ for i in ${!COREDUMPS[@]} ; do
|
|||||||
cfname=`basename ${cf}`
|
cfname=`basename ${cf}`
|
||||||
outputdir=${OUTPUTDIR:-${cfdir}}
|
outputdir=${OUTPUTDIR:-${cfdir}}
|
||||||
|
|
||||||
${GDB} -n --batch -q --ex "source ${OUTPUTDIR:-/tmp}/.ast_coredumper.gdbinit" "$asterisk_bin" "$cf" 2>/dev/null | (
|
${GDB} -n --batch -q --ex "source $gdbinit" "$asterisk_bin" "$cf" 2>/dev/null | (
|
||||||
of=/dev/null
|
of=/dev/null
|
||||||
while IFS= read line ; do
|
while IFS= read line ; do
|
||||||
if [[ "$line" =~ !@!@!@!\ ([^\ ]+)\ !@!@!@! ]] ; then
|
if [[ "$line" =~ !@!@!@!\ ([^\ ]+)\ !@!@!@! ]] ; then
|
||||||
|
Reference in New Issue
Block a user