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

vmm: Make gdb break/resuming more resilient #4363

Merged
merged 2 commits into from Jul 26, 2022

Conversation

rbradford
Copy link
Member

@rbradford rbradford commented Jul 25, 2022

When starting the VM such that it is already on a breakpoint (via
stop_on_boot) when attached to gdb then start the vCPUs in a paused
state rather than starting the vCPUs later (upon resume).

Further, make the resumption/break of the VM more resilient by only
attempting to resume the vCPUs if were are already in a break point and
only attempting to pause/break if we were already running.

Fixes: #4354

Signed-off-by: Rob Bradford robert.bradford@intel.com

@rbradford rbradford requested a review from a team as a code owner July 25, 2022 11:54
@rbradford
Copy link
Member Author

This also addresses the stepi issue from from #4331

When starting the VM such that it is already on a breakpoint (via
stop_on_boot) when attached to gdb then start the vCPUs in a paused
state rather than starting the vCPUs later (upon resume).

Further, make the resumption/break of the VM more resilient by only
attempting to resume the vCPUs if were are already in a break point and
only attempting to pause/break if we were already running.

Fixes: cloud-hypervisor#4354

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Copy link
Member

@likebreath likebreath left a comment

Choose a reason for hiding this comment

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

Took me a while to understand what behavior changes this PR introduce, but now the pause/resume logic with GDB looks much cleaner to me.

vmm/src/vm.rs Show resolved Hide resolved
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
@michael2012z
Copy link
Member

I tested the code with the GDB on AArch64 PR #4355, both breakpoint and single-step work well.

@sboeuf sboeuf merged commit 857edc7 into cloud-hypervisor:main Jul 26, 2022
@rbradford rbradford deleted the 2022-07-25-gdb-tweaks branch July 26, 2022 08:07
@rbradford rbradford added this to In progress in Release 26.0 via automation Aug 4, 2022
@rbradford rbradford moved this from In progress to Done in Release 26.0 Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

GDB failed to continue after hitting a hardware breakpoint
4 participants