gdb: snapshot restore breaks breakpoints

Aberta
#1,972 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
rust

Direção de pesquisa

Start with snapshot() and restore() in the host VM code, then trace how gdb breakpoint state is stored and reapplied. Compare the MSHV and WHP reset_vcpu paths with KVM's kvm_guest_debug handling, using the referenced x86_64.rs files and build.rs as entry points. Done means hardware and software breakpoints behave correctly across snapshot and restore, including when a listed breakpoint is removed afterward.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

S-confirmed
  • Hardware breakpoints are lost on MSHV and WHP. Those backends store gdb hardware breakpoints in the guest's DR0-DR7 (mshv/x86_64.rs#L853, whp/x86_64.rs#L1181). reset_vcpu zeroes those registers (x86_64.rs#L327). gdb still lists the breakpoints. KVM keeps them in kvm_guest_debug, so they survive there.
  • Software breakpoints are written into snapshot memory. gdb builds make snapshot memory writable for this (build.rs#L162).
    • snapshot() captures the 0xCC bytes. After restore nothing tracks them.
    • restore() can remove a breakpoint that sw_breakpoints still lists. Removing it later writes the saved byte over whatever the restored snapshot holds at that address.

Possible fix: keep breakpoint state on the host and apply it again after restore(). Take software breakpoints out before snapshot().

Linguagem predominante
Rust
Estrelas
4.8k
Forks
223
Merge médio
1d 18h
PRs com merge (30d)
65

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de hyperlight-dev/hyperlight

Todas as issues de hyperlight-dev/hyperlight

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.