{"record":{"id":"fac3db8fb4e6093d","repo":"go-delve/delve","slug":"unexpected-response-for-vcont-c","errorCode":null,"errorMessage":"unexpected response for vCont %c","messagePattern":"unexpected response for vCont %c","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/gdbserial/gdbserver_conn.go","lineNumber":893,"sourceCode":"\t\tstatus, _ := strconv.ParseUint(string(resp[1:semicolon]), 16, 8)\n\t\treturn false, stopPacket{}, proc.ErrProcessExited{Pid: conn.pid, Status: int(status)}\n\n\tcase 'N':\n\t\t// we were singlestepping the thread and the thread exited\n\t\tsp.threadID = threadID\n\t\treturn false, sp, nil\n\n\tcase 'O':\n\t\tdata := make([]byte, 0, len(resp[1:])/2)\n\t\tfor i := 1; i < len(resp); i += 2 {\n\t\t\tn, _ := strconv.ParseUint(string(resp[i:i+2]), 16, 8)\n\t\t\tdata = append(data, uint8(n))\n\t\t}\n\t\tos.Stdout.Write(data)\n\t\treturn true, sp, nil\n\n\tdefault:\n\t\treturn false, sp, fmt.Errorf(\"unexpected response for vCont %c\", resp[0])\n\t}\n}\n\nconst ctrlC = 0x03 // the ASCII character for ^C\n\n// executes a ctrl-C on the line\nfunc (conn *gdbConn) sendCtrlC() error {\n\tconn.log.Debug(\"<- interrupt\")\n\t_, err := conn.conn.Write([]byte{ctrlC})\n\treturn err\n}\n\n// queryProcessInfo executes a qProcessInfoPID (if pid != 0) or a qProcessInfo (if pid == 0)\nfunc (conn *gdbConn) queryProcessInfo(pid int) (map[string]string, error) {\n\tconn.outbuf.Reset()\n\tif pid != 0 {\n\t\tfmt.Fprintf(&conn.outbuf, \"$qProcessInfoPID:%d\", pid)\n\t} else {","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/gdbserial/gdbserver_conn.go#L875-L911","documentation":"Thrown by parseStopPacket when the vCont reply starts with a character other than the supported 'T', 'S', 'W', 'X', 'N', or 'O' responses. Delve received a first byte it does not know how to interpret as a stop/exit/output packet, so it reports the offending character.","triggerScenarios":"conn.exec of vCont returns a reply whose resp[0] is not a recognized packet type — e.g. an 'E' error packet, an empty 'OK', or text where a stop packet was expected.","commonSituations":"Stub rejecting the vCont command (replying with an error packet); stubs lacking vCont support that answered with an error string; protocol desynchronization reading a stale packet; unsupported thread actions requested.","solutions":["Check the wire log to see the actual first character and identify the stub's error reply","Verify the stub supports vCont ('vCont?' query); fall back to continue/step packets if not","Restart the debug session to clear protocol desync","Upgrade the stub or Delve if the reply is a valid-but-unsupported packet type"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Confirm vCont support before issuing continue/step:\nresp, err := conn.exec([]byte(\"vCont?\"), \"vCont support\")\nif err != nil || !bytes.Contains(resp, []byte(\"c\")) {\n    return errors.New(\"stub does not support vCont; use legacy continue\")\n}","typeGuard":null,"tryCatchPattern":"if _, _, err := conn.parseStopPacket(resp, tid, tu); err != nil && strings.Contains(err.Error(), \"unexpected response for vCont\") {\n    // stub probably replied with an error packet; inspect and fall back\n    log.Warnf(\"vCont rejected: %q\", string(resp))\n    return legacyContinue()\n}","preventionTips":["Query 'vCont?' before using vCont with a new stub","Watch for 'E' error packets in wire logs during integration","Resynchronize the connection after any unexpected first-byte reply","Test continue/step against your stub before automation"],"tags":["gdb-serial-protocol","go","vcont","unsupported-response"],"backgroundTag":"malformed-gdb-stop-packet","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}