dankeboy36 / esp-exception-decoder

ESP8266/ESP32 Exception Decoder Extension for the Arduino IDE
MIT License
62 stars 2 forks source link

feat: ESP exception decoder tool for Arduino IDE #1

Closed dankeboy36 closed 1 year ago

dankeboy36 commented 1 year ago
kittaakos commented 1 year ago

When the path to the file contains spaces, the terminal coloring is broken.


PC: 0x400d129d: loop() (C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1\neste at with parentheses)\sketch_3\sketch_3.ino:4
EXCVADDR: 0x00000000

Decoding stack results
0x400d129a: loop() (C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1\neste at with parentheses)\sketch_3\sketch_3.ino:3
0x400d2305: loopTask(void*) at C:\Users\kittaakos\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\cores\esp32\main.cpp:50

Paste exception to decode...

The raw debug message:

updateState: {"decoderResult":{"registerLocations":{"PC":{"address":"0x400d129d","file":"with parentheses)\\sketch_3/sketch_3.ino","line":"4","method":"loop() (C:\\Users\\kittaakos\\Desktop\\sketchbooks\\test_sketchbook__1\\neste"},"EXCVADDR":"0x00000000"},"stacktraceLines":[{"address":"0x400d129a","file":"with parentheses)\\sketch_3/sketch_3.ino","line":"3","method":"loop() (C:\\Users\\kittaakos\\Desktop\\sketchbooks\\test_sketchbook__1\\neste"},{"address":"0x400d2305","file":"C:\\Users\\kittaakos\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.9\\cores\\esp32\\main.cpp","line":"50","method":"loopTask(void*)"}]},"statusMessage":"Paste exception to decode..."}
newState: {"decoderResult":{"registerLocations":{"PC":{"address":"0x400d129d","file":"with parentheses)\\sketch_3/sketch_3.ino","line":"4","method":"loop() (C:\\Users\\kittaakos\\Desktop\\sketchbooks\\test_sketchbook__1\\neste"},"EXCVADDR":"0x00000000"},"stacktraceLines":[{"address":"0x400d129a","file":"with parentheses)\\sketch_3/sketch_3.ino","line":"3","method":"loop() (C:\\Users\\kittaakos\\Desktop\\sketchbooks\\test_sketchbook__1\\neste"},{"address":"0x400d2305","file":"C:\\Users\\kittaakos\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.9\\cores\\esp32\\main.cpp","line":"50","method":"loopTask(void*)"}]},"statusMessage":"Paste exception to decode..."}
redrawTerminal: ESP Exception Decoder
Sketch: sketch_3 FQBN: esp32:esp32:esp32da

AJ1Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). 
Debug exception reason: BREAK instr 
Core  1 register dump:
PC      : 0x400d129d  PS      : 0x00060836  A0      : 0x800d2308  A1      : 0x3ffb2270  
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000014  A5      : 0x00000004  
A6      : 0x3ffb8188  A7      : 0x80000001  A8      : 0x800d129d  A9      : 0x3ffb2250  
A10     : 0x00002710  A11     : 0x00000000  A12     : 0x00000001  A13     : 0x00000003  
A14     : 0x00000001  A15     : 0x0000e100  SAR     : 0x00000003  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x40085e50  LEND    : 0x40085e5b  LCOUNT  : 0xffffffff  

Backtrace: 0x400d129a:0x3ffb2270 0x400d2305:0x3ffb2290

PC: 0x400d129d: loop() (C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1\neste at with parentheses)\sketch_3\sketch_3.ino:4
EXCVADDR: 0x00000000

Decoding stack results
0x400d129a: loop() (C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1\neste at with parentheses)\sketch_3\sketch_3.ino:3
0x400d2305: loopTask(void*) at C:\Users\kittaakos\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\cores\esp32\main.cpp:50

Paste exception to decode...

image

dankeboy36 commented 1 year ago

When the path to the file contains spaces, the terminal coloring is broken.

The parenthesis in the path was the problem. Fixed in https://github.com/dankeboy36/esp-exception-decoder/pull/1/commits/e05fb264090762876206d3e96f08d0e00786493a.

The whitespace in the path causes the terminal link resolver to stop working in Theia. Maybe it's unsupported. In this case, here is the reference implementation: https://github.com/microsoft/vscode/issues/97941

dankeboy36 commented 1 year ago

@per1234 and @me-no-dev, could you please help me verify the first release? If yes, here are the steps:

I am open to any feedback. Thank you!

dankeboy36 commented 1 year ago

I'm not sure whether anything can be done about it in this extension, but I thought it at least worth mentioning that this causes a "Split Terminal" icon to appear on the bottom panel toolbar:

Thank you! Good idea. I can disable it in IDE2 at https://github.com/arduino/arduino-ide/pull/2110 or in another PR.

I see a fix is in progress: eclipse-theia/theia#12626

I will make the same change in IDE2.

I will also cherry-pick https://github.com/eclipse-theia/theia/pull/12587 into the Arduino IDE.

dankeboy36 commented 1 year ago

I can disable it in IDE2 at arduino/arduino-ide#2110 or in another PR.

I will also cherry-pick eclipse-theia/theia#12587 into the Arduino IDE.

The changes are in IDE2: https://github.com/arduino/arduino-ide/pull/2110

dankeboy36 commented 1 year ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: