diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index c7270045e6abaabc95358bc37487ca5d55d6273b..4fb782d8fa10a336719e8b0906d919c0f269888a 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -492,6 +492,8 @@ class Dumper(DumperBase): resultVarName = arg[pos:] elif arg.startswith("expanded:"): self.expandedINames = set(arg[pos:].split(",")) + elif arg.startswith("stringcutoff:"): + self.stringCutOff = int(arg[pos:]) elif arg.startswith("typeformats:"): for f in arg[pos:].split(","): pos = f.find("=") diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 05978ecbc148891d88f04fe0b4d1920c76819030..ae83e0801f1118b3708d4b8fde41450e251407fc 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1829,10 +1829,6 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response) postCommand("bbsetup"); } - postCommand("python qqStringCutOff = " - + debuggerCore()->action(MaximalStringLength)->value().toByteArray(), - ConsoleCommand|NonCriticalResponse); - m_hasPython = true; GdbMi data; data.fromStringMultiple(response.consoleStreamOutput); diff --git a/src/plugins/debugger/gdb/pythongdbengine.cpp b/src/plugins/debugger/gdb/pythongdbengine.cpp index 1c79150c40d8a4dd9bc2eae448c663876ff9893b..3fd1283799ff120e4aca90c9fd386f809ea87da6 100644 --- a/src/plugins/debugger/gdb/pythongdbengine.cpp +++ b/src/plugins/debugger/gdb/pythongdbengine.cpp @@ -37,6 +37,7 @@ #include <debugger/stackhandler.h> +#include <utils/savedaction.h> #include <utils/qtcassert.h> #define PRECONDITION QTC_CHECK(hasPython()) @@ -58,6 +59,9 @@ void GdbEngine::updateLocalsPython(const UpdateParameters ¶ms) expanded += "typeformats:" + handler->typeFormatRequests() + ' '; expanded += "formats:" + handler->individualFormatRequests(); + QByteArray cutOff = " stringcutoff:" + + debuggerCore()->action(MaximalStringLength)->value().toByteArray(); + QByteArray watchers; const QString fileName = stackHandler()->currentFrame().file; const QString function = stackHandler()->currentFrame().function; @@ -127,7 +131,7 @@ void GdbEngine::updateLocalsPython(const UpdateParameters ¶ms) resultVar = "resultvarname:" + m_resultVarName + ' '; postCommand("bb options:" + options + " vars:" + params.varList + ' ' - + resultVar + expanded + " watchers:" + watchers.toHex(), + + resultVar + expanded + " watchers:" + watchers.toHex() + cutOff, Discardable, CB(handleStackFramePython), QVariant(params.tryPartial)); } diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 88facd246c89f3dcf14033580cdb194797dabedb..8259122f88d0f883e81ed031dc68db53f0a105bc 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -3748,6 +3748,18 @@ namespace qstring { dummyStatement(&str, &string, pstring); } + void testQString4() + { + QString str; + for (int i = 0; i < 1000000; ++i) + str += QString::fromLatin1("%1 ").arg(i); + BREAK_HERE; + BREAK_HERE; + BREAK_HERE; + BREAK_HERE; + dummyStatement(&str); + } + void testQStringRef() { QString str = "Hello"; @@ -3763,6 +3775,7 @@ namespace qstring { testQString1(); testQString2(); testQString3(); + testQString4(); testQStringRef(); testQStringQuotes(); }