fix(debug): handle mapping edges, stray traps and dying debuggees
Assisted-by: GLM 5.3
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user