forked from qt-creator/qt-creator
Debugger: Fix string usages.
- Compile with QT_NO_CAST_FROM_ASCII. - Remove single character string constants. Change-Id: Icece98619b6c30e047d3fce00e6ae74bbcd53c67 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -182,7 +182,7 @@ QByteArray cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
|
|||||||
break;
|
break;
|
||||||
case WatchpointAtAddress: { // Read/write, no space here
|
case WatchpointAtAddress: { // Read/write, no space here
|
||||||
const unsigned size = bp.size ? bp.size : 1;
|
const unsigned size = bp.size ? bp.size : 1;
|
||||||
str << "r" << size << ' ' << hex << hexPrefixOn << bp.address << hexPrefixOff << dec;
|
str << 'r' << size << ' ' << hex << hexPrefixOn << bp.address << hexPrefixOff << dec;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "debuggeractions.h"
|
#include "debuggeractions.h"
|
||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
|
|
||||||
@@ -551,8 +553,9 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
|||||||
item->setDefaultValue(true);
|
item->setDefaultValue(true);
|
||||||
insertItem(ShowQmlObjectTree, item);
|
insertItem(ShowQmlObjectTree, item);
|
||||||
|
|
||||||
|
const QString qmlInspectorGroup = QLatin1String("QML.Inspector");
|
||||||
item = new SavedAction(this);
|
item = new SavedAction(this);
|
||||||
item->setSettingsKey("QML.Inspector", QLatin1String("QmlInspector.ShowAppOnTop"));
|
item->setSettingsKey(qmlInspectorGroup, QLatin1String("QmlInspector.ShowAppOnTop"));
|
||||||
item->setText(tr("Show Application On Top"));
|
item->setText(tr("Show Application On Top"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setDefaultValue(false);
|
item->setDefaultValue(false);
|
||||||
@@ -560,7 +563,7 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
|
|||||||
insertItem(ShowAppOnTop, item);
|
insertItem(ShowAppOnTop, item);
|
||||||
|
|
||||||
item = new SavedAction(this);
|
item = new SavedAction(this);
|
||||||
item->setSettingsKey("QML.Inspector", QLatin1String("QmlInspector.FromQml"));
|
item->setSettingsKey(qmlInspectorGroup, QLatin1String("QmlInspector.FromQml"));
|
||||||
item->setText(tr("Apply Changes on Save"));
|
item->setText(tr("Apply Changes on Save"));
|
||||||
item->setCheckable(true);
|
item->setCheckable(true);
|
||||||
item->setDefaultValue(false);
|
item->setDefaultValue(false);
|
||||||
@@ -611,7 +614,7 @@ QString DebuggerSettings::dump() const
|
|||||||
const QString current = item->value().toString();
|
const QString current = item->value().toString();
|
||||||
const QString default_ = item->defaultValue().toString();
|
const QString default_ = item->defaultValue().toString();
|
||||||
ts << '\n' << key << ": " << current
|
ts << '\n' << key << ": " << current
|
||||||
<< " (default: " << default_ << ")";
|
<< " (default: " << default_ << ')';
|
||||||
if (current != default_)
|
if (current != default_)
|
||||||
ts << " ***";
|
ts << " ***";
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "debuggerplugin.h"
|
#include "debuggerplugin.h"
|
||||||
|
|
||||||
#include "debuggerstartparameters.h"
|
#include "debuggerstartparameters.h"
|
||||||
@@ -563,7 +565,7 @@ void fillParameters(DebuggerStartParameters *sp, Profile *profile)
|
|||||||
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
IDevice::ConstPtr device = DeviceProfileInformation::device(profile);
|
||||||
if (device) {
|
if (device) {
|
||||||
sp->connParams = device->sshParameters();
|
sp->connParams = device->sshParameters();
|
||||||
sp->remoteChannel = QString("%1:%2").arg(sp->connParams.host).arg(sp->connParams.port);
|
sp->remoteChannel = sp->connParams.host + QLatin1Char(':') + QString::number(sp->connParams.port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3398,7 +3400,7 @@ void DebuggerPluginPrivate::testPythonDumpers1()
|
|||||||
{
|
{
|
||||||
m_testSuccess = true;
|
m_testSuccess = true;
|
||||||
QString proFile = ICore::resourcePath()
|
QString proFile = ICore::resourcePath()
|
||||||
+ "/../../tests/manual/debugger/simple/simple.pro";
|
+ QLatin1String("/../../tests/manual/debugger/simple/simple.pro");
|
||||||
testLoadProject(proFile, TestCallBack(this, "testPythonDumpers2"));
|
testLoadProject(proFile, TestCallBack(this, "testPythonDumpers2"));
|
||||||
QVERIFY(m_testSuccess);
|
QVERIFY(m_testSuccess);
|
||||||
QTestEventLoop::instance().enterLoop(20);
|
QTestEventLoop::instance().enterLoop(20);
|
||||||
@@ -3430,7 +3432,7 @@ void DebuggerPluginPrivate::testStateMachine1()
|
|||||||
{
|
{
|
||||||
m_testSuccess = true;
|
m_testSuccess = true;
|
||||||
QString proFile = ICore::resourcePath()
|
QString proFile = ICore::resourcePath()
|
||||||
+ "/../../tests/manual/debugger/simple/simple.pro";
|
+ QLatin1String("/../../tests/manual/debugger/simple/simple.pro");
|
||||||
testLoadProject(proFile, TestCallBack(this, "testStateMachine2"));
|
testLoadProject(proFile, TestCallBack(this, "testStateMachine2"));
|
||||||
QVERIFY(m_testSuccess);
|
QVERIFY(m_testSuccess);
|
||||||
QTestEventLoop::instance().enterLoop(20);
|
QTestEventLoop::instance().enterLoop(20);
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "coregdbadapter.h"
|
#include "coregdbadapter.h"
|
||||||
|
|
||||||
#include "debuggerstartparameters.h"
|
#include "debuggerstartparameters.h"
|
||||||
@@ -94,7 +96,7 @@ void GdbCoreEngine::continueSetupEngine()
|
|||||||
// Read executable from core.
|
// Read executable from core.
|
||||||
ElfReader reader(coreFileName());
|
ElfReader reader(coreFileName());
|
||||||
bool isCore = false;
|
bool isCore = false;
|
||||||
m_executable = reader.readCoreName(&isCore);
|
m_executable = QString::fromLocal8Bit(reader.readCoreName(&isCore));
|
||||||
|
|
||||||
if (!isCore) {
|
if (!isCore) {
|
||||||
showMessageBox(QMessageBox::Warning,
|
showMessageBox(QMessageBox::Warning,
|
||||||
@@ -212,7 +214,9 @@ void GdbCoreEngine::unpackCoreIfNeeded()
|
|||||||
|
|
||||||
QProcess *process = new QProcess(this);
|
QProcess *process = new QProcess(this);
|
||||||
process->setWorkingDirectory(QDir::tempPath());
|
process->setWorkingDirectory(QDir::tempPath());
|
||||||
process->start("/usr/bin/lzop", QStringList() << "-o" << m_tempCoreName << "-x" << m_coreName);
|
QStringList arguments;
|
||||||
|
arguments << QLatin1String("-o") << m_tempCoreName << QLatin1String("-x") << m_coreName;
|
||||||
|
process->start(QLatin1String("/usr/bin/lzop"), arguments);
|
||||||
connect(process, SIGNAL(finished(int)), SLOT(continueSetupEngine()));
|
connect(process, SIGNAL(finished(int)), SLOT(continueSetupEngine()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -129,7 +129,7 @@ void GdbServerStarter::portListReady()
|
|||||||
connect(&d->runner, SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int)));
|
connect(&d->runner, SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int)));
|
||||||
|
|
||||||
QByteArray cmd = "/usr/bin/gdbserver --attach :"
|
QByteArray cmd = "/usr/bin/gdbserver --attach :"
|
||||||
+ QByteArray::number(port) + " " + QByteArray::number(d->process.pid);
|
+ QByteArray::number(port) + ' ' + QByteArray::number(d->process.pid);
|
||||||
logMessage(tr("Running command: %1").arg(QString::fromLatin1(cmd)));
|
logMessage(tr("Running command: %1").arg(QString::fromLatin1(cmd)));
|
||||||
d->runner.run(cmd, d->device->sshParameters());
|
d->runner.run(cmd, d->device->sshParameters());
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "loadcoredialog.h"
|
#include "loadcoredialog.h"
|
||||||
|
|
||||||
#include "debuggerconstants.h"
|
#include "debuggerconstants.h"
|
||||||
@@ -203,7 +205,7 @@ void SelectRemoteFileDialog::selectFile()
|
|||||||
SLOT(handleSftpOperationFinished(QSsh::SftpJobId,QString)));
|
SLOT(handleSftpOperationFinished(QSsh::SftpJobId,QString)));
|
||||||
|
|
||||||
{
|
{
|
||||||
QTemporaryFile localFile(QDir::tempPath() + "/remotecore-XXXXXX");
|
QTemporaryFile localFile(QDir::tempPath() + QLatin1String("/remotecore-XXXXXX"));
|
||||||
localFile.open();
|
localFile.open();
|
||||||
m_localFile = localFile.fileName();
|
m_localFile = localFile.fileName();
|
||||||
}
|
}
|
||||||
|
@@ -61,7 +61,7 @@ public:
|
|||||||
#define DEMANGLER_ASSERT(cond) \
|
#define DEMANGLER_ASSERT(cond) \
|
||||||
do { \
|
do { \
|
||||||
if (!(cond)) { \
|
if (!(cond)) { \
|
||||||
throw InternalDemanglerException(Q_FUNC_INFO, __FILE__, __LINE__); \
|
throw InternalDemanglerException(QLatin1String(Q_FUNC_INFO), QLatin1String(__FILE__), __LINE__); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "namedemangler.h"
|
#include "namedemangler.h"
|
||||||
|
|
||||||
#include "demanglerexceptions.h"
|
#include "demanglerexceptions.h"
|
||||||
@@ -61,7 +63,7 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName)
|
|||||||
m_demangledName.clear();
|
m_demangledName.clear();
|
||||||
|
|
||||||
if (!MangledNameRule::mangledRepresentationStartsWith(m_parseState.peek())) {
|
if (!MangledNameRule::mangledRepresentationStartsWith(m_parseState.peek())) {
|
||||||
m_demangledName = m_parseState.m_mangledName;
|
m_demangledName = QLatin1String(m_parseState.m_mangledName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +78,7 @@ bool NameDemanglerPrivate::demangle(const QString &mangledName)
|
|||||||
// Uncomment for debugging.
|
// Uncomment for debugging.
|
||||||
//m_parseState.stackTop()->print(0);
|
//m_parseState.stackTop()->print(0);
|
||||||
|
|
||||||
m_demangledName = m_parseState.stackTop()->toByteArray();
|
m_demangledName = QLatin1String(m_parseState.stackTop()->toByteArray());
|
||||||
success = true;
|
success = true;
|
||||||
} catch (const ParseException &p) {
|
} catch (const ParseException &p) {
|
||||||
m_errorString = QString::fromLocal8Bit("Parse error at index %1 of mangled name '%2': %3.")
|
m_errorString = QString::fromLocal8Bit("Parse error at index %1 of mangled name '%2': %3.")
|
||||||
|
@@ -27,6 +27,9 @@
|
|||||||
**
|
**
|
||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "parsetreenodes.h"
|
#include "parsetreenodes.h"
|
||||||
|
|
||||||
#include "demanglerexceptions.h"
|
#include "demanglerexceptions.h"
|
||||||
@@ -50,7 +53,7 @@
|
|||||||
|
|
||||||
#define PARSE_RULE_AND_ADD_RESULT_AS_CHILD(nodeType) \
|
#define PARSE_RULE_AND_ADD_RESULT_AS_CHILD(nodeType) \
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(nodeType, parseState(), this)
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(nodeType, parseState(), this)
|
||||||
#define CHILD_AT(obj, index) obj->childAt(index, Q_FUNC_INFO, __FILE__, __LINE__)
|
#define CHILD_AT(obj, index) obj->childAt(index, QLatin1String(Q_FUNC_INFO), QLatin1String(__FILE__), __LINE__)
|
||||||
#define MY_CHILD_AT(index) CHILD_AT(this, index)
|
#define MY_CHILD_AT(index) CHILD_AT(this, index)
|
||||||
#define CHILD_TO_BYTEARRAY(index) MY_CHILD_AT(index)->toByteArray()
|
#define CHILD_TO_BYTEARRAY(index) MY_CHILD_AT(index)->toByteArray()
|
||||||
|
|
||||||
@@ -693,7 +696,7 @@ void ExpressionNode::parse()
|
|||||||
while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
|
while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
|
||||||
if (ADVANCE() != '_')
|
if (ADVANCE() != '_')
|
||||||
throw ParseException("Invalid expression");
|
throw ParseException(QLatin1String("Invalid expression"));
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TypeNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(TypeNode);
|
||||||
if (PEEK() == 'E')
|
if (PEEK() == 'E')
|
||||||
ADVANCE();
|
ADVANCE();
|
||||||
@@ -2074,7 +2077,7 @@ void NumberNode::parse()
|
|||||||
{
|
{
|
||||||
const char next = PEEK();
|
const char next = PEEK();
|
||||||
if (!mangledRepresentationStartsWith(next))
|
if (!mangledRepresentationStartsWith(next))
|
||||||
throw ParseException("Invalid number");
|
throw ParseException(QLatin1String("Invalid number"));
|
||||||
|
|
||||||
if (next == 'n') {
|
if (next == 'n') {
|
||||||
m_isNegative = true;
|
m_isNegative = true;
|
||||||
@@ -2799,15 +2802,15 @@ QByteArray LambdaSigNode::toByteArray() const
|
|||||||
void ClosureTypeNameNode::parse()
|
void ClosureTypeNameNode::parse()
|
||||||
{
|
{
|
||||||
if (parseState()->readAhead(2) != "Ul")
|
if (parseState()->readAhead(2) != "Ul")
|
||||||
throw ParseException("Invalid closure-type-name");
|
throw ParseException(QLatin1String("Invalid closure-type-name"));
|
||||||
parseState()->advance(2);
|
parseState()->advance(2);
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(LambdaSigNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(LambdaSigNode);
|
||||||
if (ADVANCE() != 'E')
|
if (ADVANCE() != 'E')
|
||||||
throw ParseException("invalid closure-type-name");
|
throw ParseException(QLatin1String("invalid closure-type-name"));
|
||||||
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
||||||
if (ADVANCE() != '_')
|
if (ADVANCE() != '_')
|
||||||
throw ParseException("Invalid closure-type-name");
|
throw ParseException(QLatin1String("Invalid closure-type-name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray ClosureTypeNameNode::toByteArray() const
|
QByteArray ClosureTypeNameNode::toByteArray() const
|
||||||
@@ -2841,7 +2844,7 @@ void UnnamedTypeNameNode::parse()
|
|||||||
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
||||||
if (ADVANCE() != '_')
|
if (ADVANCE() != '_')
|
||||||
throw ParseException("Invalid unnamed-type-node");
|
throw ParseException(QLatin1String("Invalid unnamed-type-node"));
|
||||||
} else {
|
} else {
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ClosureTypeNameNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ClosureTypeNameNode);
|
||||||
}
|
}
|
||||||
@@ -2877,7 +2880,7 @@ void DeclTypeNode::parse()
|
|||||||
{
|
{
|
||||||
const QByteArray start = parseState()->readAhead(2);
|
const QByteArray start = parseState()->readAhead(2);
|
||||||
if (start != "DT" && start != "Dt")
|
if (start != "DT" && start != "Dt")
|
||||||
throw ParseException("Invalid decltype");
|
throw ParseException(QLatin1String("Invalid decltype"));
|
||||||
parseState()->advance(2);
|
parseState()->advance(2);
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
|
||||||
if (ADVANCE() != 'E')
|
if (ADVANCE() != 'E')
|
||||||
@@ -2913,7 +2916,7 @@ void UnresolvedTypeRule::parse(GlobalParseState *parseState)
|
|||||||
else if (SubstitutionNode::mangledRepresentationStartsWith(next))
|
else if (SubstitutionNode::mangledRepresentationStartsWith(next))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(SubstitutionNode, parseState, parentNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD_TO_NODE(SubstitutionNode, parseState, parentNode);
|
||||||
else
|
else
|
||||||
throw ParseException("Invalid unresolved-type");
|
throw ParseException(QLatin1String("Invalid unresolved-type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2954,7 +2957,7 @@ void DestructorNameNode::parse()
|
|||||||
else if (SimpleIdNode::mangledRepresentationStartsWith(next))
|
else if (SimpleIdNode::mangledRepresentationStartsWith(next))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SimpleIdNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(SimpleIdNode);
|
||||||
else
|
else
|
||||||
throw ParseException("Invalid destructor-name");
|
throw ParseException(QLatin1String("Invalid destructor-name"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray DestructorNameNode::toByteArray() const
|
QByteArray DestructorNameNode::toByteArray() const
|
||||||
@@ -3011,7 +3014,7 @@ void BaseUnresolvedNameNode::parse()
|
|||||||
parseState()->advance(2);
|
parseState()->advance(2);
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(DestructorNameNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(DestructorNameNode);
|
||||||
} else {
|
} else {
|
||||||
throw ParseException("Invalid <base-unresolved-name>");
|
throw ParseException(QLatin1String("Invalid <base-unresolved-name>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3038,12 +3041,12 @@ bool InitializerNode::mangledRepresentationStartsWith(char c)
|
|||||||
void InitializerNode::parse()
|
void InitializerNode::parse()
|
||||||
{
|
{
|
||||||
if (parseState()->readAhead(2) != "pi")
|
if (parseState()->readAhead(2) != "pi")
|
||||||
throw ParseException("Invalid initializer");
|
throw ParseException(QLatin1String("Invalid initializer"));
|
||||||
parseState()->advance(2);
|
parseState()->advance(2);
|
||||||
while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
|
while (ExpressionNode::mangledRepresentationStartsWith(PEEK()))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(ExpressionNode);
|
||||||
if (ADVANCE() != 'E')
|
if (ADVANCE() != 'E')
|
||||||
throw ParseException("Invalid initializer");
|
throw ParseException(QLatin1String("Invalid initializer"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray InitializerNode::toByteArray() const
|
QByteArray InitializerNode::toByteArray() const
|
||||||
@@ -3093,20 +3096,20 @@ void UnresolvedNameNode::parse()
|
|||||||
UnresolvedQualifierLevelRule::parse(parseState());
|
UnresolvedQualifierLevelRule::parse(parseState());
|
||||||
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()));
|
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()));
|
||||||
if (ADVANCE() != 'E')
|
if (ADVANCE() != 'E')
|
||||||
throw ParseException("Invalid unresolev-name");
|
throw ParseException(QLatin1String("Invalid unresolved-name"));
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
|
||||||
} else if (UnresolvedTypeRule::mangledRepresentationStartsWith(PEEK())) {
|
} else if (UnresolvedTypeRule::mangledRepresentationStartsWith(PEEK())) {
|
||||||
if (m_globalNamespace)
|
if (m_globalNamespace)
|
||||||
throw ParseException("Invalid unresolved-name");
|
throw ParseException(QLatin1String("Invalid unresolved-name"));
|
||||||
UnresolvedTypeRule::parse(parseState());
|
UnresolvedTypeRule::parse(parseState());
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
|
||||||
} else {
|
} else {
|
||||||
if (!UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
|
if (!UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
|
||||||
throw ParseException("Invalid unresolved-name");
|
throw ParseException(QLatin1String("Invalid unresolved-name"));
|
||||||
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
|
while (UnresolvedQualifierLevelRule::mangledRepresentationStartsWith(PEEK()))
|
||||||
UnresolvedQualifierLevelRule::parse(parseState());
|
UnresolvedQualifierLevelRule::parse(parseState());
|
||||||
if (ADVANCE() != 'E')
|
if (ADVANCE() != 'E')
|
||||||
throw ParseException("Invalid unresolved-name");
|
throw ParseException(QLatin1String("Invalid unresolved-name"));
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(BaseUnresolvedNameNode);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -3152,19 +3155,19 @@ void FunctionParamNode::parse()
|
|||||||
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
||||||
if (ADVANCE() != '_')
|
if (ADVANCE() != '_')
|
||||||
throw ParseException("Invalid function-param");
|
throw ParseException(QLatin1String("Invalid function-param"));
|
||||||
} else if (parseState()->readAhead(2) == "fL") {
|
} else if (parseState()->readAhead(2) == "fL") {
|
||||||
parseState()->advance(2);
|
parseState()->advance(2);
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
||||||
if (ADVANCE() != 'p')
|
if (ADVANCE() != 'p')
|
||||||
throw ParseException("Invalid function-param");
|
throw ParseException(QLatin1String("Invalid function-param"));
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(CvQualifiersNode);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(CvQualifiersNode);
|
||||||
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
if (NonNegativeNumberNode<10>::mangledRepresentationStartsWith(PEEK()))
|
||||||
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
PARSE_RULE_AND_ADD_RESULT_AS_CHILD(NonNegativeNumberNode<10>);
|
||||||
if (ADVANCE() != '_')
|
if (ADVANCE() != '_')
|
||||||
throw ParseException("Invalid function-param");
|
throw ParseException(QLatin1String("Invalid function-param"));
|
||||||
} else {
|
} else {
|
||||||
throw ParseException("Invalid function-param");
|
throw ParseException(QLatin1String("Invalid function-param"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -361,7 +361,7 @@ void PdbEngine::handleBreakInsert(const PdbResponse &response)
|
|||||||
int pos1 = response.data.indexOf(" at ");
|
int pos1 = response.data.indexOf(" at ");
|
||||||
QTC_ASSERT(pos1 != -1, return);
|
QTC_ASSERT(pos1 != -1, return);
|
||||||
QByteArray bpnr = response.data.mid(11, pos1 - 11);
|
QByteArray bpnr = response.data.mid(11, pos1 - 11);
|
||||||
int pos2 = response.data.lastIndexOf(":");
|
int pos2 = response.data.lastIndexOf(':');
|
||||||
QByteArray file = response.data.mid(pos1 + 4, pos2 - pos1 - 4);
|
QByteArray file = response.data.mid(pos1 + 4, pos2 - pos1 - 4);
|
||||||
QByteArray line = response.data.mid(pos2 + 1);
|
QByteArray line = response.data.mid(pos2 + 1);
|
||||||
BreakpointResponse br;
|
BreakpointResponse br;
|
||||||
@@ -630,7 +630,7 @@ void PdbEngine::handleOutput(const QByteArray &data)
|
|||||||
{
|
{
|
||||||
//qDebug() << "READ: " << data;
|
//qDebug() << "READ: " << data;
|
||||||
m_inbuffer.append(data);
|
m_inbuffer.append(data);
|
||||||
qDebug() << "BUFFER FROM: '" << m_inbuffer << "'";
|
qDebug() << "BUFFER FROM: '" << m_inbuffer << '\'';
|
||||||
while (true) {
|
while (true) {
|
||||||
int pos = m_inbuffer.indexOf("(Pdb)");
|
int pos = m_inbuffer.indexOf("(Pdb)");
|
||||||
if (pos == -1)
|
if (pos == -1)
|
||||||
@@ -641,7 +641,7 @@ void PdbEngine::handleOutput(const QByteArray &data)
|
|||||||
m_inbuffer = m_inbuffer.mid(pos + 6);
|
m_inbuffer = m_inbuffer.mid(pos + 6);
|
||||||
emit outputReady(response);
|
emit outputReady(response);
|
||||||
}
|
}
|
||||||
qDebug() << "BUFFER LEFT: '" << m_inbuffer << "'";
|
qDebug() << "BUFFER LEFT: '" << m_inbuffer << '\'';
|
||||||
//m_inbuffer.clear();
|
//m_inbuffer.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "qmlinspectoradapter.h"
|
#include "qmlinspectoradapter.h"
|
||||||
|
|
||||||
#include "debuggeractions.h"
|
#include "debuggeractions.h"
|
||||||
@@ -117,8 +119,8 @@ QmlInspectorAdapter::QmlInspectorAdapter(QmlAdapter *debugAdapter,
|
|||||||
this, SLOT(toolsClientStatusChanged(QmlDebug::ClientStatus)));
|
this, SLOT(toolsClientStatusChanged(QmlDebug::ClientStatus)));
|
||||||
|
|
||||||
// toolbar
|
// toolbar
|
||||||
m_selectAction->setObjectName("QML Select Action");
|
m_selectAction->setObjectName(QLatin1String("QML Select Action"));
|
||||||
m_zoomAction->setObjectName("QML Zoom Action");
|
m_zoomAction->setObjectName(QLatin1String("QML Zoom Action"));
|
||||||
m_selectAction->setCheckable(true);
|
m_selectAction->setCheckable(true);
|
||||||
m_zoomAction->setCheckable(true);
|
m_zoomAction->setCheckable(true);
|
||||||
|
|
||||||
@@ -294,14 +296,14 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor)
|
|||||||
QmlJS::ModelManagerInterface::instance();
|
QmlJS::ModelManagerInterface::instance();
|
||||||
QmlJS::Document::Ptr doc = modelManager->snapshot().document(filename);
|
QmlJS::Document::Ptr doc = modelManager->snapshot().document(filename);
|
||||||
if (!doc) {
|
if (!doc) {
|
||||||
if (filename.endsWith(".qml") || filename.endsWith(".js")) {
|
if (filename.endsWith(QLatin1String(".qml")) || filename.endsWith(QLatin1String(".js"))) {
|
||||||
// add to list of docs that we have to update when
|
// add to list of docs that we have to update when
|
||||||
// snapshot figures out that there's a new document
|
// snapshot figures out that there's a new document
|
||||||
m_pendingPreviewDocumentNames.append(filename);
|
m_pendingPreviewDocumentNames.append(filename);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!doc->qmlProgram() && !filename.endsWith(".js"))
|
if (!doc->qmlProgram() && !filename.endsWith(QLatin1String(".js")))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QmlJS::Document::Ptr initdoc = m_loadedSnapshot.document(filename);
|
QmlJS::Document::Ptr initdoc = m_loadedSnapshot.document(filename);
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "qmlinspectoragent.h"
|
#include "qmlinspectoragent.h"
|
||||||
|
|
||||||
#include "debuggeractions.h"
|
#include "debuggeractions.h"
|
||||||
@@ -73,8 +75,8 @@ quint32 QmlInspectorAgent::queryExpressionResult(int debugId,
|
|||||||
const QString &expression)
|
const QString &expression)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << debugId << expression
|
qDebug() << __FUNCTION__ << '(' << debugId << expression
|
||||||
<< m_engine.debugId() << ")";
|
<< m_engine.debugId() << ')';
|
||||||
|
|
||||||
return m_engineClient->queryExpressionResult(debugId, expression,
|
return m_engineClient->queryExpressionResult(debugId, expression,
|
||||||
m_engine.debugId());
|
m_engine.debugId());
|
||||||
@@ -84,7 +86,7 @@ void QmlInspectorAgent::assignValue(const WatchData *data,
|
|||||||
const QString &expr, const QVariant &valueV)
|
const QString &expr, const QVariant &valueV)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << data->id << ")" << data->iname;
|
qDebug() << __FUNCTION__ << '(' << data->id << ')' << data->iname;
|
||||||
|
|
||||||
if (data->id) {
|
if (data->id) {
|
||||||
QString val(valueV.toString());
|
QString val(valueV.toString());
|
||||||
@@ -100,7 +102,7 @@ void QmlInspectorAgent::assignValue(const WatchData *data,
|
|||||||
void QmlInspectorAgent::updateWatchData(const WatchData &data)
|
void QmlInspectorAgent::updateWatchData(const WatchData &data)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << data.id << ")";
|
qDebug() << __FUNCTION__ << '(' << data.id << ')';
|
||||||
|
|
||||||
if (data.id && !m_fetchDataIds.contains(data.id)) {
|
if (data.id && !m_fetchDataIds.contains(data.id)) {
|
||||||
// objects
|
// objects
|
||||||
@@ -112,7 +114,7 @@ void QmlInspectorAgent::updateWatchData(const WatchData &data)
|
|||||||
bool QmlInspectorAgent::selectObjectInTree(int debugId)
|
bool QmlInspectorAgent::selectObjectInTree(int debugId)
|
||||||
{
|
{
|
||||||
if (debug) {
|
if (debug) {
|
||||||
qDebug() << __FUNCTION__ << "(" << debugId << ")";
|
qDebug() << __FUNCTION__ << '(' << debugId << ')';
|
||||||
qDebug() << " " << debugId << "already fetched? "
|
qDebug() << " " << debugId << "already fetched? "
|
||||||
<< m_debugIdToIname.contains(debugId);
|
<< m_debugIdToIname.contains(debugId);
|
||||||
}
|
}
|
||||||
@@ -141,8 +143,8 @@ quint32 QmlInspectorAgent::setBindingForObject(int objectDebugId,
|
|||||||
int line)
|
int line)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << objectDebugId << propertyName
|
qDebug() << __FUNCTION__ << '(' << objectDebugId << propertyName
|
||||||
<< value.toString() << isLiteralValue << source << line << ")";
|
<< value.toString() << isLiteralValue << source << line << ')';
|
||||||
|
|
||||||
if (objectDebugId == -1)
|
if (objectDebugId == -1)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -154,16 +156,16 @@ quint32 QmlInspectorAgent::setBindingForObject(int objectDebugId,
|
|||||||
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
log(LogSend, QString("SET_BINDING %1 %2 %3 %4").arg(
|
log(LogSend, QString::fromLatin1("SET_BINDING %1 %2 %3 %4").arg(
|
||||||
QString::number(objectDebugId), propertyName, value.toString(),
|
QString::number(objectDebugId), propertyName, value.toString(),
|
||||||
QString(isLiteralValue ? "true" : "false")));
|
QString(isLiteralValue ? QLatin1String("true") : QLatin1String("false"))));
|
||||||
|
|
||||||
quint32 queryId = m_engineClient->setBindingForObject(
|
quint32 queryId = m_engineClient->setBindingForObject(
|
||||||
objectDebugId, propertyName, value.toString(), isLiteralValue,
|
objectDebugId, propertyName, value.toString(), isLiteralValue,
|
||||||
source, line);
|
source, line);
|
||||||
|
|
||||||
if (!queryId)
|
if (!queryId)
|
||||||
log(LogSend, QString("SET_BINDING failed!"));
|
log(LogSend, QLatin1String("SET_BINDING failed!"));
|
||||||
|
|
||||||
return queryId;
|
return queryId;
|
||||||
}
|
}
|
||||||
@@ -173,8 +175,8 @@ quint32 QmlInspectorAgent::setMethodBodyForObject(int objectDebugId,
|
|||||||
const QString &methodBody)
|
const QString &methodBody)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << objectDebugId
|
qDebug() << __FUNCTION__ << '(' << objectDebugId
|
||||||
<< methodName << methodBody << ")";
|
<< methodName << methodBody << ')';
|
||||||
|
|
||||||
if (objectDebugId == -1)
|
if (objectDebugId == -1)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -183,14 +185,14 @@ quint32 QmlInspectorAgent::setMethodBodyForObject(int objectDebugId,
|
|||||||
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
log(LogSend, QString("SET_METHOD_BODY %1 %2 %3").arg(
|
log(LogSend, QString::fromLatin1("SET_METHOD_BODY %1 %2 %3").arg(
|
||||||
QString::number(objectDebugId), methodName, methodBody));
|
QString::number(objectDebugId), methodName, methodBody));
|
||||||
|
|
||||||
quint32 queryId = m_engineClient->setMethodBody(
|
quint32 queryId = m_engineClient->setMethodBody(
|
||||||
objectDebugId, methodName, methodBody);
|
objectDebugId, methodName, methodBody);
|
||||||
|
|
||||||
if (!queryId)
|
if (!queryId)
|
||||||
log(LogSend, QString("failed!"));
|
log(LogSend, QLatin1String("failed!"));
|
||||||
|
|
||||||
return queryId;
|
return queryId;
|
||||||
}
|
}
|
||||||
@@ -199,8 +201,8 @@ quint32 QmlInspectorAgent::resetBindingForObject(int objectDebugId,
|
|||||||
const QString &propertyName)
|
const QString &propertyName)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << objectDebugId
|
qDebug() << __FUNCTION__ << '(' << objectDebugId
|
||||||
<< propertyName << ")";
|
<< propertyName << ')';
|
||||||
|
|
||||||
if (objectDebugId == -1)
|
if (objectDebugId == -1)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -209,14 +211,14 @@ quint32 QmlInspectorAgent::resetBindingForObject(int objectDebugId,
|
|||||||
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
log(LogSend, QString("RESET_BINDING %1 %2").arg(
|
log(LogSend, QString::fromLatin1("RESET_BINDING %1 %2").arg(
|
||||||
QString::number(objectDebugId), propertyName));
|
QString::number(objectDebugId), propertyName));
|
||||||
|
|
||||||
quint32 queryId = m_engineClient->resetBindingForObject(
|
quint32 queryId = m_engineClient->resetBindingForObject(
|
||||||
objectDebugId, propertyName);
|
objectDebugId, propertyName);
|
||||||
|
|
||||||
if (!queryId)
|
if (!queryId)
|
||||||
log(LogSend, QString("failed!"));
|
log(LogSend, QLatin1String("failed!"));
|
||||||
|
|
||||||
return queryId;
|
return queryId;
|
||||||
}
|
}
|
||||||
@@ -291,7 +293,7 @@ QHash<int,QString> QmlInspectorAgent::rootObjectIds() const
|
|||||||
if (!data)
|
if (!data)
|
||||||
continue;
|
continue;
|
||||||
int debugId = data->id;
|
int debugId = data->id;
|
||||||
QString className = data->type;
|
QString className = QLatin1String(data->type);
|
||||||
rIds.insert(debugId, className);
|
rIds.insert(debugId, className);
|
||||||
}
|
}
|
||||||
return rIds;
|
return rIds;
|
||||||
@@ -300,7 +302,7 @@ QHash<int,QString> QmlInspectorAgent::rootObjectIds() const
|
|||||||
bool QmlInspectorAgent::addObjectWatch(int objectDebugId)
|
bool QmlInspectorAgent::addObjectWatch(int objectDebugId)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << objectDebugId << ")";
|
qDebug() << __FUNCTION__ << '(' << objectDebugId << ')';
|
||||||
|
|
||||||
if (objectDebugId == -1)
|
if (objectDebugId == -1)
|
||||||
return false;
|
return false;
|
||||||
@@ -330,7 +332,7 @@ bool QmlInspectorAgent::isObjectBeingWatched(int objectDebugId)
|
|||||||
bool QmlInspectorAgent::removeObjectWatch(int objectDebugId)
|
bool QmlInspectorAgent::removeObjectWatch(int objectDebugId)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << objectDebugId << ")";
|
qDebug() << __FUNCTION__ << '(' << objectDebugId << ')';
|
||||||
|
|
||||||
if (objectDebugId == -1)
|
if (objectDebugId == -1)
|
||||||
return false;
|
return false;
|
||||||
@@ -418,14 +420,14 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "() ...";
|
qDebug() << __FUNCTION__ << "() ...";
|
||||||
|
|
||||||
if (type == _("FETCH_OBJECT_R")) {
|
if (type == "FETCH_OBJECT_R") {
|
||||||
log(LogReceive, _("FETCH_OBJECT_R %1").arg(
|
log(LogReceive, _("FETCH_OBJECT_R %1").arg(
|
||||||
qvariant_cast<ObjectReference>(value).idString()));
|
qvariant_cast<ObjectReference>(value).idString()));
|
||||||
} else if (type == _("SET_BINDING_R")
|
} else if (type == "SET_BINDING_R"
|
||||||
|| type == _("RESET_BINDING_R")
|
|| type == "RESET_BINDING_R"
|
||||||
|| type == _("SET_METHOD_BODY_R")) {
|
|| type == "SET_METHOD_BODY_R") {
|
||||||
QString msg = QLatin1String(type) + tr(" success : ");
|
QString msg = QLatin1String(type) + tr(" success : ");
|
||||||
msg += value.toBool() ? "1" : "0";
|
msg += value.toBool() ? QLatin1Char('1') : QLatin1Char('0');
|
||||||
if (!value.toBool())
|
if (!value.toBool())
|
||||||
emit automaticUpdateFailed();
|
emit automaticUpdateFailed();
|
||||||
log(LogReceive, msg);
|
log(LogReceive, msg);
|
||||||
@@ -470,13 +472,13 @@ void QmlInspectorAgent::newObject(int engineId, int objectId, int /*parentId*/)
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "()";
|
qDebug() << __FUNCTION__ << "()";
|
||||||
|
|
||||||
log(LogReceive, QString("OBJECT_CREATED"));
|
log(LogReceive, QLatin1String("OBJECT_CREATED"));
|
||||||
|
|
||||||
if (m_engine.debugId() != engineId)
|
if (m_engine.debugId() != engineId)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_newObjectsCreated = true;
|
m_newObjectsCreated = true;
|
||||||
if (m_engineClient->objectName() == QmlDebug::Constants::QML_DEBUGGER)
|
if (m_engineClient->objectName() == QLatin1String(QmlDebug::Constants::QML_DEBUGGER))
|
||||||
fetchObject(objectId);
|
fetchObject(objectId);
|
||||||
else
|
else
|
||||||
m_delayQueryTimer.start();
|
m_delayQueryTimer.start();
|
||||||
@@ -490,7 +492,7 @@ void QmlInspectorAgent::onValueChanged(int debugId, const QByteArray &propertyNa
|
|||||||
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
|
WatchHandler *watchHandler = m_debuggerEngine->watchHandler();
|
||||||
const WatchData *data = watchHandler->findData(iname);
|
const WatchData *data = watchHandler->findData(iname);
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << debugId << ")" << iname <<value.toString();
|
qDebug() << __FUNCTION__ << '(' << debugId << ')' << iname << value.toString();
|
||||||
if (data) {
|
if (data) {
|
||||||
WatchData d(*data);
|
WatchData d(*data);
|
||||||
d.value = value.toString();
|
d.value = value.toString();
|
||||||
@@ -536,7 +538,7 @@ void QmlInspectorAgent::queryEngineContext()
|
|||||||
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
log(LogSend, QString("LIST_OBJECTS"));
|
log(LogSend, QLatin1String("LIST_OBJECTS"));
|
||||||
|
|
||||||
m_rootContextQueryId
|
m_rootContextQueryId
|
||||||
= m_engineClient->queryRootContexts(m_engine);
|
= m_engineClient->queryRootContexts(m_engine);
|
||||||
@@ -545,16 +547,16 @@ void QmlInspectorAgent::queryEngineContext()
|
|||||||
void QmlInspectorAgent::fetchObject(int debugId)
|
void QmlInspectorAgent::fetchObject(int debugId)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << debugId << ")";
|
qDebug() << __FUNCTION__ << '(' << debugId << ')';
|
||||||
|
|
||||||
if (!isConnected()
|
if (!isConnected()
|
||||||
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
log(LogSend, QString("FETCH_OBJECT %1").arg(QString::number(debugId)));
|
log(LogSend, QLatin1String("FETCH_OBJECT ") + QString::number(debugId));
|
||||||
quint32 queryId = m_engineClient->queryObject(debugId);
|
quint32 queryId = m_engineClient->queryObject(debugId);
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << debugId << ")"
|
qDebug() << __FUNCTION__ << '(' << debugId << ')'
|
||||||
<< " - query id" << queryId;
|
<< " - query id" << queryId;
|
||||||
m_objectTreeQueryIds << queryId;
|
m_objectTreeQueryIds << queryId;
|
||||||
}
|
}
|
||||||
@@ -565,20 +567,20 @@ void QmlInspectorAgent::fetchContextObjectsForLocation(const QString &file,
|
|||||||
// This can be an expensive operation as it may return multiple
|
// This can be an expensive operation as it may return multiple
|
||||||
// objects. Use fetchContextObject() where possible.
|
// objects. Use fetchContextObject() where possible.
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << file << ":" << lineNumber
|
qDebug() << __FUNCTION__ << '(' << file << ':' << lineNumber
|
||||||
<< ":" << columnNumber << ")";
|
<< ':' << columnNumber << ')';
|
||||||
|
|
||||||
if (!isConnected()
|
if (!isConnected()
|
||||||
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
log(LogSend, QString("FETCH_OBJECTS_FOR_LOCATION %1:%2:%3").arg(file)
|
log(LogSend, QString::fromLatin1("FETCH_OBJECTS_FOR_LOCATION %1:%2:%3").arg(file)
|
||||||
.arg(QString::number(lineNumber)).arg(QString::number(columnNumber)));
|
.arg(QString::number(lineNumber)).arg(QString::number(columnNumber)));
|
||||||
quint32 queryId = m_engineClient->queryObjectsForLocation(QFileInfo(file).fileName(),
|
quint32 queryId = m_engineClient->queryObjectsForLocation(QFileInfo(file).fileName(),
|
||||||
lineNumber, columnNumber);
|
lineNumber, columnNumber);
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << file << ":" << lineNumber
|
qDebug() << __FUNCTION__ << '(' << file << ':' << lineNumber
|
||||||
<< ":" << columnNumber << ")" << " - query id" << queryId;
|
<< ':' << columnNumber << ')' << " - query id" << queryId;
|
||||||
|
|
||||||
m_objectTreeQueryIds << queryId;
|
m_objectTreeQueryIds << queryId;
|
||||||
}
|
}
|
||||||
@@ -587,7 +589,7 @@ void QmlInspectorAgent::fetchContextObjectsForLocation(const QString &file,
|
|||||||
void QmlInspectorAgent::fetchObjectsInContextRecursive(const ContextReference &context)
|
void QmlInspectorAgent::fetchObjectsInContextRecursive(const ContextReference &context)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << context << ")";
|
qDebug() << __FUNCTION__ << '(' << context << ')';
|
||||||
|
|
||||||
if (!isConnected()
|
if (!isConnected()
|
||||||
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
|| !debuggerCore()->boolSetting(ShowQmlObjectTree))
|
||||||
@@ -595,7 +597,7 @@ void QmlInspectorAgent::fetchObjectsInContextRecursive(const ContextReference &c
|
|||||||
|
|
||||||
foreach (const ObjectReference & obj, context.objects()) {
|
foreach (const ObjectReference & obj, context.objects()) {
|
||||||
using namespace QmlDebug::Constants;
|
using namespace QmlDebug::Constants;
|
||||||
if (m_engineClient->objectName() == QML_DEBUGGER &&
|
if (m_engineClient->objectName() == QLatin1String(QML_DEBUGGER) &&
|
||||||
m_engineClient->serviceVersion() >= CURRENT_SUPPORTED_VERSION) {
|
m_engineClient->serviceVersion() >= CURRENT_SUPPORTED_VERSION) {
|
||||||
//Fetch only root objects
|
//Fetch only root objects
|
||||||
if (obj.parentId() == -1)
|
if (obj.parentId() == -1)
|
||||||
@@ -611,7 +613,7 @@ void QmlInspectorAgent::fetchObjectsInContextRecursive(const ContextReference &c
|
|||||||
void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
|
void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << object << ")";
|
qDebug() << __FUNCTION__ << '(' << object << ')';
|
||||||
|
|
||||||
if (!object.isValid())
|
if (!object.isValid())
|
||||||
return;
|
return;
|
||||||
@@ -629,7 +631,7 @@ void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
|
|||||||
QStack<QmlDebug::ObjectReference> stack;
|
QStack<QmlDebug::ObjectReference> stack;
|
||||||
|
|
||||||
// 4.x
|
// 4.x
|
||||||
if (m_newObjectsCreated && m_engineClient->objectName() != QmlDebug::Constants::QML_DEBUGGER) {
|
if (m_newObjectsCreated && m_engineClient->objectName() != QLatin1String(QmlDebug::Constants::QML_DEBUGGER)) {
|
||||||
// We need to reverse the stack as the root objects
|
// We need to reverse the stack as the root objects
|
||||||
// are pushed to the bottom since they are fetched first.
|
// are pushed to the bottom since they are fetched first.
|
||||||
// The child objects need to placed in the correct position and therefore
|
// The child objects need to placed in the correct position and therefore
|
||||||
@@ -646,7 +648,7 @@ void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
|
|||||||
QByteArray parentIname;
|
QByteArray parentIname;
|
||||||
|
|
||||||
// 4.x
|
// 4.x
|
||||||
if (m_engineClient->objectName() != QmlDebug::Constants::QML_DEBUGGER) {
|
if (m_engineClient->objectName() != QLatin1String(QmlDebug::Constants::QML_DEBUGGER)) {
|
||||||
QHashIterator<int, QList<int> > i(m_debugIdChildIds);
|
QHashIterator<int, QList<int> > i(m_debugIdChildIds);
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
i.next();
|
i.next();
|
||||||
@@ -663,7 +665,7 @@ void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 5.x
|
// 5.x
|
||||||
if (m_engineClient->objectName() == QmlDebug::Constants::QML_DEBUGGER
|
if (m_engineClient->objectName() == QLatin1String(QmlDebug::Constants::QML_DEBUGGER)
|
||||||
&& m_newObjectsCreated && parentIname.isEmpty()) {
|
&& m_newObjectsCreated && parentIname.isEmpty()) {
|
||||||
if (watchData.count())
|
if (watchData.count())
|
||||||
break;
|
break;
|
||||||
@@ -709,7 +711,7 @@ void QmlInspectorAgent::objectTreeFetched(const ObjectReference &object)
|
|||||||
void QmlInspectorAgent::buildDebugIdHashRecursive(const ObjectReference &ref)
|
void QmlInspectorAgent::buildDebugIdHashRecursive(const ObjectReference &ref)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << ref << ")";
|
qDebug() << __FUNCTION__ << '(' << ref << ')';
|
||||||
|
|
||||||
QUrl fileUrl = ref.source().url();
|
QUrl fileUrl = ref.source().url();
|
||||||
int lineNum = ref.source().lineNumber();
|
int lineNum = ref.source().lineNumber();
|
||||||
@@ -718,7 +720,7 @@ void QmlInspectorAgent::buildDebugIdHashRecursive(const ObjectReference &ref)
|
|||||||
|
|
||||||
// handle the case where the url contains the revision number encoded.
|
// handle the case where the url contains the revision number encoded.
|
||||||
//(for object created by the debugger)
|
//(for object created by the debugger)
|
||||||
static QRegExp rx("(.*)_(\\d+):(\\d+)$");
|
static QRegExp rx(QLatin1String("(.*)_(\\d+):(\\d+)$"));
|
||||||
if (rx.exactMatch(fileUrl.path())) {
|
if (rx.exactMatch(fileUrl.path())) {
|
||||||
fileUrl.setPath(rx.cap(1));
|
fileUrl.setPath(rx.cap(1));
|
||||||
rev = rx.cap(2).toInt();
|
rev = rx.cap(2).toInt();
|
||||||
@@ -736,7 +738,7 @@ void QmlInspectorAgent::buildDebugIdHashRecursive(const ObjectReference &ref)
|
|||||||
m_debugIdLocations.insert(ref.debugId(), FileReference(filePath, lineNum, colNum));
|
m_debugIdLocations.insert(ref.debugId(), FileReference(filePath, lineNum, colNum));
|
||||||
|
|
||||||
// 4.x
|
// 4.x
|
||||||
if (m_newObjectsCreated && m_engineClient->objectName() != QmlDebug::Constants::QML_DEBUGGER) {
|
if (m_newObjectsCreated && m_engineClient->objectName() != QLatin1String(QmlDebug::Constants::QML_DEBUGGER)) {
|
||||||
QList<int> childIds;
|
QList<int> childIds;
|
||||||
foreach (const ObjectReference &c, ref.children()) {
|
foreach (const ObjectReference &c, ref.children()) {
|
||||||
childIds << c.debugId();
|
childIds << c.debugId();
|
||||||
@@ -767,7 +769,7 @@ QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj,
|
|||||||
bool append)
|
bool append)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << __FUNCTION__ << "(" << obj << parentIname << ")";
|
qDebug() << __FUNCTION__ << '(' << obj << parentIname << ')';
|
||||||
|
|
||||||
QList<WatchData> list;
|
QList<WatchData> list;
|
||||||
|
|
||||||
@@ -878,7 +880,7 @@ void QmlInspectorAgent::clearObjectTree()
|
|||||||
m_debugIdChildIds.clear();
|
m_debugIdChildIds.clear();
|
||||||
m_objectStack.clear();
|
m_objectStack.clear();
|
||||||
// reset only for 5.x.
|
// reset only for 5.x.
|
||||||
if (m_engineClient->objectName() == QmlDebug::Constants::QML_DEBUGGER)
|
if (m_engineClient->objectName() == QLatin1String(QmlDebug::Constants::QML_DEBUGGER))
|
||||||
m_newObjectsCreated = false;
|
m_newObjectsCreated = false;
|
||||||
|
|
||||||
removeAllObjectWatches();
|
removeAllObjectWatches();
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "qmllivetextpreview.h"
|
#include "qmllivetextpreview.h"
|
||||||
|
|
||||||
#include "qmlinspectoradapter.h"
|
#include "qmlinspectoradapter.h"
|
||||||
@@ -602,7 +604,7 @@ void QmlLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc)
|
|||||||
m_docWithUnappliedChanges.clear();
|
m_docWithUnappliedChanges.clear();
|
||||||
|
|
||||||
if (doc && m_previousDoc && doc->fileName() == m_previousDoc->fileName()) {
|
if (doc && m_previousDoc && doc->fileName() == m_previousDoc->fileName()) {
|
||||||
if (doc->fileName().endsWith(".js")) {
|
if (doc->fileName().endsWith(QLatin1String(".js"))) {
|
||||||
showSyncWarning(JSChangeWarning, QString(), 0, 0);
|
showSyncWarning(JSChangeWarning, QString(), 0, 0);
|
||||||
m_previousDoc = doc;
|
m_previousDoc = doc;
|
||||||
return;
|
return;
|
||||||
@@ -715,7 +717,7 @@ void QmlLiveTextPreview::showSyncWarning(
|
|||||||
foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) {
|
foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
Core::InfoBar *infoBar = editor->editorDocument()->infoBar();
|
Core::InfoBar *infoBar = editor->editorDocument()->infoBar();
|
||||||
Core::InfoBarEntry info(INFO_OUT_OF_SYNC, errorMessage);
|
Core::InfoBarEntry info(QLatin1String(INFO_OUT_OF_SYNC), errorMessage);
|
||||||
BaseToolsClient *toolsClient = m_inspectorAdapter->toolsClient();
|
BaseToolsClient *toolsClient = m_inspectorAdapter->toolsClient();
|
||||||
if (toolsClient && toolsClient->supportReload())
|
if (toolsClient && toolsClient->supportReload())
|
||||||
info.setCustomButtonInfo(tr("Reload QML"), this,
|
info.setCustomButtonInfo(tr("Reload QML"), this,
|
||||||
@@ -736,7 +738,7 @@ void QmlLiveTextPreview::removeOutofSyncInfo()
|
|||||||
foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) {
|
foreach (TextEditor::BaseTextEditorWidget *editor, m_editors) {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
Core::InfoBar *infoBar = editor->editorDocument()->infoBar();
|
Core::InfoBar *infoBar = editor->editorDocument()->infoBar();
|
||||||
infoBar->removeInfo(INFO_OUT_OF_SYNC);
|
infoBar->removeInfo(QLatin1String(INFO_OUT_OF_SYNC));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "qmlv8debuggerclient.h"
|
#include "qmlv8debuggerclient.h"
|
||||||
#include "qmlv8debuggerclientconstants.h"
|
#include "qmlv8debuggerclientconstants.h"
|
||||||
#include "debuggerstringutils.h"
|
#include "debuggerstringutils.h"
|
||||||
@@ -1409,7 +1411,7 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
|
|||||||
const QVariantMap breakData = resp.value(_(BODY)).toMap();
|
const QVariantMap breakData = resp.value(_(BODY)).toMap();
|
||||||
const QString invocationText = breakData.value(_("invocationText")).toString();
|
const QString invocationText = breakData.value(_("invocationText")).toString();
|
||||||
const QString scriptUrl = breakData.value(_("script")).toMap().value(_("name")).toString();
|
const QString scriptUrl = breakData.value(_("script")).toMap().value(_("name")).toString();
|
||||||
const QString sourceLineText = breakData.value("sourceLineText").toString();
|
const QString sourceLineText = breakData.value(_("sourceLineText")).toString();
|
||||||
|
|
||||||
bool inferiorStop = true;
|
bool inferiorStop = true;
|
||||||
|
|
||||||
@@ -1448,7 +1450,7 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
|
|||||||
params.enabled,
|
params.enabled,
|
||||||
params.lineNumber,
|
params.lineNumber,
|
||||||
newColumn,
|
newColumn,
|
||||||
QString(params.condition),
|
QString(QString::fromLatin1(params.condition)),
|
||||||
params.ignoreCount);
|
params.ignoreCount);
|
||||||
d->breakpointsSync.insert(d->sequence, internalId);
|
d->breakpointsSync.insert(d->sequence, internalId);
|
||||||
}
|
}
|
||||||
@@ -1627,7 +1629,7 @@ StackFrame QmlV8DebuggerClient::extractStackFrame(const QVariant &bodyVal, const
|
|||||||
StackFrame stackFrame;
|
StackFrame stackFrame;
|
||||||
stackFrame.level = body.value(_("index")).toInt();
|
stackFrame.level = body.value(_("index")).toInt();
|
||||||
//Do not insert the frame corresponding to the internal function
|
//Do not insert the frame corresponding to the internal function
|
||||||
if (body.value("sourceLineText").toByteArray() == INTERNAL_FUNCTION) {
|
if (body.value(QLatin1String("sourceLineText")) == QLatin1String(INTERNAL_FUNCTION)) {
|
||||||
stackFrame.level = -1;
|
stackFrame.level = -1;
|
||||||
return stackFrame;
|
return stackFrame;
|
||||||
}
|
}
|
||||||
@@ -1827,7 +1829,7 @@ void QmlV8DebuggerClient::updateEvaluationResult(int sequence, bool success, con
|
|||||||
QList<WatchData> watchDataList;
|
QList<WatchData> watchDataList;
|
||||||
WatchData data;
|
WatchData data;
|
||||||
//Do we have request to evaluate a local?
|
//Do we have request to evaluate a local?
|
||||||
if (exp.startsWith("local.")) {
|
if (exp.startsWith(QLatin1String("local."))) {
|
||||||
const WatchData *watch = watchHandler->findData(exp.toLatin1());
|
const WatchData *watch = watchHandler->findData(exp.toLatin1());
|
||||||
watchDataList << createWatchDataList(watch, body.properties, refsVal);
|
watchDataList << createWatchDataList(watch, body.properties, refsVal);
|
||||||
} else {
|
} else {
|
||||||
@@ -1959,7 +1961,7 @@ QList<WatchData> QmlV8DebuggerClient::createWatchDataList(const WatchData *paren
|
|||||||
foreach (const QVariant &property, properties) {
|
foreach (const QVariant &property, properties) {
|
||||||
QmlV8ObjectData propertyData = d->extractData(property, refsVal);
|
QmlV8ObjectData propertyData = d->extractData(property, refsVal);
|
||||||
WatchData data;
|
WatchData data;
|
||||||
data.name = propertyData.name;
|
data.name = QString::fromUtf8(propertyData.name);
|
||||||
|
|
||||||
//Check for v8 specific local data
|
//Check for v8 specific local data
|
||||||
if (data.name.startsWith(QLatin1Char('.')) || data.name.isEmpty())
|
if (data.name.startsWith(QLatin1Char('.')) || data.name.isEmpty())
|
||||||
|
@@ -62,7 +62,7 @@ QString SnapshotData::function() const
|
|||||||
if (m_frames.isEmpty())
|
if (m_frames.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
const StackFrame &frame = m_frames.at(0);
|
const StackFrame &frame = m_frames.at(0);
|
||||||
return frame.function + ":" + QString::number(frame.line);
|
return frame.function + QLatin1Char(':') + QString::number(frame.line);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SnapshotData::toString() const
|
QString SnapshotData::toString() const
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
#define QT_NO_CAST_FROM_ASCII
|
||||||
|
|
||||||
#include "watchhandler.h"
|
#include "watchhandler.h"
|
||||||
|
|
||||||
#include "breakhandler.h"
|
#include "breakhandler.h"
|
||||||
@@ -1413,7 +1415,7 @@ void WatchModel::showInEditorHelper(QString *contents, WatchItem *item, int dept
|
|||||||
contents->append(tab);
|
contents->append(tab);
|
||||||
contents->append(item->value);
|
contents->append(item->value);
|
||||||
contents->append(tab);
|
contents->append(tab);
|
||||||
contents->append(item->type);
|
contents->append(QString::fromLatin1(item->type));
|
||||||
contents->append(nl);
|
contents->append(nl);
|
||||||
foreach (WatchItem *child, item->children)
|
foreach (WatchItem *child, item->children)
|
||||||
showInEditorHelper(contents, child, depth + 1);
|
showInEditorHelper(contents, child, depth + 1);
|
||||||
|
Reference in New Issue
Block a user