From e37b1bdfa4518d809c2d68ba0e18ad1fc60dc72b Mon Sep 17 00:00:00 2001
From: hjk <hjk@theqtcompany.com>
Date: Tue, 1 Sep 2015 15:24:10 +0200
Subject: [PATCH] Debugger: Work around lazy GDB communication

-exec-finish in 'main' results (correctly) in something like
 40^error,msg="\"finish\" not meaningful in the outermost frame."
However, this message does not seem to get flushed before
anything else happens - i.e. "never". So force some extra output
that's known to trigger a flush.

Change-Id: I3f5ef6f7cc57dd085976b239f18d6ec7bd108972
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
---
 src/plugins/debugger/gdb/gdbengine.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 5902d031d0..0e26fdcb18 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -2093,6 +2093,11 @@ void GdbEngine::executeStepOut()
     notifyInferiorRunRequested();
     showStatusMessage(tr("Finish function requested..."), 5000);
     postCommand("-exec-finish", RunRequest, CB(handleExecuteContinue));
+    // -exec-finish in 'main' results (correctly) in
+    //  40^error,msg="\"finish\" not meaningful in the outermost frame."
+    // However, this message does not seem to get flushed before
+    // anything else happen - i.e. "never". Force some extra output.
+    postCommand("print 32");
 }
 
 void GdbEngine::executeNext()
-- 
GitLab