Skip to content

Conversation

@kurtjd
Copy link
Contributor

@kurtjd kurtjd commented Aug 26, 2025

This PR implements the TUI for the Debug service. Allows for parsing of defmt logs assuming correct ELF file is provided, then displays logs in a scrolling view. Also allows arbitrary text commands to be sent to the service or to be handled by the TUI if applicable.

Mock uses an actual ELF containing defmt strings (mock-bin) and manually generates raw defmt frames that correspond to appropriate strings in .defmt. This should be built from the mock-bin-src folder and ideally placed in /rust root (though doesn't have to be).

Introduces Rust notification handling library that safely wraps C library and fixes a few race conditions found in the C library.

Other minor changes:

  • Changed render to accept &mut self to allow render to update state (since log area needs to know change in render area to handle scrolling correctly)
  • Changed title() to return owned String to allow for change at runtime (so debug tab can display binary name)
  • Removed Q as quit, since the debug command box accepts arbitrary characters
  • Made arrow keys only change tabs if shift is not held (so Shift + Left/Right can be used to scroll)
  • Added clap-based command-line arg parsing (which currently the Debug tab makes use of to pass in an ELF)

Some issues need to be resolved within the secure partition and EC side before this is fully useable, but from the app perspective most things should be functional.

Resolves #31

image

@kurtjd kurtjd self-assigned this Aug 26, 2025
@kurtjd kurtjd requested review from a team, philgweber and williampMSFT as code owners August 26, 2025 01:58
@kurtjd kurtjd added the enhancement New feature or request label Aug 26, 2025
@kurtjd kurtjd requested review from JamesHuard, dymk and gjpmsft August 26, 2025 01:58
@kurtjd kurtjd moved this to In review in Embedded Controller Aug 26, 2025
@kurtjd kurtjd marked this pull request as draft August 26, 2025 01:59
philgweber
philgweber previously approved these changes Aug 26, 2025
Copy link
Collaborator

@philgweber philgweber left a comment

Choose a reason for hiding this comment

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

I'll be providing API for notification registration shortly as well, then we can add that.

@kurtjd kurtjd force-pushed the add-debug-tab branch 6 times, most recently from 47e06dc to 2d6161e Compare August 27, 2025 17:37
@kurtjd kurtjd mentioned this pull request Aug 27, 2025
@kurtjd kurtjd force-pushed the add-debug-tab branch 4 times, most recently from 3cb2a3f to c3d0277 Compare August 28, 2025 16:18
felipebalbi
felipebalbi previously approved these changes Aug 28, 2025
@kurtjd kurtjd dismissed felipebalbi’s stale review August 28, 2025 16:47

The merge-base changed after approval.

@kurtjd kurtjd force-pushed the add-debug-tab branch 2 times, most recently from 91a423c to b3d35b3 Compare September 5, 2025 18:41
@kurtjd kurtjd changed the title Implement debug tab Implement debug tab and notification support Sep 5, 2025
@kurtjd
Copy link
Contributor Author

kurtjd commented Sep 5, 2025

Updated this to include notification support as part of the PR since the initial development of it is tightly linked to the debug tab. Included source for the mock-bin allowing it to be built instead of including the binary directly.

@kurtjd kurtjd marked this pull request as ready for review September 5, 2025 18:48
philgweber
philgweber previously approved these changes Sep 8, 2025
Copy link
Collaborator

@philgweber philgweber left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning up some of the boundary race conditions. I was still thinking through all the variants of multiple people calling in at the same time. I'll review in a bit more detail as well, but this will catch several of them.

@kurtjd
Copy link
Contributor Author

kurtjd commented Sep 8, 2025

Thanks for cleaning up some of the boundary race conditions. I was still thinking through all the variants of multiple people calling in at the same time. I'll review in a bit more detail as well, but this will catch several of them.

No problem, this was mainly only an issue when the app is closed which isn't a huge deal but it was just bugging me a bit.

@kurtjd kurtjd force-pushed the add-debug-tab branch 2 times, most recently from 0cff29b to e074145 Compare September 11, 2025 20:21
@kurtjd kurtjd requested a review from felipebalbi September 23, 2025 15:52
@kurtjd
Copy link
Contributor Author

kurtjd commented Oct 20, 2025

@felipebalbi @williampMSFT Would you mind taking another look at this? Believe I've addresses most of the concerns.

@jeffglaum jeffglaum added this to the 6. ODP Partner Adoption milestone Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

e2e-demo: Implement Debug tab

4 participants