Added script to decode exception backtraces
This commit is contained in:
32
backtrace.sh
Executable file
32
backtrace.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
GDB_BINARY=~/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gdb
|
||||||
|
ELF_FILE=.pio/build/feedc0de_usb/firmware.elf
|
||||||
|
|
||||||
|
if [[ ! -x "$GDB_BINARY" ]]
|
||||||
|
then
|
||||||
|
echo Could not find gdb binary: "$GDB_BINARY"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "$ELF_FILE" ]]
|
||||||
|
then
|
||||||
|
echo Could not find elf file: "$ELF_FILE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ls -lah "$ELF_FILE"
|
||||||
|
|
||||||
|
PARAMS=()
|
||||||
|
for i in $@
|
||||||
|
do
|
||||||
|
ADDR="$(echo "$i" | cut -d ":" -f 1)"
|
||||||
|
OUTPUT="$($GDB_BINARY --batch $ELF_FILE -ex "set listsize 1" -ex "l *$ADDR" -ex "q")"
|
||||||
|
|
||||||
|
if [[ -z "$OUTPUT" ]]
|
||||||
|
then
|
||||||
|
echo "${ADDR} gdb empty output"
|
||||||
|
else
|
||||||
|
echo "${OUTPUT}"
|
||||||
|
fi
|
||||||
|
done
|
Reference in New Issue
Block a user