summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2013-11-17 18:24:25 +0100
committerhjk <hjk121@nokiamail.com>2013-11-17 18:28:51 +0100
commit7f6c793f756042b801aba321dcfc946560a4700a (patch)
treea1c149c255d80d1a750cb4c3dca71043afcace51
parente64cc71194cbe283dfe9bd2cd688f01fcdcadf34 (diff)
downloadqt-creator-7f6c793f756042b801aba321dcfc946560a4700a.tar.gz
Debugger: Fix passing of maximum string length
Change-Id: I96498b93bb1632de8ca960ae24ec54e31f8c0897 Reviewed-by: hjk <hjk121@nokiamail.com>
-rw-r--r--share/qtcreator/debugger/gdbbridge.py2
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp4
-rw-r--r--src/plugins/debugger/gdb/pythongdbengine.cpp6
-rw-r--r--tests/manual/debugger/simple/simple_test_app.cpp13
4 files changed, 20 insertions, 5 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index c7270045e6..4fb782d8fa 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 05978ecbc1..ae83e0801f 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 1c79150c40..3fd1283799 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 &params)
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 &params)
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 88facd246c..8259122f88 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();
}