From 1071076be17acb1fa959c0ed1a6ddd8fe12e2d45 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Thu, 4 Apr 2019 14:49:05 +0200 Subject: [PATCH] coredump: enhancement of example file To make it more user-friendly by getting rid of empty prompts in output Signed-off-by: Adrian Bonislawski --- tools/coredumper/sof-coredump-to-gdb.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/coredumper/sof-coredump-to-gdb.sh b/tools/coredumper/sof-coredump-to-gdb.sh index a35c86f24..8671d2f3b 100755 --- a/tools/coredumper/sof-coredump-to-gdb.sh +++ b/tools/coredumper/sof-coredump-to-gdb.sh @@ -8,11 +8,15 @@ elf="${1}" dump="${2}" reader_name="sof-coredump-reader.py" # in case it is changed -reader_output="$(${THIS_SCRIPT_DIR}/${reader_name} -vc -i ${dump} --stdout -l 4)" +reader_output="$(${THIS_SCRIPT_DIR}/${reader_name} -vc -i ${dump} -l 4 \ + -o coredump-reader-output.txt)" reader_result="$?" # if $reader_name script fails, running xt-gdb is pointless if [[ ${reader_result} -ne 0 ]] ; then echo "${reader_name} failed!" exit ${reader_result} else - xt-gdb "${elf}" < <(echo "${reader_output}") + (echo "${reader_output}") + echo "quit" >> coredump-reader-output.txt + xt-gdb -q "${elf}" --command=coredump-reader-output.txt + rm -rf coredump-reader-output.txt fi