Skip to content

Commit f75e2a9

Browse files
authored
Fix flaky gdb tests by detaching from inside the bp commands (#1435)
Replace the racy 'inner continue, outer continue, quit' pattern with 'detach, quit' inside the breakpoint commands. After the previous inner continue, the inferior could exit and the gdb stub could close the remote before gdb dispatched the outer continue, producing 'Remote connection closed' and a non-zero exit. The new shape lets the host run the guest call to completion on its own after detach, with no pending remote work in gdb. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent 798dab1 commit f75e2a9

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

  • src/hyperlight_host/examples/guest-debugging

src/hyperlight_host/examples/guest-debugging/main.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,12 @@ mod tests {
265265
echo \"Stopped at hyperlight_main breakpoint\\n\"
266266
backtrace
267267
268-
continue
268+
set logging enabled off
269+
detach
270+
quit
269271
end
270272
271273
continue
272-
273-
set logging enabled off
274-
quit
275274
"
276275
);
277276

@@ -311,16 +310,14 @@ mod tests {
311310
break +2
312311
commands 2
313312
print $xmm1.v4_float
314-
continue
313+
set logging enabled off
314+
detach
315+
quit
315316
end
316317
continue
317318
end
318-
319319
320320
continue
321-
322-
set logging enabled off
323-
quit
324321
"
325322
);
326323

0 commit comments

Comments
 (0)