style: modernize to splitseq, cut, min, maps.copy and range-over-int

This commit is contained in:
2026-08-29 16:04:32 +02:00
parent eacf33d0f7
commit 9beff4ae85
40 changed files with 90 additions and 234 deletions
+5 -3
View File
@@ -5,6 +5,8 @@
package debug
import "strings"
import "fmt"
// Breakpoint is one INT3 breakpoint in the debuggee.
@@ -119,7 +121,7 @@ func (bm *Breakpoints) Info() string {
if len(bm.bps) == 0 {
return "no breakpoints set\n"
}
result := ""
var result strings.Builder
i := 0
for _, bp := range bm.bps {
i++
@@ -135,9 +137,9 @@ func (bm *Breakpoints) Info() string {
if bp.Cond != nil {
cond = fmt.Sprintf(" if %s %s %#x", bp.Cond.Reg, bp.Cond.Op, bp.Cond.Value)
}
result += fmt.Sprintf(" %d: %s at %#x [%s, %d hits]%s\n", i, label, bp.Addr, status, bp.hits, cond)
result.WriteString(fmt.Sprintf(" %d: %s at %#x [%s, %d hits]%s\n", i, label, bp.Addr, status, bp.hits, cond))
}
return result
return result.String()
}
// Clear removes the breakpoint at addr, restoring the original byte.