Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Postmortem - allow more control over crash dump#9271

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mcspr wants to merge4 commits intoesp8266:master
base:master
Choose a base branch
Loading
frommcspr:postmortem/inquisition

Conversation

mcspr
Copy link
Collaborator

ref.#9193

resolves#9194
resolves#9196

@DRSDavidSoft

this got somewhat forgotten... my draft patch was just replacing the restart, but I figured it would be better to also replace/refactor internals to make things more consistent

  • persistent & public REASON_USER_... for user callback rst_info reason
    possibly a minor breakage for anyone tracking reason==254 specifically, but very easily noticed
  • public postmortem callback functions, don't overly hide the implementation
  • put postmortem func one level down in the function chain, allow to
    override both the function itself or individual internals
    also separates rst_info modifications and output, since the idea is to strip .o from the needless PSTR(...) strings when output is disabled (~1..2KiB)
  • stack offset for -fexceptions, skip unwind data to the actual point of origin
    as top comment states, tested by throwing a dummy exception with just what(). this would stop at the~Foo() (hm) and the line throwing it

ref.esp8266#9193,esp8266#9194,esp8266#9196- persistent & public REASON_USER_... for user callback rst_info reason- public postmortem callback functions, don't overly hide the implementation- separate reasons for panic, assert, abort and c++ exceptions- put postmortem func one level down in the function chain, allow to  override both the function itself or individual internals- stack offset for -fexceptions, skip unwind data to the actual point of origin
Comment on lines +117 to +118
auto *rtc_sys =reinterpret_cast<uint32_t *>(0x60001100ul);
memset(rst_info,0,sizeof(*rst_info));
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

slightly cheaper thansystem_rtc_... and no need to remember its logic

Comment on lines +47 to +51
#ifdef__cplusplus
#defineESP8266_POSTMORTEM_NOEXCEPT noexcept
#else
#defineESP8266_POSTMORTEM_NOEXCEPT
#endif
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

General idea here is to restrict crash opportunities in the functions. Even when exceptions are on.

USF(1) = c;
}

voidcrash_system_prepare_rst_info(rst_info *rst_info,uint32_t user_reset_reason)noexcept {
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Output is optional, so rst_info has to be modified earlier

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Feature Request: Don't print stack trace to Serial on crash
1 participant
@mcspr

[8]ページ先頭

©2009-2025 Movatter.jp