cheribsd icon indicating copy to clipboard operation
cheribsd copied to clipboard

updated gdb stub for bhyve

Open markjdb opened this issue 9 months ago • 2 comments

This PR reverts the existing arm64 support in the bhyve gdb stub and adds an implementation that will be close to what eventually lands upstream. This version has support for C64 registers, breakpoints and single-stepping. The commits in this PR:

  1. revert the existing modifications to the gdb stub, which predate upstream support,
  2. cherry-pick a number of upstream gdb stub improvements, e.g., XML register definition support,
  3. implement breakpoints and single-stepping for arm64 (in review upstream),
  4. add awareness of capability registers and make it possible to read capabilities from guest memory.

There is a known issue where starting bhyve with -G w<port> causes the VM to abort with a tag fault once it is resumed by the debugger. I don't see any problems on a vanilla arm64 system. I'm investigating that now, but I think -G w is not terribly useful for now anyway since it stops the VM before the guest kernel is loaded, and the enhancements added here are useful on their own.

markjdb avatar May 22 '24 15:05 markjdb