gdb: snapshot restore breaks breakpoints

Abierto
#1,972 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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().

Lenguaje dominante
Rust
Estrellas
4.8k
Forks
223
Merge medio
1 d 18 h
PR fusionados (30 d)
65

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de hyperlight-dev/hyperlight

Todos los issues de hyperlight-dev/hyperlight

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.