[Asterisk-code-review] ast coredumper: Remove .gdbinit file on exit (asterisk[16])

Jenkins2 asteriskteam at digium.com
Thu Oct 4 10:00:22 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/10423 )

Change subject: ast_coredumper: Remove .gdbinit file on exit
......................................................................

ast_coredumper: Remove .gdbinit file on exit

Change-Id: I1297de78628773ca368e687c6f148bf74857cae9
---
M contrib/scripts/ast_coredumper
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Corey Farrell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/contrib/scripts/ast_coredumper b/contrib/scripts/ast_coredumper
index b2ab4ac..a098e5d 100755
--- a/contrib/scripts/ast_coredumper
+++ b/contrib/scripts/ast_coredumper
@@ -419,8 +419,12 @@
 # Extract the gdb scripts from the end of this script
 # and save them to /tmp/.gdbinit
 
+gdbinit=${OUTPUTDIR:-/tmp}/.ast_coredumper.gdbinit
+
+trap "rm $gdbinit" EXIT
+
 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
 for i in ${!COREDUMPS[@]} ; do
@@ -431,7 +435,7 @@
 	cfname=`basename ${cf}`
 	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
 		while IFS= read line ; do
 			if [[ "$line" =~ !@!@!@!\ ([^\ ]+)\ !@!@!@! ]] ; then

-- 
To view, visit https://gerrit.asterisk.org/10423
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: I1297de78628773ca368e687c6f148bf74857cae9
Gerrit-Change-Number: 10423
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181004/77d986b5/attachment.html>


More information about the asterisk-code-review mailing list