-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Fix #9194 - Allow more control over crash dump #9196
base: master
Are you sure you want to change the base?
Conversation
Probably just one callback would be ok? We do have custom 'USER' reasons which are private now, but obviously can be moved to a public header. See
Any reason not to fully hide the whole internal printf with a similar flag? Or, at least hide the part of postmortem & funcs calling postmortem that print stuff, structuring it a bit different in the main func especially.
see #7496 |
Thank you for the feedback! I agree with your points. Let me elaborate a bit on the original intentions behind these changes while also addressing your suggestions.
|
@mcspr This is a proof of concept PR for an alternative solution to #9193 and also closes #9194. Could you please verify? I would appreciate any input and feedback. Thanks!
Description
This PR adds more granular control over how the crash dump is delivered, and some more features:
custom_panic_callback(panic_file, panic_line, panic_func, panic_what)
: Allows the user to additionally listen for panics (useful to record them in flash memory)ets_uart_putc1()
→crash_ets_uart_putc1()
: renamed function that prints to the Serial port. This allows the function to be overridden, possibly applying transformations on the text (useful if transmitting over a Bus-like UART, such as RS-485), remove clutter or insert additional comments (such as uptime), or completely inhibit the dump (useful is uart is connected to a peripheral device)NO_CUT_HERE
: Introduce a macro that allows disabling the "CUT HERE" message and the divider lines. Can be used to minify the number of transmitted/recorded characters over the wire or storage. Can be used with the-D
flag.ets_println()
instead ofets_putc('\n')
: This makes the new lines use the "cooked" interface instead of the "raw" one, which is also used on the staticets_printf_P()
function, which allows:printf_P(...)
crash_ets_uart_putc1()
is overridenrst_info.exccause
used instead of localexccause
for the6
exception (divide by zero): unless I'm missing something, this allows the custom_crash_handler at the end of the postmortem function to also receive a correct exception number. Useful for projects such as EspCrashSave and EspCrashSaveSpiffsAdditional notes
The naming of some functions might not be the optimal value, if you would like to suggest a better one please either modify this PR or submit a comment.