forked from qt-creator/qt-creator
debugger: refactoring, use QByteArray instead of QString when appropriate
This commit is contained in:
@@ -139,7 +139,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_data->lineNumber = QString::number(lineNumber);
|
m_data->lineNumber = QByteArray::number(lineNumber);
|
||||||
m_data->handler()->updateMarkers();
|
m_data->handler()->updateMarkers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,13 +386,13 @@ void BreakHandler::loadBreakpoints()
|
|||||||
data->fileName = v.toString();
|
data->fileName = v.toString();
|
||||||
v = map.value(QLatin1String("linenumber"));
|
v = map.value(QLatin1String("linenumber"));
|
||||||
if (v.isValid())
|
if (v.isValid())
|
||||||
data->lineNumber = v.toString();
|
data->lineNumber = v.toString().toLatin1();
|
||||||
v = map.value(QLatin1String("condition"));
|
v = map.value(QLatin1String("condition"));
|
||||||
if (v.isValid())
|
if (v.isValid())
|
||||||
data->condition = v.toString();
|
data->condition = v.toString().toLatin1();
|
||||||
v = map.value(QLatin1String("ignorecount"));
|
v = map.value(QLatin1String("ignorecount"));
|
||||||
if (v.isValid())
|
if (v.isValid())
|
||||||
data->ignoreCount = v.toInt();
|
data->ignoreCount = v.toString().toLatin1();
|
||||||
v = map.value(QLatin1String("funcname"));
|
v = map.value(QLatin1String("funcname"));
|
||||||
if (v.isValid())
|
if (v.isValid())
|
||||||
data->funcName = v.toString();
|
data->funcName = v.toString();
|
||||||
@@ -561,7 +561,7 @@ bool BreakHandler::setData(const QModelIndex &mi, const QVariant &value, int rol
|
|||||||
case 4: {
|
case 4: {
|
||||||
QString val = value.toString();
|
QString val = value.toString();
|
||||||
if (val != data->condition) {
|
if (val != data->condition) {
|
||||||
data->condition = val;
|
data->condition = val.toLatin1();
|
||||||
dataChanged(mi, mi);
|
dataChanged(mi, mi);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -569,7 +569,7 @@ bool BreakHandler::setData(const QModelIndex &mi, const QVariant &value, int rol
|
|||||||
case 5: {
|
case 5: {
|
||||||
QString val = value.toString();
|
QString val = value.toString();
|
||||||
if (val != data->ignoreCount) {
|
if (val != data->ignoreCount) {
|
||||||
data->ignoreCount = val;
|
data->ignoreCount = val.toLatin1();
|
||||||
dataChanged(mi, mi);
|
dataChanged(mi, mi);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -660,7 +660,7 @@ void BreakHandler::setBreakpoint(const QString &fileName, int lineNumber)
|
|||||||
|
|
||||||
BreakpointData *data = new BreakpointData(this);
|
BreakpointData *data = new BreakpointData(this);
|
||||||
data->fileName = fileName;
|
data->fileName = fileName;
|
||||||
data->lineNumber = QString::number(lineNumber);
|
data->lineNumber = QByteArray::number(lineNumber);
|
||||||
data->pending = true;
|
data->pending = true;
|
||||||
data->markerFileName = fileName;
|
data->markerFileName = fileName;
|
||||||
data->markerLineNumber = lineNumber;
|
data->markerLineNumber = lineNumber;
|
||||||
|
@@ -77,18 +77,18 @@ public:
|
|||||||
|
|
||||||
// this "user requested information". will get stored in the session
|
// this "user requested information". will get stored in the session
|
||||||
QString fileName; // short name of source file
|
QString fileName; // short name of source file
|
||||||
QString condition; // condition associated with breakpoint
|
QByteArray condition; // condition associated with breakpoint
|
||||||
QString ignoreCount; // ignore count associated with breakpoint
|
QByteArray ignoreCount; // ignore count associated with breakpoint
|
||||||
QString lineNumber; // line in source file
|
QByteArray lineNumber; // line in source file
|
||||||
QString funcName; // name of containing function
|
QString funcName; // name of containing function
|
||||||
bool useFullPath; // should we use the full path when setting the bp?
|
bool useFullPath; // should we use the full path when setting the bp?
|
||||||
|
|
||||||
// this is what gdb produced in response
|
// this is what gdb produced in response
|
||||||
QString bpNumber; // breakpoint number assigned by the debugger engine
|
QByteArray bpNumber; // breakpoint number assigned by the debugger engine
|
||||||
QString bpCondition; // condition acknowledged by the debugger engine
|
QByteArray bpCondition; // condition acknowledged by the debugger engine
|
||||||
QString bpIgnoreCount; // ignore count acknowledged by the debugger engine
|
QByteArray bpIgnoreCount;// ignore count acknowledged by the debugger engine
|
||||||
QString bpFileName; // file name acknowledged by the debugger engine
|
QString bpFileName; // file name acknowledged by the debugger engine
|
||||||
QString bpLineNumber; // line number acknowledged by the debugger engine
|
QByteArray bpLineNumber; // line number acknowledged by the debugger engine
|
||||||
QString bpFuncName; // function name acknowledged by the debugger engine
|
QString bpFuncName; // function name acknowledged by the debugger engine
|
||||||
QString bpAddress; // address acknowledged by the debugger engine
|
QString bpAddress; // address acknowledged by the debugger engine
|
||||||
bool bpMultiple; // happens in constructors/gdb
|
bool bpMultiple; // happens in constructors/gdb
|
||||||
|
@@ -84,7 +84,7 @@ bool getRegisters(CIDebugControl *ctl,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Register reg;
|
Register reg;
|
||||||
reg.name = QString::fromUtf16(reinterpret_cast<const ushort *>(wszBuf));
|
reg.name = QString::fromUtf16(reinterpret_cast<const ushort *>(wszBuf)).toLatin1();
|
||||||
registers->push_back(reg);
|
registers->push_back(reg);
|
||||||
}
|
}
|
||||||
// get values
|
// get values
|
||||||
|
@@ -564,7 +564,7 @@ bool CDBBreakPoint::synchronizeBreakPoints(CIDebugControl* debugControl,
|
|||||||
handler->takeInsertedBreakPoint(nbd);
|
handler->takeInsertedBreakPoint(nbd);
|
||||||
updateMarkers = true;
|
updateMarkers = true;
|
||||||
nbd->pending = false;
|
nbd->pending = false;
|
||||||
nbd->bpNumber = QString::number(id);
|
nbd->bpNumber = QByteArray::number(uint(id));
|
||||||
nbd->bpAddress = QLatin1String("0x") + QString::number(address, 16);
|
nbd->bpAddress = QLatin1String("0x") + QString::number(address, 16);
|
||||||
// Take over rest as is
|
// Take over rest as is
|
||||||
nbd->bpCondition = nbd->condition;
|
nbd->bpCondition = nbd->condition;
|
||||||
|
@@ -985,7 +985,7 @@ void CdbDebugEngine::updateWatchData(const WatchData &incomplete)
|
|||||||
qDebug() << Q_FUNC_INFO << "\n " << incomplete.toString();
|
qDebug() << Q_FUNC_INFO << "\n " << incomplete.toString();
|
||||||
|
|
||||||
WatchHandler *watchHandler = manager()->watchHandler();
|
WatchHandler *watchHandler = manager()->watchHandler();
|
||||||
if (incomplete.iname.startsWith(QLatin1String("watch."))) {
|
if (incomplete.iname.startsWith("watch.")) {
|
||||||
WatchData watchData = incomplete;
|
WatchData watchData = incomplete;
|
||||||
evaluateWatcher(&watchData);
|
evaluateWatcher(&watchData);
|
||||||
watchHandler->insertData(watchData);
|
watchHandler->insertData(watchData);
|
||||||
@@ -1311,7 +1311,7 @@ void CdbDebugEngine::assignValueInDebugger(const QString &expr, const QString &v
|
|||||||
break;
|
break;
|
||||||
// Update view
|
// Update view
|
||||||
WatchHandler *watchHandler = manager()->watchHandler();
|
WatchHandler *watchHandler = manager()->watchHandler();
|
||||||
if (WatchData *fwd = watchHandler->findItem(expr)) {
|
if (WatchData *fwd = watchHandler->findItem(expr.toLatin1())) {
|
||||||
fwd->setValue(newValue);
|
fwd->setValue(newValue);
|
||||||
watchHandler->insertData(*fwd);
|
watchHandler->insertData(*fwd);
|
||||||
watchHandler->updateWatchers();
|
watchHandler->updateWatchers();
|
||||||
|
@@ -230,7 +230,7 @@ bool WatchHandleDumperInserter::expandPointerToDumpable(const WatchData &wd, QSt
|
|||||||
derefedWd.setType(type);
|
derefedWd.setType(type);
|
||||||
derefedWd.setAddress(hexAddrS);
|
derefedWd.setAddress(hexAddrS);
|
||||||
derefedWd.name = QString(QLatin1Char('*'));
|
derefedWd.name = QString(QLatin1Char('*'));
|
||||||
derefedWd.iname = wd.iname + QLatin1String(".*");
|
derefedWd.iname = wd.iname + ".*";
|
||||||
derefedWd.source = OwnerDumper | CdbStackFrameContext::ChildrenKnownBit;
|
derefedWd.source = OwnerDumper | CdbStackFrameContext::ChildrenKnownBit;
|
||||||
const CdbDumperHelper::DumpResult dr = m_dumper->dumpType(derefedWd, true, &m_dumperResult, errorMessage);
|
const CdbDumperHelper::DumpResult dr = m_dumper->dumpType(derefedWd, true, &m_dumperResult, errorMessage);
|
||||||
if (dr != CdbDumperHelper::DumpOk)
|
if (dr != CdbDumperHelper::DumpOk)
|
||||||
|
@@ -470,11 +470,11 @@ static inline QString fixValue(const QString &value, const QString &type)
|
|||||||
WatchData CdbSymbolGroupContext::watchDataAt(unsigned long index) const
|
WatchData CdbSymbolGroupContext::watchDataAt(unsigned long index) const
|
||||||
{
|
{
|
||||||
WatchData wd;
|
WatchData wd;
|
||||||
wd.iname = symbolINameAt(index);
|
wd.iname = symbolINameAt(index).toLatin1();
|
||||||
wd.exp = wd.iname;
|
wd.exp = wd.iname;
|
||||||
// Determine name from iname and format shadowed variables correctly
|
// Determine name from iname and format shadowed variables correctly
|
||||||
// as "<shadowed X>, see populateINameIndexMap().
|
// as "<shadowed X>, see populateINameIndexMap().
|
||||||
const int lastDelimiterPos = wd.iname.lastIndexOf(m_nameDelimiter);
|
const int lastDelimiterPos = wd.iname.lastIndexOf(m_nameDelimiter.toLatin1());
|
||||||
QString name = lastDelimiterPos == -1 ? wd.iname : wd.iname.mid(lastDelimiterPos + 1);
|
QString name = lastDelimiterPos == -1 ? wd.iname : wd.iname.mid(lastDelimiterPos + 1);
|
||||||
int shadowedNumber = 0;
|
int shadowedNumber = 0;
|
||||||
const int shadowedPos = name.lastIndexOf(QLatin1Char(iNameShadowDelimiter));
|
const int shadowedPos = name.lastIndexOf(QLatin1Char(iNameShadowDelimiter));
|
||||||
@@ -486,7 +486,7 @@ WatchData CdbSymbolGroupContext::watchDataAt(unsigned long index) const
|
|||||||
// (std::map extends std::tree<>... Remove them for display only.
|
// (std::map extends std::tree<>... Remove them for display only.
|
||||||
const QString fullShadowedName = WatchData::shadowedName(name, shadowedNumber);
|
const QString fullShadowedName = WatchData::shadowedName(name, shadowedNumber);
|
||||||
wd.name = WatchData::shadowedName(removeInnerTemplateType(name), shadowedNumber);
|
wd.name = WatchData::shadowedName(removeInnerTemplateType(name), shadowedNumber);
|
||||||
wd.addr = hexSymbolOffset(m_symbolGroup, index);
|
wd.addr = hexSymbolOffset(m_symbolGroup, index).toLatin1();
|
||||||
const QString type = getSymbolString(m_symbolGroup, &IDebugSymbolGroup2::GetSymbolTypeNameWide, index);
|
const QString type = getSymbolString(m_symbolGroup, &IDebugSymbolGroup2::GetSymbolTypeNameWide, index);
|
||||||
wd.setType(type);
|
wd.setType(type);
|
||||||
// Check for unitialized variables at level 0 only.
|
// Check for unitialized variables at level 0 only.
|
||||||
|
@@ -137,7 +137,7 @@ bool insertSymbolRecursion(WatchData wd,
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
const QString msg = QString::fromLatin1("WARNING: Skipping invalid child symbol #%2 (type %3) of '%4'.").
|
const QString msg = QString::fromLatin1("WARNING: Skipping invalid child symbol #%2 (type %3) of '%4'.").
|
||||||
arg(QLatin1String(Q_FUNC_INFO)).arg(c).arg(cwd.type, wd.iname);
|
arg(QLatin1String(Q_FUNC_INFO)).arg(c).arg(cwd.type, QString::fromLatin1(wd.iname));
|
||||||
qWarning("%s\n", qPrintable(msg));
|
qWarning("%s\n", qPrintable(msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -70,7 +70,7 @@ void AttachGdbAdapter::startInferior()
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
||||||
const qint64 pid = startParameters().attachPID;
|
const qint64 pid = startParameters().attachPID;
|
||||||
m_engine->postCommand(_("attach %1").arg(pid), CB(handleAttach));
|
m_engine->postCommand("attach " + QByteArray::number(pid), CB(handleAttach));
|
||||||
// Task 254674 does not want to remove them
|
// Task 254674 does not want to remove them
|
||||||
//qq->breakHandler()->removeAllBreakpoints();
|
//qq->breakHandler()->removeAllBreakpoints();
|
||||||
}
|
}
|
||||||
|
@@ -97,8 +97,9 @@ void CoreGdbAdapter::loadExeAndSyms()
|
|||||||
{
|
{
|
||||||
// Do that first, otherwise no symbols are loaded.
|
// Do that first, otherwise no symbols are loaded.
|
||||||
QFileInfo fi(m_executable);
|
QFileInfo fi(m_executable);
|
||||||
m_engine->postCommand(_("-file-exec-and-symbols \"%1\"")
|
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
|
||||||
.arg(fi.absoluteFilePath()), CB(handleFileExecAndSymbols));
|
m_engine->postCommand("-file-exec-and-symbols \"" + path + '"',
|
||||||
|
CB(handleFileExecAndSymbols));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
|
void CoreGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
|
||||||
@@ -118,8 +119,8 @@ void CoreGdbAdapter::loadCoreFile()
|
|||||||
{
|
{
|
||||||
// Quoting core name below fails in gdb 6.8-debian.
|
// Quoting core name below fails in gdb 6.8-debian.
|
||||||
QFileInfo fi(startParameters().coreFile);
|
QFileInfo fi(startParameters().coreFile);
|
||||||
QString coreName = fi.absoluteFilePath();
|
QByteArray coreName = fi.absoluteFilePath().toLocal8Bit();
|
||||||
m_engine->postCommand(_("target core ") + coreName, CB(handleTargetCore));
|
m_engine->postCommand("target core " + coreName, CB(handleTargetCore));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
|
void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
|
||||||
@@ -144,7 +145,7 @@ void CoreGdbAdapter::handleTargetCore(const GdbResponse &response)
|
|||||||
if (QFile::exists(m_executable)) {
|
if (QFile::exists(m_executable)) {
|
||||||
// Finish extra round ...
|
// Finish extra round ...
|
||||||
showStatusMessage(tr("Attached to core temporarily."));
|
showStatusMessage(tr("Attached to core temporarily."));
|
||||||
m_engine->postCommand(_("detach"));
|
m_engine->postCommand("detach");
|
||||||
// ... and retry.
|
// ... and retry.
|
||||||
loadExeAndSyms();
|
loadExeAndSyms();
|
||||||
return;
|
return;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -201,7 +201,7 @@ private: ////////// Gdb Command Management //////////
|
|||||||
GdbCommandCallback callback;
|
GdbCommandCallback callback;
|
||||||
AdapterCallback adapterCallback;
|
AdapterCallback adapterCallback;
|
||||||
const char *callbackName;
|
const char *callbackName;
|
||||||
QString command;
|
QByteArray command;
|
||||||
QVariant cookie;
|
QVariant cookie;
|
||||||
QTime postTime;
|
QTime postTime;
|
||||||
};
|
};
|
||||||
@@ -211,20 +211,20 @@ private: ////////// Gdb Command Management //////////
|
|||||||
// send and decrements on receipt, effectively preventing
|
// send and decrements on receipt, effectively preventing
|
||||||
// watch model updates before everything is finished.
|
// watch model updates before everything is finished.
|
||||||
void flushCommand(const GdbCommand &cmd);
|
void flushCommand(const GdbCommand &cmd);
|
||||||
void postCommand(const QString &command,
|
void postCommand(const QByteArray &command,
|
||||||
GdbCommandFlags flags,
|
GdbCommandFlags flags,
|
||||||
GdbCommandCallback callback = 0,
|
GdbCommandCallback callback = 0,
|
||||||
const char *callbackName = 0,
|
const char *callbackName = 0,
|
||||||
const QVariant &cookie = QVariant());
|
const QVariant &cookie = QVariant());
|
||||||
void postCommand(const QString &command,
|
void postCommand(const QByteArray &command,
|
||||||
GdbCommandCallback callback = 0,
|
GdbCommandCallback callback = 0,
|
||||||
const char *callbackName = 0,
|
const char *callbackName = 0,
|
||||||
const QVariant &cookie = QVariant());
|
const QVariant &cookie = QVariant());
|
||||||
void postCommand(const QString &command,
|
void postCommand(const QByteArray &command,
|
||||||
AdapterCallback callback,
|
AdapterCallback callback,
|
||||||
const char *callbackName,
|
const char *callbackName,
|
||||||
const QVariant &cookie = QVariant());
|
const QVariant &cookie = QVariant());
|
||||||
void postCommand(const QString &command,
|
void postCommand(const QByteArray &command,
|
||||||
GdbCommandFlags flags,
|
GdbCommandFlags flags,
|
||||||
AdapterCallback callback,
|
AdapterCallback callback,
|
||||||
const char *callbackName,
|
const char *callbackName,
|
||||||
@@ -458,7 +458,7 @@ private: ////////// View & Data Stuff //////////
|
|||||||
void setWatchDataType(WatchData &data, const GdbMi &mi);
|
void setWatchDataType(WatchData &data, const GdbMi &mi);
|
||||||
void setWatchDataDisplayedType(WatchData &data, const GdbMi &mi);
|
void setWatchDataDisplayedType(WatchData &data, const GdbMi &mi);
|
||||||
|
|
||||||
QSet<QString> m_processedNames;
|
QSet<QByteArray> m_processedNames;
|
||||||
QMap<QString, QString> m_varToType;
|
QMap<QString, QString> m_varToType;
|
||||||
|
|
||||||
private: ////////// Dumper Management //////////
|
private: ////////// Dumper Management //////////
|
||||||
|
@@ -99,11 +99,13 @@ void PlainGdbAdapter::startAdapter()
|
|||||||
void PlainGdbAdapter::startInferior()
|
void PlainGdbAdapter::startInferior()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
||||||
if (!startParameters().processArgs.isEmpty())
|
if (!startParameters().processArgs.isEmpty()) {
|
||||||
m_engine->postCommand(_("-exec-arguments ")
|
QString args = startParameters().processArgs.join(_(" "));
|
||||||
+ startParameters().processArgs.join(_(" ")));
|
m_engine->postCommand("-exec-arguments " + args.toLocal8Bit());
|
||||||
|
}
|
||||||
QFileInfo fi(startParameters().executable);
|
QFileInfo fi(startParameters().executable);
|
||||||
m_engine->postCommand(_("-file-exec-and-symbols \"%1\"").arg(fi.absoluteFilePath()),
|
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
|
||||||
|
m_engine->postCommand("-file-exec-and-symbols \"" + path + '"',
|
||||||
CB(handleFileExecAndSymbols));
|
CB(handleFileExecAndSymbols));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +118,7 @@ void PlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
|
|||||||
// Note that successfully preloading the debugging helpers will
|
// Note that successfully preloading the debugging helpers will
|
||||||
// automatically load pthreads, so this will be unnecessary.
|
// automatically load pthreads, so this will be unnecessary.
|
||||||
if (m_engine->m_gdbVersion < 70000)
|
if (m_engine->m_gdbVersion < 70000)
|
||||||
m_engine->postCommand(_("info target"), CB(handleInfoTarget));
|
m_engine->postCommand("info target", CB(handleInfoTarget));
|
||||||
#endif
|
#endif
|
||||||
emit inferiorPrepared();
|
emit inferiorPrepared();
|
||||||
} else {
|
} else {
|
||||||
@@ -138,7 +140,7 @@ void PlainGdbAdapter::handleInfoTarget(const GdbResponse &response)
|
|||||||
if (needle.indexIn(msg) != -1) {
|
if (needle.indexIn(msg) != -1) {
|
||||||
m_engine->m_entryPoint =
|
m_engine->m_entryPoint =
|
||||||
"0x" + needle.cap(1).toLatin1().rightJustified(sizeof(void *) * 2, '0');
|
"0x" + needle.cap(1).toLatin1().rightJustified(sizeof(void *) * 2, '0');
|
||||||
m_engine->postCommand(_("tbreak *0x") + needle.cap(1));
|
m_engine->postCommand("tbreak *0x" + needle.cap(1).toAscii());
|
||||||
// Do nothing here - inferiorPrepared handles the sequencing.
|
// Do nothing here - inferiorPrepared handles the sequencing.
|
||||||
} else {
|
} else {
|
||||||
emit inferiorStartFailed(_("Parsing start address failed"));
|
emit inferiorStartFailed(_("Parsing start address failed"));
|
||||||
@@ -152,7 +154,7 @@ void PlainGdbAdapter::handleInfoTarget(const GdbResponse &response)
|
|||||||
void PlainGdbAdapter::startInferiorPhase2()
|
void PlainGdbAdapter::startInferiorPhase2()
|
||||||
{
|
{
|
||||||
setState(InferiorRunningRequested);
|
setState(InferiorRunningRequested);
|
||||||
m_engine->postCommand(_("-exec-run"), GdbEngine::RunRequest, CB(handleExecRun));
|
m_engine->postCommand("-exec-run", GdbEngine::RunRequest, CB(handleExecRun));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
|
void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
|
||||||
|
@@ -155,21 +155,24 @@ void RemoteGdbAdapter::startInferior()
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
||||||
|
|
||||||
m_engine->postCommand(_("set architecture %1")
|
m_engine->postCommand("set architecture "
|
||||||
.arg(startParameters().remoteArchitecture));
|
+ startParameters().remoteArchitecture.toLatin1());
|
||||||
m_engine->postCommand(_("set sysroot %1").arg(startParameters().sysRoot));
|
m_engine->postCommand("set sysroot "
|
||||||
m_engine->postCommand(_("set solib-search-path %1").
|
+ startParameters().sysRoot.toLocal8Bit());
|
||||||
arg(QFileInfo(startParameters().dumperLibrary).path()));
|
m_engine->postCommand("set solib-search-path "
|
||||||
|
+ QFileInfo(startParameters().dumperLibrary).path().toLocal8Bit());
|
||||||
|
|
||||||
if (!startParameters().processArgs.isEmpty())
|
if (!startParameters().processArgs.isEmpty()) {
|
||||||
m_engine->postCommand(_("-exec-arguments ")
|
QString args = startParameters().processArgs.join(_(" "));
|
||||||
+ startParameters().processArgs.join(_(" ")));
|
m_engine->postCommand("-exec-arguments " + args.toLocal8Bit());
|
||||||
|
}
|
||||||
|
|
||||||
m_engine->postCommand(_("set target-async on"), CB(handleSetTargetAsync));
|
m_engine->postCommand("set target-async on", CB(handleSetTargetAsync));
|
||||||
QString x = startParameters().executable;
|
QString x = startParameters().executable;
|
||||||
QFileInfo fi(startParameters().executable);
|
QFileInfo fi(startParameters().executable);
|
||||||
QString fileName = fi.absoluteFilePath();
|
QString fileName = fi.absoluteFilePath();
|
||||||
m_engine->postCommand(_("-file-exec-and-symbols \"%1\"").arg(fileName),
|
m_engine->postCommand("-file-exec-and-symbols \""
|
||||||
|
+ fileName.toLocal8Bit() + '"',
|
||||||
CB(handleFileExecAndSymbols));
|
CB(handleFileExecAndSymbols));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +194,7 @@ void RemoteGdbAdapter::handleFileExecAndSymbols(const GdbResponse &response)
|
|||||||
// (2) starts the remote application
|
// (2) starts the remote application
|
||||||
// (3) stops the remote application (early, e.g. in the dynamic linker)
|
// (3) stops the remote application (early, e.g. in the dynamic linker)
|
||||||
QString channel = startParameters().remoteChannel;
|
QString channel = startParameters().remoteChannel;
|
||||||
m_engine->postCommand(_("target remote %1").arg(channel),
|
m_engine->postCommand("target remote " + channel.toLatin1(),
|
||||||
CB(handleTargetRemote));
|
CB(handleTargetRemote));
|
||||||
} else {
|
} else {
|
||||||
QString msg = tr("Starting remote executable failed:\n");
|
QString msg = tr("Starting remote executable failed:\n");
|
||||||
@@ -224,7 +227,7 @@ void RemoteGdbAdapter::startInferiorPhase2()
|
|||||||
|
|
||||||
void RemoteGdbAdapter::interruptInferior()
|
void RemoteGdbAdapter::interruptInferior()
|
||||||
{
|
{
|
||||||
m_engine->postCommand(_("-exec-interrupt"));
|
m_engine->postCommand("-exec-interrupt");
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteGdbAdapter::shutdown()
|
void RemoteGdbAdapter::shutdown()
|
||||||
|
@@ -129,7 +129,8 @@ void TermGdbAdapter::startInferior()
|
|||||||
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
QTC_ASSERT(state() == InferiorStarting, qDebug() << state());
|
||||||
const qint64 attachedPID = m_stubProc.applicationPID();
|
const qint64 attachedPID = m_stubProc.applicationPID();
|
||||||
m_engine->handleInferiorPidChanged(attachedPID);
|
m_engine->handleInferiorPidChanged(attachedPID);
|
||||||
m_engine->postCommand(_("attach %1").arg(attachedPID), CB(handleStubAttached));
|
m_engine->postCommand("attach " + QByteArray::number(attachedPID),
|
||||||
|
CB(handleStubAttached));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TermGdbAdapter::handleStubAttached(const GdbResponse &response)
|
void TermGdbAdapter::handleStubAttached(const GdbResponse &response)
|
||||||
@@ -140,7 +141,7 @@ void TermGdbAdapter::handleStubAttached(const GdbResponse &response)
|
|||||||
debugMessage(_("INFERIOR ATTACHED"));
|
debugMessage(_("INFERIOR ATTACHED"));
|
||||||
emit inferiorPrepared();
|
emit inferiorPrepared();
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
m_engine->postCommand(_("-stack-list-frames 0 0"), CB(handleEntryPoint));
|
m_engine->postCommand("-stack-list-frames 0 0", CB(handleEntryPoint));
|
||||||
#endif
|
#endif
|
||||||
} else if (response.resultClass == GdbResultError) {
|
} else if (response.resultClass == GdbResultError) {
|
||||||
QString msg = QString::fromLocal8Bit(response.data.findChild("msg").data());
|
QString msg = QString::fromLocal8Bit(response.data.findChild("msg").data());
|
||||||
|
@@ -1685,15 +1685,15 @@ void TrkGdbAdapter::handleCreateProcess(const TrkResult &result)
|
|||||||
|
|
||||||
logMessage(startMsg);
|
logMessage(startMsg);
|
||||||
|
|
||||||
const QString fileName = m_symbolFile;
|
const QByteArray symbolFile = m_symbolFile.toLocal8Bit();
|
||||||
if (m_symbolFile.isEmpty()) {
|
if (symbolFile.isEmpty()) {
|
||||||
logMessage(_("WARNING: No symbol file available."));
|
logMessage(_("WARNING: No symbol file available."));
|
||||||
} else {
|
} else {
|
||||||
m_engine->postCommand(_("add-symbol-file \"%1\" %2").arg(m_symbolFile)
|
m_engine->postCommand("add-symbol-file \"" + symbolFile + "\" "
|
||||||
.arg(m_session.codeseg));
|
+ QByteArray::number(m_session.codeseg));
|
||||||
m_engine->postCommand(_("symbol-file \"%1\"").arg(m_symbolFile));
|
m_engine->postCommand("symbol-file \"" + symbolFile + "\"");
|
||||||
}
|
}
|
||||||
m_engine->postCommand(_("target remote ") + gdbServerName(),
|
m_engine->postCommand("target remote " + gdbServerName().toLatin1(),
|
||||||
CB(handleTargetRemote));
|
CB(handleTargetRemote));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,10 +46,10 @@ class Register
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Register() : changed(true) {}
|
Register() : changed(true) {}
|
||||||
Register(QString const &name_) : name(name_), changed(true) {}
|
Register(QByteArray const &name_) : name(name_), changed(true) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString name;
|
QByteArray name;
|
||||||
QString value;
|
QString value;
|
||||||
bool changed;
|
bool changed;
|
||||||
};
|
};
|
||||||
|
@@ -390,7 +390,7 @@ void ScriptEngine::attemptBreakpointSynchronization()
|
|||||||
updateNeeded = true;
|
updateNeeded = true;
|
||||||
}
|
}
|
||||||
if (data->bpNumber.isEmpty()) {
|
if (data->bpNumber.isEmpty()) {
|
||||||
data->bpNumber = QString::number(index + 1);
|
data->bpNumber = QByteArray::number(index + 1);
|
||||||
updateNeeded = true;
|
updateNeeded = true;
|
||||||
}
|
}
|
||||||
if (!data->fileName.isEmpty() && data->markerFileName.isEmpty()) {
|
if (!data->fileName.isEmpty() && data->markerFileName.isEmpty()) {
|
||||||
@@ -560,7 +560,7 @@ void ScriptEngine::maybeBreakNow(bool byFunction)
|
|||||||
// we just run into a breakpoint
|
// we just run into a breakpoint
|
||||||
//SDEBUG("RESOLVING BREAKPOINT AT " << fileName << lineNumber);
|
//SDEBUG("RESOLVING BREAKPOINT AT " << fileName << lineNumber);
|
||||||
BreakpointData *data = handler->at(index);
|
BreakpointData *data = handler->at(index);
|
||||||
data->bpLineNumber = QString::number(lineNumber);
|
data->bpLineNumber = QByteArray::number(lineNumber);
|
||||||
data->bpFileName = fileName;
|
data->bpFileName = fileName;
|
||||||
data->bpFuncName = functionName;
|
data->bpFuncName = functionName;
|
||||||
data->markerLineNumber = lineNumber;
|
data->markerLineNumber = lineNumber;
|
||||||
@@ -703,8 +703,8 @@ void ScriptEngine::updateSubItem(const WatchData &data0)
|
|||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
WatchData data1;
|
WatchData data1;
|
||||||
data1.iname = data.iname + "." + it.name();
|
data1.iname = data.iname + "." + it.name().toLatin1();
|
||||||
data1.exp = it.name();
|
data1.exp = it.name().toLatin1();
|
||||||
data1.name = it.name();
|
data1.name = it.name();
|
||||||
data1.scriptValue = it.value();
|
data1.scriptValue = it.value();
|
||||||
if (manager()->watchHandler()->isExpandedIName(data1.iname))
|
if (manager()->watchHandler()->isExpandedIName(data1.iname))
|
||||||
|
@@ -224,7 +224,7 @@ void WatchData::setType(const QString &str, bool guessChildrenFromType)
|
|||||||
|
|
||||||
void WatchData::setAddress(const QString &str)
|
void WatchData::setAddress(const QString &str)
|
||||||
{
|
{
|
||||||
addr = str;
|
addr = str.toLatin1();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString WatchData::toString() const
|
QString WatchData::toString() const
|
||||||
@@ -349,15 +349,15 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type)
|
|||||||
|
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case LocalsWatch:
|
case LocalsWatch:
|
||||||
m_root->iname = QLatin1String("local");
|
m_root->iname = "local";
|
||||||
m_root->name = WatchHandler::tr("Locals");
|
m_root->name = WatchHandler::tr("Locals");
|
||||||
break;
|
break;
|
||||||
case WatchersWatch:
|
case WatchersWatch:
|
||||||
m_root->iname = QLatin1String("watch");
|
m_root->iname = "watch";
|
||||||
m_root->name = WatchHandler::tr("Watchers");
|
m_root->name = WatchHandler::tr("Watchers");
|
||||||
break;
|
break;
|
||||||
case TooltipsWatch:
|
case TooltipsWatch:
|
||||||
m_root->iname = QLatin1String("tooltip");
|
m_root->iname = "tooltip";
|
||||||
m_root->name = WatchHandler::tr("Tooltip");
|
m_root->name = WatchHandler::tr("Tooltip");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -461,11 +461,11 @@ void WatchModel::destroyItem(WatchItem *item)
|
|||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString parentName(const QString &iname)
|
static QByteArray parentName(const QByteArray &iname)
|
||||||
{
|
{
|
||||||
int pos = iname.lastIndexOf(QLatin1Char('.'));
|
int pos = iname.lastIndexOf('.');
|
||||||
if (pos == -1)
|
if (pos == -1)
|
||||||
return QString();
|
return QByteArray();
|
||||||
return iname.left(pos);
|
return iname.left(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -931,9 +931,9 @@ QVariant WatchModel::headerData(int section, Qt::Orientation orientation, int ro
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IName : public QString
|
struct IName : public QByteArray
|
||||||
{
|
{
|
||||||
IName(const QString &iname) : QString(iname) {}
|
IName(const QByteArray &iname) : QByteArray(iname) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool iNameLess(const QString &iname1, const QString &iname2)
|
bool iNameLess(const QString &iname1, const QString &iname2)
|
||||||
@@ -1028,7 +1028,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
|
|||||||
//foreach (const WatchItem &data, list)
|
//foreach (const WatchItem &data, list)
|
||||||
// qDebug() << "BULK: " << ++bulk << data.toString();
|
// qDebug() << "BULK: " << ++bulk << data.toString();
|
||||||
QTC_ASSERT(!list.isEmpty(), return);
|
QTC_ASSERT(!list.isEmpty(), return);
|
||||||
QString parentIName = parentName(list.at(0).iname);
|
QByteArray parentIName = parentName(list.at(0).iname);
|
||||||
WatchItem *parent = findItem(parentIName, m_root);
|
WatchItem *parent = findItem(parentIName, m_root);
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
WatchData parent;
|
WatchData parent;
|
||||||
@@ -1117,7 +1117,7 @@ void WatchModel::insertBulkData(const QList<WatchData> &list)
|
|||||||
dump();
|
dump();
|
||||||
}
|
}
|
||||||
|
|
||||||
WatchItem *WatchModel::findItem(const QString &iname, WatchItem *root) const
|
WatchItem *WatchModel::findItem(const QByteArray &iname, WatchItem *root) const
|
||||||
{
|
{
|
||||||
if (root->iname == iname)
|
if (root->iname == iname)
|
||||||
return root;
|
return root;
|
||||||
@@ -1248,7 +1248,7 @@ void WatchHandler::insertBulkData(const QList<WatchData> &list)
|
|||||||
|
|
||||||
if (list.isEmpty())
|
if (list.isEmpty())
|
||||||
return;
|
return;
|
||||||
QMap<QString, QList<WatchData> > hash;
|
QMap<QByteArray, QList<WatchData> > hash;
|
||||||
|
|
||||||
foreach (const WatchData &data, list) {
|
foreach (const WatchData &data, list) {
|
||||||
// we insert everything, including incomplete stuff
|
// we insert everything, including incomplete stuff
|
||||||
@@ -1259,7 +1259,7 @@ void WatchHandler::insertBulkData(const QList<WatchData> &list)
|
|||||||
qWarning("%s:%d: Attempt to bulk-insert invalid watch item: %s", __FILE__, __LINE__, qPrintable(data.toString()));
|
qWarning("%s:%d: Attempt to bulk-insert invalid watch item: %s", __FILE__, __LINE__, qPrintable(data.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (const QString &parentIName, hash.keys()) {
|
foreach (const QByteArray &parentIName, hash.keys()) {
|
||||||
WatchModel *model = modelForIName(parentIName);
|
WatchModel *model = modelForIName(parentIName);
|
||||||
QTC_ASSERT(model, return);
|
QTC_ASSERT(model, return);
|
||||||
model->insertBulkData(hash[parentIName]);
|
model->insertBulkData(hash[parentIName]);
|
||||||
@@ -1271,7 +1271,7 @@ void WatchHandler::insertBulkData(const QList<WatchData> &list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::removeData(const QString &iname)
|
void WatchHandler::removeData(const QByteArray &iname)
|
||||||
{
|
{
|
||||||
WatchModel *model = modelForIName(iname);
|
WatchModel *model = modelForIName(iname);
|
||||||
if (!model)
|
if (!model)
|
||||||
@@ -1287,21 +1287,21 @@ void WatchHandler::watchExpression()
|
|||||||
watchExpression(action->data().toString());
|
watchExpression(action->data().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString WatchHandler::watcherName(const QString &exp)
|
QByteArray WatchHandler::watcherName(const QByteArray &exp)
|
||||||
{
|
{
|
||||||
return QLatin1String("watch.") + QString::number(m_watcherNames[exp]);
|
return "watch." + QByteArray::number(m_watcherNames[exp]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::watchExpression(const QString &exp)
|
void WatchHandler::watchExpression(const QString &exp)
|
||||||
{
|
{
|
||||||
// FIXME: 'exp' can contain illegal characters
|
// FIXME: 'exp' can contain illegal characters
|
||||||
m_watcherNames[exp] = watcherCounter++;
|
|
||||||
WatchData data;
|
WatchData data;
|
||||||
data.exp = exp;
|
data.exp = exp.toLatin1();
|
||||||
data.name = exp;
|
data.name = exp;
|
||||||
|
m_watcherNames[data.exp] = watcherCounter++;
|
||||||
if (exp.isEmpty() || exp == watcherEditPlaceHolder())
|
if (exp.isEmpty() || exp == watcherEditPlaceHolder())
|
||||||
data.setAllUnneeded();
|
data.setAllUnneeded();
|
||||||
data.iname = watcherName(exp);
|
data.iname = watcherName(data.exp);
|
||||||
IDebuggerEngine *engine = m_manager->currentEngine();
|
IDebuggerEngine *engine = m_manager->currentEngine();
|
||||||
if (engine && engine->isSynchroneous())
|
if (engine && engine->isSynchroneous())
|
||||||
m_manager->updateWatchData(data);
|
m_manager->updateWatchData(data);
|
||||||
@@ -1392,8 +1392,9 @@ void WatchHandler::removeWatchExpression()
|
|||||||
removeWatchExpression(action->data().toString());
|
removeWatchExpression(action->data().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::removeWatchExpression(const QString &exp)
|
void WatchHandler::removeWatchExpression(const QString &exp0)
|
||||||
{
|
{
|
||||||
|
QByteArray exp = exp0.toLatin1();
|
||||||
MODEL_DEBUG("REMOVE WATCH: " << exp);
|
MODEL_DEBUG("REMOVE WATCH: " << exp);
|
||||||
m_watcherNames.remove(exp);
|
m_watcherNames.remove(exp);
|
||||||
foreach (WatchItem *item, m_watchers->rootItem()->children) {
|
foreach (WatchItem *item, m_watchers->rootItem()->children) {
|
||||||
@@ -1409,7 +1410,7 @@ void WatchHandler::updateWatchers()
|
|||||||
{
|
{
|
||||||
//qDebug() << "UPDATE WATCHERS";
|
//qDebug() << "UPDATE WATCHERS";
|
||||||
// copy over all watchers and mark all watchers as incomplete
|
// copy over all watchers and mark all watchers as incomplete
|
||||||
foreach (const QString &exp, m_watcherNames.keys()) {
|
foreach (const QByteArray &exp, m_watcherNames.keys()) {
|
||||||
WatchData data;
|
WatchData data;
|
||||||
data.iname = watcherName(exp);
|
data.iname = watcherName(exp);
|
||||||
data.setAllNeeded();
|
data.setAllNeeded();
|
||||||
@@ -1423,7 +1424,7 @@ void WatchHandler::loadWatchers()
|
|||||||
{
|
{
|
||||||
QVariant value = m_manager->sessionValue("Watchers");
|
QVariant value = m_manager->sessionValue("Watchers");
|
||||||
foreach (const QString &exp, value.toStringList())
|
foreach (const QString &exp, value.toStringList())
|
||||||
m_watcherNames[exp] = watcherCounter++;
|
m_watcherNames[exp.toLatin1()] = watcherCounter++;
|
||||||
|
|
||||||
//qDebug() << "LOAD WATCHERS: " << m_watchers;
|
//qDebug() << "LOAD WATCHERS: " << m_watchers;
|
||||||
//reinitializeWatchersHelper();
|
//reinitializeWatchersHelper();
|
||||||
@@ -1433,7 +1434,7 @@ QStringList WatchHandler::watchedExpressions() const
|
|||||||
{
|
{
|
||||||
// Filter out invalid watchers.
|
// Filter out invalid watchers.
|
||||||
QStringList watcherNames;
|
QStringList watcherNames;
|
||||||
QHashIterator<QString, int> it(m_watcherNames);
|
QHashIterator<QByteArray, int> it(m_watcherNames);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
const QString &watcherName = it.key();
|
const QString &watcherName = it.key();
|
||||||
@@ -1487,7 +1488,7 @@ void WatchHandler::loadSessionData()
|
|||||||
{
|
{
|
||||||
loadWatchers();
|
loadWatchers();
|
||||||
loadTypeFormats();
|
loadTypeFormats();
|
||||||
foreach (const QString &exp, m_watcherNames.keys()) {
|
foreach (const QByteArray &exp, m_watcherNames.keys()) {
|
||||||
WatchData data;
|
WatchData data;
|
||||||
data.iname = watcherName(exp);
|
data.iname = watcherName(exp);
|
||||||
data.setAllUnneeded();
|
data.setAllUnneeded();
|
||||||
@@ -1508,19 +1509,19 @@ WatchModel *WatchHandler::model(WatchType type) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WatchModel *WatchHandler::modelForIName(const QString &iname) const
|
WatchModel *WatchHandler::modelForIName(const QByteArray &iname) const
|
||||||
{
|
{
|
||||||
if (iname.startsWith(QLatin1String("local")))
|
if (iname.startsWith("local"))
|
||||||
return m_locals;
|
return m_locals;
|
||||||
if (iname.startsWith(QLatin1String("watch")))
|
if (iname.startsWith("watch"))
|
||||||
return m_watchers;
|
return m_watchers;
|
||||||
if (iname.startsWith(QLatin1String("tooltip")))
|
if (iname.startsWith("tooltip"))
|
||||||
return m_tooltips;
|
return m_tooltips;
|
||||||
QTC_ASSERT(false, qDebug() << "INAME: " << iname);
|
QTC_ASSERT(false, qDebug() << "INAME: " << iname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WatchData *WatchHandler::findItem(const QString &iname) const
|
WatchData *WatchHandler::findItem(const QByteArray &iname) const
|
||||||
{
|
{
|
||||||
const WatchModel *model = modelForIName(iname);
|
const WatchModel *model = modelForIName(iname);
|
||||||
QTC_ASSERT(model, return 0);
|
QTC_ASSERT(model, return 0);
|
||||||
|
@@ -109,8 +109,8 @@ public:
|
|||||||
|
|
||||||
QString toString() const;
|
QString toString() const;
|
||||||
QString toToolTip() const;
|
QString toToolTip() const;
|
||||||
bool isLocal() const { return iname.startsWith(QLatin1String("local.")); }
|
bool isLocal() const { return iname.startsWith("local."); }
|
||||||
bool isWatcher() const { return iname.startsWith(QLatin1String("watch.")); }
|
bool isWatcher() const { return iname.startsWith("watch."); }
|
||||||
bool isValid() const { return !iname.isEmpty(); }
|
bool isValid() const { return !iname.isEmpty(); }
|
||||||
|
|
||||||
bool isEqual(const WatchData &other) const;
|
bool isEqual(const WatchData &other) const;
|
||||||
@@ -119,17 +119,17 @@ public:
|
|||||||
static QString shadowedName(const QString &name, int seen);
|
static QString shadowedName(const QString &name, int seen);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString iname; // internal name sth like 'local.baz.public.a'
|
QByteArray iname; // internal name sth like 'local.baz.public.a'
|
||||||
QString exp; // the expression
|
QByteArray exp; // the expression
|
||||||
QString name; // displayed name
|
QString name; // displayed name
|
||||||
QString value; // displayed value
|
QString value; // displayed value
|
||||||
QByteArray editvalue; // displayed value
|
QByteArray editvalue; // displayed value
|
||||||
QString valuetooltip; // tooltip in value column
|
QString valuetooltip; // tooltip in value column
|
||||||
QString type; // type for further processing
|
QString type; // type for further processing
|
||||||
QString displayedType;// displayed type (optional)
|
QString displayedType;// displayed type (optional)
|
||||||
QString variable; // name of internal Gdb variable if created
|
QByteArray variable; // name of internal Gdb variable if created
|
||||||
QString addr; // displayed adress
|
QByteArray addr; // displayed adress
|
||||||
QString saddr; // stored address (pointer in container)
|
QByteArray saddr; // stored address (pointer in container)
|
||||||
QString framekey; // key for type cache
|
QString framekey; // key for type cache
|
||||||
QScriptValue scriptValue; // if needed...
|
QScriptValue scriptValue; // if needed...
|
||||||
bool hasChildren;
|
bool hasChildren;
|
||||||
@@ -215,7 +215,7 @@ private:
|
|||||||
|
|
||||||
void insertData(const WatchData &data);
|
void insertData(const WatchData &data);
|
||||||
void insertBulkData(const QList<WatchData> &data);
|
void insertBulkData(const QList<WatchData> &data);
|
||||||
WatchItem *findItem(const QString &iname, WatchItem *root) const;
|
WatchItem *findItem(const QByteArray &iname, WatchItem *root) const;
|
||||||
void reinitialize();
|
void reinitialize();
|
||||||
void removeOutdated();
|
void removeOutdated();
|
||||||
void removeOutdatedHelper(WatchItem *item);
|
void removeOutdatedHelper(WatchItem *item);
|
||||||
@@ -243,7 +243,7 @@ private:
|
|||||||
WatchHandler *m_handler;
|
WatchHandler *m_handler;
|
||||||
WatchType m_type;
|
WatchType m_type;
|
||||||
WatchItem *m_root;
|
WatchItem *m_root;
|
||||||
QSet<QString> m_fetchTriggered;
|
QSet<QByteArray> m_fetchTriggered;
|
||||||
// Part of the workaround to update the [+] marker when items
|
// Part of the workaround to update the [+] marker when items
|
||||||
// are added to a container.
|
// are added to a container.
|
||||||
bool m_inExtraLayoutChanged;
|
bool m_inExtraLayoutChanged;
|
||||||
@@ -256,7 +256,7 @@ class WatchHandler : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit WatchHandler(DebuggerManager *manager);
|
explicit WatchHandler(DebuggerManager *manager);
|
||||||
WatchModel *model(WatchType type) const;
|
WatchModel *model(WatchType type) const;
|
||||||
WatchModel *modelForIName(const QString &data) const;
|
WatchModel *modelForIName(const QByteArray &iname) const;
|
||||||
|
|
||||||
//public slots:
|
//public slots:
|
||||||
void cleanup();
|
void cleanup();
|
||||||
@@ -272,20 +272,20 @@ public:
|
|||||||
|
|
||||||
void insertData(const WatchData &data);
|
void insertData(const WatchData &data);
|
||||||
void insertBulkData(const QList<WatchData> &data);
|
void insertBulkData(const QList<WatchData> &data);
|
||||||
void removeData(const QString &iname);
|
void removeData(const QByteArray &iname);
|
||||||
WatchData *findItem(const QString &iname) const;
|
WatchData *findItem(const QByteArray &iname) const;
|
||||||
|
|
||||||
void loadSessionData();
|
void loadSessionData();
|
||||||
void saveSessionData();
|
void saveSessionData();
|
||||||
|
|
||||||
bool isDisplayedIName(const QString &iname) const
|
bool isDisplayedIName(const QByteArray &iname) const
|
||||||
{ return m_displayedINames.contains(iname); }
|
{ return m_displayedINames.contains(iname); }
|
||||||
bool isExpandedIName(const QString &iname) const
|
bool isExpandedIName(const QByteArray &iname) const
|
||||||
{ return m_expandedINames.contains(iname); }
|
{ return m_expandedINames.contains(iname); }
|
||||||
QSet<QString> expandedINames() const
|
QSet<QByteArray> expandedINames() const
|
||||||
{ return m_expandedINames; }
|
{ return m_expandedINames; }
|
||||||
QStringList watchedExpressions() const;
|
QStringList watchedExpressions() const;
|
||||||
QHash<QString, int> watcherNames() const
|
QHash<QByteArray, int> watcherNames() const
|
||||||
{ return m_watcherNames; }
|
{ return m_watcherNames; }
|
||||||
|
|
||||||
static QString watcherEditPlaceHolder();
|
static QString watcherEditPlaceHolder();
|
||||||
@@ -306,14 +306,14 @@ private:
|
|||||||
typedef QMap<QString, QPointer<QWidget> > EditWindows;
|
typedef QMap<QString, QPointer<QWidget> > EditWindows;
|
||||||
EditWindows m_editWindows;
|
EditWindows m_editWindows;
|
||||||
|
|
||||||
QHash<QString, int> m_watcherNames;
|
QHash<QByteArray, int> m_watcherNames;
|
||||||
QString watcherName(const QString &exp);
|
QByteArray watcherName(const QByteArray &exp);
|
||||||
QHash<QString, int> m_typeFormats;
|
QHash<QString, int> m_typeFormats;
|
||||||
QHash<QString, int> m_individualFormats;
|
QHash<QString, int> m_individualFormats;
|
||||||
|
|
||||||
void setDisplayedIName(const QString &iname, bool on);
|
void setDisplayedIName(const QString &iname, bool on);
|
||||||
QSet<QString> m_expandedINames; // those expanded in the treeview
|
QSet<QByteArray> m_expandedINames; // those expanded in the treeview
|
||||||
QSet<QString> m_displayedINames; // those with "external" viewers
|
QSet<QByteArray> m_displayedINames; // those with "external" viewers
|
||||||
|
|
||||||
WatchModel *m_locals;
|
WatchModel *m_locals;
|
||||||
WatchModel *m_watchers;
|
WatchModel *m_watchers;
|
||||||
|
@@ -138,12 +138,11 @@ QDebug operator<<(QDebug d, const Scope &scope)
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
QString dotEscape(QString str)
|
QByteArray dotEscape(QByteArray str)
|
||||||
{
|
{
|
||||||
const QChar dot = QLatin1Char('.');
|
str.replace(' ', '.');
|
||||||
str.replace(QLatin1Char(' '), dot);
|
str.replace('\\', '.');
|
||||||
str.replace(QLatin1Char('\\'), dot);
|
str.replace('/', '.');
|
||||||
str.replace(QLatin1Char('/'), dot);
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,15 +274,6 @@ bool isCharPointerType(const QString &type)
|
|||||||
|| type == QLatin1String("char const *");
|
|| type == QLatin1String("char const *");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isAccessSpecifier(const QString &str)
|
|
||||||
{
|
|
||||||
static const QStringList items = QStringList()
|
|
||||||
<< QLatin1String("private")
|
|
||||||
<< QLatin1String("protected")
|
|
||||||
<< QLatin1String("public");
|
|
||||||
return items.contains(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool startsWithDigit(const QString &str)
|
bool startsWithDigit(const QString &str)
|
||||||
{
|
{
|
||||||
return !str.isEmpty() && str.at(0).isDigit();
|
return !str.isEmpty() && str.at(0).isDigit();
|
||||||
@@ -1270,13 +1260,13 @@ void QtDumperHelper::evaluationParameters(const WatchData &data,
|
|||||||
inBuffer->clear();
|
inBuffer->clear();
|
||||||
inBuffer->append(outertype.toUtf8());
|
inBuffer->append(outertype.toUtf8());
|
||||||
inBuffer->append('\0');
|
inBuffer->append('\0');
|
||||||
inBuffer->append(data.iname.toUtf8());
|
inBuffer->append(data.iname);
|
||||||
inBuffer->append('\0');
|
inBuffer->append('\0');
|
||||||
inBuffer->append(data.exp.toUtf8());
|
inBuffer->append(data.exp);
|
||||||
inBuffer->append('\0');
|
inBuffer->append('\0');
|
||||||
inBuffer->append(inner.toUtf8());
|
inBuffer->append(inner.toUtf8());
|
||||||
inBuffer->append('\0');
|
inBuffer->append('\0');
|
||||||
inBuffer->append(data.iname.toUtf8());
|
inBuffer->append(data.iname);
|
||||||
inBuffer->append('\0');
|
inBuffer->append('\0');
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@@ -1361,6 +1351,17 @@ static bool gdbMiGetStringValue(QString *target,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool gdbMiGetByteArrayValue(QByteArray *target,
|
||||||
|
const GdbMi &node,
|
||||||
|
const char *child,
|
||||||
|
const char *encodingChild = 0)
|
||||||
|
{
|
||||||
|
QString str;
|
||||||
|
const bool success = gdbMiGetStringValue(&str, node, child, encodingChild);
|
||||||
|
*target = str.toLatin1();
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
static bool gdbMiGetBoolValue(bool *target,
|
static bool gdbMiGetBoolValue(bool *target,
|
||||||
const GdbMi &node,
|
const GdbMi &node,
|
||||||
const char *child)
|
const char *child)
|
||||||
@@ -1377,7 +1378,8 @@ static bool gdbMiGetBoolValue(bool *target,
|
|||||||
* (next level only, it is not further inherited). For example, the root item
|
* (next level only, it is not further inherited). For example, the root item
|
||||||
* can provide a "childtype" node that specifies the type of the children. */
|
* can provide a "childtype" node that specifies the type of the children. */
|
||||||
|
|
||||||
struct GdbMiRecursionContext {
|
struct GdbMiRecursionContext
|
||||||
|
{
|
||||||
GdbMiRecursionContext(int recursionLevelIn = 0) :
|
GdbMiRecursionContext(int recursionLevelIn = 0) :
|
||||||
recursionLevel(recursionLevelIn), childNumChild(-1), childIndex(0) {}
|
recursionLevel(recursionLevelIn), childNumChild(-1), childIndex(0) {}
|
||||||
|
|
||||||
@@ -1385,7 +1387,7 @@ struct GdbMiRecursionContext {
|
|||||||
int childNumChild;
|
int childNumChild;
|
||||||
int childIndex;
|
int childIndex;
|
||||||
QString childType;
|
QString childType;
|
||||||
QString parentIName;
|
QByteArray parentIName;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gbdMiToWatchData(const GdbMi &root,
|
static void gbdMiToWatchData(const GdbMi &root,
|
||||||
@@ -1396,16 +1398,19 @@ static void gbdMiToWatchData(const GdbMi &root,
|
|||||||
qDebug() << Q_FUNC_INFO << '\n' << root.toString(false, 0);
|
qDebug() << Q_FUNC_INFO << '\n' << root.toString(false, 0);
|
||||||
WatchData w;
|
WatchData w;
|
||||||
QString v;
|
QString v;
|
||||||
|
QByteArray b;
|
||||||
// Check for name/iname and use as expression default
|
// Check for name/iname and use as expression default
|
||||||
if (ctx.recursionLevel == 0) {
|
if (ctx.recursionLevel == 0) {
|
||||||
// parents have only iname, from which name is derived
|
// parents have only iname, from which name is derived
|
||||||
if (!gdbMiGetStringValue(&w.iname, root, "iname"))
|
QString iname;
|
||||||
|
if (!gdbMiGetStringValue(&iname, root, "iname"))
|
||||||
qWarning("Internal error: iname missing");
|
qWarning("Internal error: iname missing");
|
||||||
w.name = w.iname;
|
w.iname = iname.toLatin1();
|
||||||
|
w.name = iname;
|
||||||
const int lastDotPos = w.name.lastIndexOf(QLatin1Char('.'));
|
const int lastDotPos = w.name.lastIndexOf(QLatin1Char('.'));
|
||||||
if (lastDotPos != -1)
|
if (lastDotPos != -1)
|
||||||
w.name.remove(0, lastDotPos + 1);
|
w.name.remove(0, lastDotPos + 1);
|
||||||
w.exp = w.name;
|
w.exp = w.name.toLatin1();
|
||||||
} else {
|
} else {
|
||||||
// Children can have a 'name' attribute. If missing, assume array index
|
// Children can have a 'name' attribute. If missing, assume array index
|
||||||
// For display purposes, it can be overridden by "key"
|
// For display purposes, it can be overridden by "key"
|
||||||
@@ -1414,8 +1419,8 @@ static void gbdMiToWatchData(const GdbMi &root,
|
|||||||
}
|
}
|
||||||
// Set iname
|
// Set iname
|
||||||
w.iname = ctx.parentIName;
|
w.iname = ctx.parentIName;
|
||||||
w.iname += QLatin1Char('.');
|
w.iname += '.';
|
||||||
w.iname += w.name;
|
w.iname += w.name.toLatin1();
|
||||||
// Key?
|
// Key?
|
||||||
QString key;
|
QString key;
|
||||||
if (gdbMiGetStringValue(&key, root, "key", "keyencoded")) {
|
if (gdbMiGetStringValue(&key, root, "key", "keyencoded")) {
|
||||||
@@ -1427,12 +1432,12 @@ static void gbdMiToWatchData(const GdbMi &root,
|
|||||||
qWarning("%s\n", qPrintable(msg));
|
qWarning("%s\n", qPrintable(msg));
|
||||||
}
|
}
|
||||||
gdbMiGetStringValue(&w.displayedType, root, "displayedtype");
|
gdbMiGetStringValue(&w.displayedType, root, "displayedtype");
|
||||||
if (gdbMiGetStringValue(&v, root, "editvalue"))
|
if (gdbMiGetByteArrayValue(&b, root, "editvalue"))
|
||||||
w.editvalue = v.toLatin1();
|
w.editvalue = b;
|
||||||
if (gdbMiGetStringValue(&v, root, "exp"))
|
if (gdbMiGetByteArrayValue(&b, root, "exp"))
|
||||||
w.exp = v;
|
w.exp = b;
|
||||||
gdbMiGetStringValue(&w.addr, root, "addr");
|
gdbMiGetByteArrayValue(&w.addr, root, "addr");
|
||||||
gdbMiGetStringValue(&w.saddr, root, "saddr");
|
gdbMiGetByteArrayValue(&w.saddr, root, "saddr");
|
||||||
gdbMiGetBoolValue(&w.valueEnabled, root, "valueenabled");
|
gdbMiGetBoolValue(&w.valueEnabled, root, "valueenabled");
|
||||||
gdbMiGetBoolValue(&w.valueEditable, root, "valueeditable");
|
gdbMiGetBoolValue(&w.valueEditable, root, "valueeditable");
|
||||||
if (gdbMiGetStringValue(&v, root, "valuetooltip", "valuetooltipencoded"))
|
if (gdbMiGetStringValue(&v, root, "valuetooltip", "valuetooltipencoded"))
|
||||||
|
@@ -55,7 +55,7 @@ namespace Internal {
|
|||||||
class WatchData;
|
class WatchData;
|
||||||
class GdbMi;
|
class GdbMi;
|
||||||
|
|
||||||
QString dotEscape(QString str);
|
QByteArray dotEscape(QByteArray str);
|
||||||
QString currentTime();
|
QString currentTime();
|
||||||
bool isSkippableFunction(const QString &funcName, const QString &fileName);
|
bool isSkippableFunction(const QString &funcName, const QString &fileName);
|
||||||
bool isLeavableFunction(const QString &funcName, const QString &fileName);
|
bool isLeavableFunction(const QString &funcName, const QString &fileName);
|
||||||
@@ -71,7 +71,6 @@ bool hasSideEffects(const QString &exp);
|
|||||||
bool isKeyWord(const QString &exp);
|
bool isKeyWord(const QString &exp);
|
||||||
bool isPointerType(const QString &type);
|
bool isPointerType(const QString &type);
|
||||||
bool isCharPointerType(const QString &type);
|
bool isCharPointerType(const QString &type);
|
||||||
bool isAccessSpecifier(const QString &str);
|
|
||||||
bool startsWithDigit(const QString &str);
|
bool startsWithDigit(const QString &str);
|
||||||
QString stripPointerType(QString type);
|
QString stripPointerType(QString type);
|
||||||
QString gdbQuoteTypes(const QString &type);
|
QString gdbQuoteTypes(const QString &type);
|
||||||
|
Reference in New Issue
Block a user