Target --remote#4
Conversation
Code Review: Target --remote Remote Debugging SupportThanks for this PR! The overall design is solid - adding remote debugging capability plus fixing two important bugs. Here are the issues I found: 🔴 Must Fix1. Duplicate key in JSON output (cli.py lines 236-242)print_json({
"session_id": session.session_id,
"mode": session.mode,
"remote": session.remote, # First occurrence
"binary": session.binary,
"remote": session.remote, # ← DUPLICATE! Remove this line
"sock_path": session.sock_path,
...
})2. Error status not handled (handlers.py)output_status, output = result_queue.get(timeout=30.0)
return {
"command": command,
"output": output or "(no output)"
}
Suggested fix: if output_status == "error":
return {"error": output, "command": command}3. Type annotation mismatch (session.py line 53)remote: Optional[int] = None, # Should be Optional[str]The parameter is described as 🟡 Suggestions4. Missing
|
- Remove duplicate "remote" key in target JSON output - Check output_status for error in handle_exec - Fix remote type annotation from Optional[int] to Optional[str] - Add missing mi-async on for target mode non-stop - Handle queue.Empty timeout explicitly with 60s timeout - Add remote address format validation (host:port) Constraint: Must validate remote format before passing to GDB Confidence: high Scope-risk: narrow Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Description
Add the ability to connect to a GDB server with: --remote hostname:port.
Fixed 2 bugs that I found during development:
e5fb262 - Remove json.dumps() from session_meta
e05bd3e - Execute commands on the Python main thread, not the thread that receives from socket.
Type of Change
Testing
I apologize that I do not understand how the tests are written.
Checklist