-
Notifications
You must be signed in to change notification settings - Fork 6
Can it run with another elf file? #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for submitting the proposal. I am aware that the original implementation has this capability, and I made it possible to specify an elf file path manually in the code, but I have never exposed this functionality to the UI. The original implementation derives information for decoding from the boards.txt and platform.txt files, while this new implementation is based on the Arduino CLI's compile output. I have not been able to identify a compelling use case for implementing this feature, as the selected elf file and the CLI's compile output can quickly become out of sync. Additionally, I do not have the capacity to support such GitHub issues. Could you provide a specific use case for this feature? If it is reasonable, I can consider implementing it. Please describe the scenario in which you envision using this feature. For instance, if I open IDE2 and load the previous Blink sketch, the IDE restores my previous board and port selection. Let's say an AVR Uno board has been selected (which is not supported by this extension), and the user clicks on the decode extension and selects the elf file; what should happen, or where would the stack trace come from? Adding an open file dialog action is relatively easy, but it's unclear what issue it resolves. Thank you! |
Thank you for your response!The use case for me and for a lot of other folks out there is that we don't use the Arduino IDE at all. What I do right now is that I copy the raw stack trace from the terminal into the Arduino IDE, select the ELF file from my project which is in a totally different place than Arduino IDE and decode it. When I open the Arduino IDE and select ESP Expection Decoder in the tools, it automatically opens up the windows file manager so I can search and select the ELF file I want. This is really good because I don't rely on any IDE or any compiler, just the raw ELF file. The best thing would be to make the decoder into a standalone application instead of an Arduino IDE tool so anyone could use it without the IDE dependency. This way it could be integrated into any workflow and make it more robust. For example it would be benefical to decode Core Dumps generated by IDF on crash. My application reads the Core Dump partition on boot if it was crashed the last time and I can download this data as a file. After I can open the ESP-IDF 5.2 PowerShell, cd into my project dir and run this command to decode the stack trace: Since there is no standalone decoder application and every version is integrated into an existing IDE or into some other program, of course I don't expect from you or from anyone else to do it since it satisfies almost every use case right now. Thank you very much for reading! |
You can find several standalone exception decoder tools listed in the threads on these issues in the Arduino IDE 1.x tool's repo: |
@per1234 Thank you very much for the links. Will check them out! |
I am open to the idea of extracting the decoder logic into a standalone command-line interface, but I do not plan to implement this feature within the decoder extension. I see a few concerns regarding a new CLI:
The topic of the command-line interface is open for discussion. Please use this issue to share your input. Proposal for the TraceBreaker (
|
Option | Description |
---|---|
--riscv |
Switch to RISC-V decoder mode |
--file <path> |
Read input from a file instead of stdin |
--version |
Print version information and exit |
-v |
Enable verbose mode |
-vv |
Enable very verbose mode |
--no-color |
Disable ANSI coloring |
Modes of Operation
trbr
can run in two modes:
-
Interactive Mode (The terminal is in full-screen mode)
- Reads stack traces from stdin (via
|
or<()
redirection). - Allows the user to paste stack traces manually to process.
- Reads stack traces from stdin (via
-
File Mode (
--file <path>
)- Reads stack traces from a file instead of stdin.
Example Usage
1. Interactive Mode (stdin)
Using piped input from another command:
serial_monitor | trbr /path/to/gdb /path/to/firmware.elf
Using process substitution:
trbr /path/to/gdb /path/to/firmware.elf <(less)
Pasting input manually:
trbr /path/to/gdb /path/to/firmware.elf
2. File Mode
Provides the input from a file:
trbr /path/to/gdb /path/to/firmware.elf --file trace.log
3. Other
Use the --riscv
flag to switch to RISC-V mode:
trbr /path/to/gdb /path/to/firmware.elf --riscv
👆, the current exception decoder extension can infer this info from the FQBN of the board, but users should control it with this lower-level CLI.
--verbose
mode
trbr /path/to/gdb /path/to/firmware.elf -v
--very-verbose
mode
trbr /path/to/gdb /path/to/firmware.elf -vv
--no-color
to disable ANSI coloring
trbr /path/to/gdb /path/to/firmware.elf --no-color
From #6 (comment):
@dirkvranckaert, can you please explain your use case more? |
I have a membership that I plan to keep active for the foreseeable future. I am happy to allow the notarization to be done via my Apple Developer account if that would be helpful. |
@dankeboy36 I'm collecting 'stacktraces' from ESP's in production. For every version in production that we release we collect / keep the ELF file. |
Thank you, @dirkvranckaert Do you know the path to the gdb, or do you expect the CLI to determine it based on the platform? If it's the latter, the Arduino CLI needs to be included as a tool to retrieve the build properties from the FQBN and calculate the gdb path, similar to how it is done in the decoder extension. |
I could determine the path to the GDB, on the other hand if the cli could determine it based on the platform that would be nice ;-) But for me it would be good enough if I can just run it (either from CLI either from Arduino IDE) by providing the ELF, the path to the GDB and the textual (by pasting or from a file) stacktrace |
This is the use case for us too. |
Also on esp32? |
Only on esp32 right now |
@zekageri How do you report crashes to your server / backend. We are currently struggling a bit for ESP32 in heaving them reported reliably... |
Esp32 is reading the core dump partition on boot and writing it to flash as a file. This file can be sent to server or be downloaded from the esp. |
Closing in favor of https://github.com/dankeboy36/trbr. Please give it a try, you can decide how it should work. I will tweak further, but the preview binaries are available for download. I have done the manual testing only on macOS so far. Please let me know if you have any issues. |
Will try it on windows next week |
It does not start up. Just a flashing CMD window and it's gone. I have tried to disable my firewall and I have tried as administrator. |
Please open a new issue in the corresponding repo next time. Thank you for your help! Moved to dankeboy36/trbr#16. |
With the previous exception decoder you could select the .elf file before it decodes. Can it be selected with this as well?
The text was updated successfully, but these errors were encountered: