Skip to content

Instantly share code, notes, and snippets.

@sovcik
Created June 11, 2018 18:02
Show Gist options
  • Select an option

  • Save sovcik/f489c60f36840e5f1ca52a013c96121b to your computer and use it in GitHub Desktop.

Select an option

Save sovcik/f489c60f36840e5f1ca52a013c96121b to your computer and use it in GitHub Desktop.
Parse ESP stack trace
@echo off
rem set following to point to addr2line executable
set addr2linecmd=xtensa-lx106-elf-addr2line.exe
rem set following to point to executable you would like to debug
rem executable has to be compiled with -ggdb option in order to include debug info
set exename=c:\.......\.pioenvs\nodemcu\firmware.elf
rem set following to point to filecontaining stacktrace - only addresses
set stacktracefile=stack.txt
for /F "tokens=2,3,4,5" %%i in (%stacktracefile%) do (
for /F "eol=? tokens=* USEBACKQ" %%f in (`%addr2linecmd% -p --exe=%exename% %%i %%j %%k %%l`) do @echo %%f
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment