diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 8bb66e1d303..6689fb2c7bc 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -665,6 +665,9 @@ class Dumper(DumperBase): return items + def reportToken(self, args): + pass + # Hack to avoid QDate* dumper timeouts with GDB 7.4 on 32 bit # due to misaligned %ebx in SSE calls (qstring.cpp:findChar) # This seems to be fixed in 7.9 (or earlier) @@ -1086,6 +1089,7 @@ class Dumper(DumperBase): gdb.execute(cmd) def watchPoint(self, args): + self.reportToken(args) ns = self.qtNamespace() lenns = len(ns) strns = ('%d%s' % (lenns - 2, ns[:lenns - 2])) if lenns else '' @@ -1094,7 +1098,7 @@ class Dumper(DumperBase): res = self.parseAndEvaluate(expr) p = 0 if res is None else res.pointer() n = ("'%sQWidget'" % ns) if lenns else 'QWidget' - safePrint('{selected="0x%x",expr="(%s*)0x%x"}' % (p, n, p)) + self.reportResult('selected="0x%x",expr="(%s*)0x%x"' % (p, n, p), args) def nativeDynamicTypeName(self, address, baseType): # Needed for Gdb13393 test. @@ -1338,7 +1342,7 @@ class Dumper(DumperBase): frame = frame.older() i += 1 - safePrint('frames=[' + ','.join(self.output) + ']') + self.reportResult('stack={frames=[' + ','.join(self.output) + '].report}') def createResolvePendingBreakpointsHookBreakpoint(self, args): class Resolver(gdb.Breakpoint): @@ -1359,8 +1363,8 @@ class Dumper(DumperBase): def exitGdb(self, _): gdb.execute('quit') - def reportResult(self, msg, args): - print(msg) + def reportResult(self, result, args = {}): + print('result={token="%s",%s}' % (args.get("token", 0), result)) def profile1(self, args): '''Internal profiling''' diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 2c65aab1b5f..4c68489a586 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -574,6 +574,9 @@ void GdbEngine::handleResponse(const QString &buff) m_pendingLogStreamOutput.clear(); m_pendingConsoleStreamOutput.clear(); + if (response.data.data().isEmpty()) + response.data.fromString(response.consoleStreamOutput); + handleResultRecord(&response); break; } @@ -1706,8 +1709,7 @@ void GdbEngine::handlePythonSetup(const DebuggerResponse &response) { CHECK_STATE(EngineSetupRequested); if (response.resultClass == ResultDone) { - GdbMi data; - data.fromStringMultiple(response.consoleStreamOutput); + GdbMi data = response.data; watchHandler()->addDumpers(data["dumpers"]); m_pythonVersion = data["python"].toInt(); if (m_pythonVersion < 20700) { @@ -3243,12 +3245,11 @@ void GdbEngine::handleStackListFrames(const DebuggerResponse &response, bool isF return; } - GdbMi frames = response.data["stack"]; // C++ - if (!frames.isValid() || frames.childCount() == 0) { // Mixed. - GdbMi mixed; - mixed.fromStringMultiple(response.consoleStreamOutput); - frames = mixed["frames"]; - } + GdbMi stack = response.data["stack"]; // C++ + //if (!frames.isValid() || frames.childCount() == 0) // Mixed. + GdbMi frames = stack["frames"]; + if (!frames.isValid()) + isFull = true; stackHandler()->setFramesAndCurrentIndex(frames, isFull); activateFrame(stackHandler()->currentIndex());