Skip to content

feat(gdb): Make gdb code mostly platform/architecture-independent#1315

Open
fogti wants to merge 1 commit into
hermit-os:mainfrom
fogti:gdb-stub-arch-indep
Open

feat(gdb): Make gdb code mostly platform/architecture-independent#1315
fogti wants to merge 1 commit into
hermit-os:mainfrom
fogti:gdb-stub-arch-indep

Conversation

@fogti
Copy link
Copy Markdown
Contributor

@fogti fogti commented Mar 18, 2026

This is a squash of many intermediate, quite experimental steps, which made rebasing essentially impossible.

Supersedes fogti#1

@fogti fogti added rust Pull requests that update Rust code feature/debugger Features involving the debugging facilities of uhyve, i.e. the GDBstub implementation. labels Mar 18, 2026
@fogti fogti force-pushed the gdb-stub-arch-indep branch from 74beebd to 41ba7d8 Compare March 18, 2026 12:13
@n0toose n0toose force-pushed the gdb-stub-arch-indep branch from f37bf70 to a2f888d Compare March 18, 2026 12:38
@fogti fogti force-pushed the gdb-stub-arch-indep branch from 790dcba to f273035 Compare March 18, 2026 12:47
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 89.57746% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.12%. Comparing base (e9792a2) to head (e8ece28).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/gdb/mod.rs 85.45% 32 Missing ⚠️
src/gdb/base.rs 96.51% 3 Missing ⚠️
src/linux/mod.rs 90.00% 1 Missing ⚠️
src/vm.rs 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1315      +/-   ##
==========================================
+ Coverage   81.96%   82.12%   +0.15%     
==========================================
  Files          33       33              
  Lines        4874     4906      +32     
==========================================
+ Hits         3995     4029      +34     
+ Misses        879      877       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fogti fogti force-pushed the gdb-stub-arch-indep branch 6 times, most recently from 3305c62 to 8c1c72c Compare March 18, 2026 14:32
@fogti fogti changed the title feat(gdb): Make gdb code less Linux-dependent feat(gdb): Make gdb code mostly platform/architecture-independent Mar 18, 2026
@fogti fogti marked this pull request as ready for review March 18, 2026 14:39
@fogti fogti requested a review from jounathaen March 18, 2026 14:39
@fogti
Copy link
Copy Markdown
Contributor Author

fogti commented Mar 18, 2026

Should something be done about the integration test tests/gdb.rs still being marked as Linux-only?

@fogti fogti force-pushed the gdb-stub-arch-indep branch from 8c1c72c to aa90cfc Compare March 19, 2026 10:13
@fogti
Copy link
Copy Markdown
Contributor Author

fogti commented Mar 19, 2026

The main reason I didn't squash this yet is because we might need to undo parts of this later (e.g. the part that messes with the gdb_port presence on MacOS).

@fogti fogti force-pushed the gdb-stub-arch-indep branch from aa90cfc to 03eb026 Compare March 25, 2026 15:19
@fogti fogti force-pushed the gdb-stub-arch-indep branch from 03eb026 to 09a31e2 Compare April 7, 2026 12:45
@fogti fogti force-pushed the gdb-stub-arch-indep branch 2 times, most recently from 20c9154 to 15e0b45 Compare April 22, 2026 07:57
@fogti fogti force-pushed the gdb-stub-arch-indep branch from 15e0b45 to dec92a2 Compare April 28, 2026 13:33
Comment thread src/gdb/base.rs Outdated
Comment thread src/gdb/base.rs Outdated
Comment thread src/macos/gdb/mod.rs Outdated
Comment thread src/macos/aarch64/vcpu.rs Outdated
@fogti fogti force-pushed the gdb-stub-arch-indep branch from e847e41 to 89ec887 Compare April 29, 2026 14:56
@fogti
Copy link
Copy Markdown
Contributor Author

fogti commented Apr 29, 2026

Mergiraf wins again.

derenade ~/devel/uhyve gdb-stub-arch-indep $ git rebase origin/main
INFO Mergiraf: Solved 1 conflict. Review with: mergiraf review kvm_cpu.rs_lQIqn8hh
INFO Mergiraf: Solved 1 conflict. Review with: mergiraf review vm.rs_wzUNTc6o
INFO Mergiraf: Solved 1 conflict. Review with: mergiraf review mod.rs_cBqUPFRn
Successfully rebased and updated refs/heads/gdb-stub-arch-indep.

@fogti fogti force-pushed the gdb-stub-arch-indep branch 3 times, most recently from ada19eb to ab244b4 Compare April 29, 2026 15:13
@fogti fogti requested a review from jounathaen April 29, 2026 15:14
@fogti
Copy link
Copy Markdown
Contributor Author

fogti commented May 1, 2026

I'm sorry, but in order to make this compatible with the just-merged virtio-net PR, I'll have to squash this because it's otherwise too much work.

@fogti fogti force-pushed the gdb-stub-arch-indep branch 2 times, most recently from da13f7f to 2a06c04 Compare May 1, 2026 12:31
@fogti
Copy link
Copy Markdown
Contributor Author

fogti commented May 6, 2026

Idea for MacOS: use something like the RPC mechanism in https://github.com/YZITE/yxd-auth/blob/39b4fa42c55ac4cc5c868af81230555e690ea589/crates/kdc/src/db_.rs to deal with !Sync.

This is a squash of many intermediate, quite experimental steps,
which made rebasing essentially impossible.

- chore: stub/exclude macOS portions, fix errors
  - Use macOS-specific KickSignal
  - Fix some XhyveCpu implementations
  - Stub out/exclude unused gdb portions
  - Add placeholder AllBreakpoints for macOS
  - Add placeholder DebugExitInfo (may need to be replaced)

- refactor(gdb): Move run_gdb into crate::gdb
- refactor(vm): Move 'pub(crate) struct KickSignal' from 'os' to 'vm'
- refactor(treewide): Replace 'linux'/'macos' with 'os' for consistency
- fix(vcpu,bin): Fix cfg target attributes for MacOS
- chore(vm,bin/uhyve): Hide gdb-port cmdline option on MacOS
- docs(gdb): Add reference for IDET

Co-authored-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
@fogti fogti force-pushed the gdb-stub-arch-indep branch from 2a06c04 to e8ece28 Compare May 7, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/debugger Features involving the debugging facilities of uhyve, i.e. the GDBstub implementation. rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants