Skip to content
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

GDB support #451

Draft
wants to merge 11 commits into
base: dev
Choose a base branch
from

Conversation

Jhynjhiruu
Copy link

This is the work I did in the summer of 2024 during my internship, adding a basic GDB stub to the simulator.

It includes the GDB stub itself (with comments elaborating on the functionality where useful) and a small amount of documentation on basic usage (assuming familiarity with GDB).

Blockers on merging:

  • Code review (there was a discussion months ago about replacing my usage of std::optional etc.)
  • More documentation? I think I've written about the right amount, but I'm happy to explain further
  • Rebase on latest dev

I haven't done the rebase onto latest dev yet because I distinctly remember the previous GDB stub implementation sitting unmerged for two years; I'm happy to do the work in my own time, since it's my fault it's got this far behind upstream, but I'd rather not unless it's actually going to get merged.

Why is this only being PRed now, when my internship finished months ago? Well, carrying on beyond the end of my actual internship turned out to be a terrible idea, because TB1 of fourth year started and suddenly I became busy. The Christmas break gave me an opportunity to do the tiny amount of remaining work.
I've certainly learned my lesson.

Possible future work:

  • RISC-V support
  • Refactoring*
  • Rigorously testing soundness regarding writing registers/memory
  • LLDB support
  • Move to plugin system, rewrite in Rust using existing GDB stub library (this would encompass the above to a significant extent)

*for example, there's an idiom which repeats across the stub code using std::atoi and similar, wrapped in a try-catch block, to convert strings to integers; this is horrible and clutters the code a lot.

Adding support for SME2 should be fairly trivial, so I'm open to doing that in my own time (or advising someone else on how to do it) before merging.

Please feel free to ask me about anything else I've forgotten to include here - I'll remain reachable via email and I'll see comments on this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ToDo
Development

Successfully merging this pull request may close these issues.

1 participant