me-no-dev / EspExceptionDecoder

Exception Stack Trace Decoder for ESP8266 and ESP32
GNU General Public License v2.0
1.02k stars 137 forks source link

Allow EspExceptionDecoder to work from the CLI. #8

Open skorokithakis opened 7 years ago

skorokithakis commented 7 years ago

This may be related to #7. I don't use the Arduino IDE, so it would be great if I could just run:

java -jar ExceptionDecoder.jar <myfile.elf> <mystack.txt>

And get the decoded exception back.

boraozgen commented 7 years ago

It would be great to have this feature. I always replace the binaries compiled by the Arduino and with the ones compiled by the makefile and so on...

littleyoda commented 7 years ago

I created a CLI-Version: https://github.com/littleyoda/EspStrackTraceDecoder

me-no-dev commented 7 years ago

@littleyoda you can change your array with exceptions with the one I just added to this repo :) gives better explanation. Also you might want to make a PR to this repo's README and add link and short usage for your tool :)

me-no-dev commented 7 years ago

@ivankravets could maybe use it in platformio to further extend support for ESP?

littleyoda commented 7 years ago

@me-no-dev Thanks for the new description of the exceptions. I've added them to my tool.

me-no-dev commented 7 years ago

@littleyoda will you make a pull request with some text for this repo's README so people can easily find your tool and I can close this issue?

littleyoda commented 7 years ago

PR created

ivankravets commented 7 years ago

@me-no-dev I've jsut made quick look for https://github.com/me-no-dev/EspExceptionDecoder/blob/master/src/EspExceptionDecoder.java. Did you use Java especially for Arduino IDE? Would be good to have cross-platform tool where java is not installed. I think that this code coudl be easy ported to Python or C, where we can reuse it later on different architectures/OSs.

me-no-dev commented 7 years ago

@ivankravets yes :) It's arduino-ide plugin. Surely a python version could be made :) It just parses the given dump and extracts addresses pointing to code that then gives to addr2line. I imagine platformio was the reason @skorokithakis asked for this feature

skorokithakis commented 7 years ago

Yep, it was!

skorokithakis commented 7 years ago

I have this one liner from the Gitter channel:

rm -f stack.txt && vi stack.txt && awk '/>>>stack>>>/{flag=1;next}/<<<stack<<</{flag=0}flag' stack.txt | awk -e '{ OFS="\n"; $1=""; print }' | <path_to_tools_bin>/xtensa-lx106-elf-addr2line -aipfC -e <path_to_elf> | grep -v "?? ??:0" ; rm -f stack.txt
janLo commented 6 years ago

I just had the same problem and created https://github.com/janLo/EspArduinoExceptionDecoder