Skip to content

Commit 7b85cd0

Browse files
ppennaCopilot
andcommitted
openvmm: pin the gdb stub's detach when a debugger session ends
OpenVMM's gdb stub never told the partition that the debugger had gone (microsoft#2094). After GDB detached, its connection dropped, or the debug worker stopped, the partition went on treating the debugger as attached: the session's hardware breakpoints and single-stepping stayed set on the VPs, the halts that followed, a power-off, reset, or triple fault included, went to the gone debugger instead of the VM's client, and a paused VM that a debugger's break held stayed held until a new session or a clear-halt. nvx never starts the gdb stub, so only a host debugging session reaches this. Pin 1633b3797af878bc9a7c42e4b9c57a2925799d5d, the head of microsoft/openvmm#5280, three commits on 043083f40, the head of microsoft/openvmm#5279, which NVX pins below this commit: - vmm_core: forget a debugger's halt reports when it detaches. A detach clears the partition's record that it told the debugger of the recorded halt, which the next session's first resume took for the debugger continuing from a halt recorded after the detach, such as a power-off, and so ran the VM again. It reports the recorded halt to the client only when the halt went to the debugger instead, no longer a second time when the client heard of it before the debugger attached. - vmm_core: clear VP debug state on detach only if the debugger set it, since the ARM64 backends of KVM and OpenHCL, which implement no guest debugging, panic when asked to clear it, which aborts the VMM. - debug_worker: detach the debugger when its session ends. The stub attaches through a guard that sends DebugRequest::Detach when it is dropped, however the session ends: GDB's D or k packet, a target exit, an error such as a dropped connection, or the worker dropping the session as it stops or restarts. The guard also forgets the session's hardware breakpoints, which the next session's first resume set on the VPs again. The Guide's gdbstub page says what a detach does. No saved state, protocol, ABI, or format, and no version of any of them, changes. NVX needs no coordinated change: the protocol vectors, the source excerpts, the contract versions, the activation bound, and the CPU profiles that nvx copies from OpenVMM match the revision's. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 16b520d commit 7b85cd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree