Commit 7f6c793f authored by hjk's avatar hjk

Debugger: Fix passing of maximum string length

Change-Id: I96498b93bb1632de8ca960ae24ec54e31f8c0897
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent e64cc711
......@@ -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("=")
......
......@@ -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);
......
......@@ -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));
}
......
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment