fix(debug): make ptrace sessions reliable on Go tracees

This commit is contained in:
2026-08-30 22:35:22 +02:00
parent 96cc70731f
commit 9cb1666b35
6 changed files with 232 additions and 39 deletions
+7
View File
@@ -178,6 +178,13 @@ func REPL(s *Session, bm *Breakpoints, codeBase uint64, funcOffset, funcSize, ar
}
regs, _ := s.GetRegs()
if bp := bm.HandleTrap(&regs); bp != nil {
// Execute the instruction under the restored breakpoint
// so the next continue cannot re-trap on the same
// breakpoint; the process parks right after it.
if err := s.Step(); err != nil {
fmt.Println(err)
break
}
name := bp.Label
if name == "" {
name = fmt.Sprintf("%#x", bp.Addr)