forked from qt-creator/qt-creator
Debugger: Fix passing of maximum string length
Change-Id: I96498b93bb1632de8ca960ae24ec54e31f8c0897 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -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 ¶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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user