fix(debug): handle mapping edges, stray traps and dying debuggees

Assisted-by: GLM 5.3
This commit is contained in:
2026-10-02 00:40:54 +02:00
parent dd1782c538
commit f57377abb9
19 changed files with 726 additions and 97 deletions
+12 -1
View File
@@ -17,8 +17,19 @@ import (
"sourcedock.dev/petrbalvin/gasm-sdk/verify"
)
// RunTarget is the debuggee entry point (gasm debug --target).
// RunTarget is the debuggee entry point (gasm debug --target). A failure
// is marked in the handshake directory before the process exits, so the
// debugger's readiness poll fails fast on a dead debuggee instead of
// waiting out its whole budget.
func RunTarget(asmPath, funcName, argsFile, tmpDir string) error {
err := runTarget(asmPath, funcName, argsFile, tmpDir)
if err != nil {
markDead(tmpDir, err.Error())
}
return err
}
func runTarget(asmPath, funcName, argsFile, tmpDir string) error {
src, err := os.ReadFile(asmPath)
if err != nil {
return fmt.Errorf("debug target: %w", err)