Skip to content

Commit 4c73a0e

Browse files
author
Alex J Lennon
committed
fix(vscode): GDB remotetimeout + longer remote_ssh ready_timeout
First attach runs scp/ssh/gdbserver; default GDB remotetimeout is too short and causes Connection reset during -target-select. Set miDebuggerArgs and document; increase ready_timeout_secs in board_test rsgdb.remote.toml. Made-with: Cursor
1 parent 652bb03 commit 4c73a0e

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

.vscode/launch.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"stopAtEntry": false,
1212
"MIMode": "gdb",
1313
"miDebuggerPath": "gdb-multiarch",
14+
"miDebuggerArgs": "-ex \"set remotetimeout 120\"",
1415
"miDebuggerServerAddress": "127.0.0.1:3333",
1516
"useExtendedRemote": true,
1617
"preLaunchTask": "rsgdb: board_test_app (prepare for debug)",
@@ -32,6 +33,7 @@
3233
"stopAtEntry": false,
3334
"MIMode": "gdb",
3435
"miDebuggerPath": "gdb-multiarch",
36+
"miDebuggerArgs": "-ex \"set remotetimeout 120\"",
3537
"miDebuggerServerAddress": "127.0.0.1:3333",
3638
"useExtendedRemote": true,
3739
"setupCommands": [

examples/board_test_app/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Use the **repository root** as the workspace folder so `${workspaceFolder}` reso
120120
- Port **3333** in use: stop the other process or change **`listen_port`** / **`RSGDB_PORT`** and [`.vscode/launch.json`](../../.vscode/launch.json) **`miDebuggerServerAddress`** to match.
121121
- Only **one** GDB client at a time through the proxy.
122122

123+
**`Connection reset by peer` / `Unexpected GDB output` on `-target-select`:**
124+
The first debug session runs **`scp` + `ssh` + `gdbserver`** on the board; that can take **tens of seconds**. GDB’s default **remote timeout** is short, so it may close the connection before rsgdb finishes. [`.vscode/launch.json`](../../.vscode/launch.json) sets **`miDebuggerArgs`** to **`set remotetimeout 120`**, and [`rsgdb.remote.toml`](rsgdb.remote.toml) raises **`ready_timeout_secs`**. If it still fails, confirm the board is reachable (**`ping`**, **`ssh user@host`**, **`scp`**), read **`/tmp/rsgdb-cursor-3333.log`**, and run **`RUST_LOG=info ./target/release/rsgdb --config …`** in a terminal to see rsgdb errors (failed **scp**/SSH/TCP to gdbserver closes the proxy side and shows up as reset in the IDE).
125+
123126
### Manual gdbserver on target
124127

125128
On the **target**:

examples/board_test_app/rsgdb.remote.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ user = "fio"
2222
upload_local = "examples/board_test_app/board_test_app"
2323
upload_remote = "/tmp/rsgdb_board_test_app"
2424
program = ["gdbserver", "0.0.0.0:{port}", "/tmp/rsgdb_board_test_app"]
25+
# First GDB attach triggers scp+ssh+gdbserver; allow enough time on slow links.
26+
ready_timeout_secs = 120
27+
poll_interval_ms = 100

0 commit comments

Comments
 (0)