Skip to content

Gdb debug improvements #456

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dblnz
Copy link
Contributor

@dblnz dblnz commented May 2, 2025

Purpose

I opened up this PR to address some leftover comments from a previous PR.
This closes #380 .

Description

These changes do the following

  • move the x86 vCPU specific constants to gdb/arch.rs to avoid duplicating them
  • add a function that determines the vCPU stop reason based on a series of parameters (DR6 register, exception vector)
  • modify kvm get_stop_reason method to use the hypervisor independent function described above
  • retrieve additional information from the mshv hv_message returned after a run call.
    This information serves the get_stop_reason with information on the exception that was triggered.
  • modify the mshv debugging code to use the hypervisor independent function which determines the stop reason of an x86 vCPU.

Note: I tested the scenario specified in this comment and it does present any issue

dblnz added 3 commits May 2, 2025 11:28
- this helps contain the x86 specific registers, masks isolated from
the higher level logic

Signed-off-by: Doru Blânzeanu <[email protected]>
- update kvm_debug to use this hypervisor independent function

Signed-off-by: Doru Blânzeanu <[email protected]>
@dblnz dblnz added the kind/refactor For PRs that restructure or remove code without adding new functionality. label May 2, 2025
@dblnz dblnz self-assigned this May 2, 2025
@dblnz dblnz changed the title Gdb debug improvements #380 Gdb debug improvements May 2, 2025
@dblnz dblnz changed the title #380 Gdb debug improvements Gdb debug improvements May 2, 2025
@dblnz dblnz marked this pull request as ready for review May 2, 2025 10:42
@dblnz dblnz requested a review from syntactically May 2, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor For PRs that restructure or remove code without adding new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the way vCPU stop reason is implemented to reduce code duplication
1 participant