diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2017-10-30 16:20:18 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2017-10-30 16:20:18 +0200 |
commit | 022de525be8b65fd537361ec720ec0b58af67b04 (patch) | |
tree | 110dba352cf48b3b5e8bf9281fb8a39697a2ae12 /contrib | |
parent | 2a898460db8d3d9c48c1e96e1f96f64ce9370fec (diff) |
ast_coredumper: allow setting asterisk binary explicitly
Adds an extra option, --asterisk-bin=<path> to ast_coredumper. If
provided, the binary given to gdb will be the parameter, rather than
asterisk from the PATH.
ASTERISK-27380 #close
Change-Id: I25f5b91eb75059b0fb2f142e468c26b283b0a9f3
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/ast_coredumper | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/contrib/scripts/ast_coredumper b/contrib/scripts/ast_coredumper index 81e94e945..73c79179d 100755 --- a/contrib/scripts/ast_coredumper +++ b/contrib/scripts/ast_coredumper @@ -17,6 +17,7 @@ SYNOPSIS [ --tarball-results ] [ --delete-results-after ] [ --tarball-uniqueid="<uniqueid>" ] [ --no-default-search ] [ --append-coredumps ] + [ --asterisk-bin="path" ] [ <coredump> | <pattern> ... ] DESCRIPTION @@ -96,6 +97,10 @@ DESCRIPTION Append any coredumps specified on the command line to the config file specified ones instead of overriding them. + --asterisk-binary + Path to the asterisk binary. Default: look for asterisk + in the PATH. + <coredump> | <pattern> A list of coredumps or coredump search patterns. Unless --append-coredumps was specified, these entries will override @@ -261,6 +266,9 @@ for a in "$@" ; do --tarball-uniqueid=*) tarball_uniqueid=${a#*=} ;; + --asterisk-bin=*) + asterisk_bin=${a#*=} + ;; --help|-*) print_help ;; @@ -362,7 +370,10 @@ tail -n +${ss} $0 >/tmp/.ast_coredumper.gdbinit for i in ${!COREDUMPS[@]} ; do cf=${COREDUMPS[$i]} echo "Processing $cf" - ${GDB} -n --batch -q --ex "source /tmp/.ast_coredumper.gdbinit" $(which asterisk) "$cf" 2>/dev/null | ( + if [ -z "$asterisk_bin" ]; then + asterisk_bin=$(which asterisk) + fi + ${GDB} -n --batch -q --ex "source /tmp/.ast_coredumper.gdbinit" "$asterisk_bin" "$cf" 2>/dev/null | ( of=/dev/null while IFS= read line ; do if [[ "$line" =~ !@!@!@!\ ([^\ ]+)\ !@!@!@! ]] ; then |