Merge commit 'origin/1.3'

Conflicts:
	src/plugins/qt4projectmanager/qt4project.cpp
This commit is contained in:
con
2009-11-04 19:15:14 +01:00
40 changed files with 598 additions and 328 deletions
+1 -2
View File
@@ -27,9 +27,8 @@ qch_docs.depends += html_docs
qch_docs.files = $$QCH_FILE qch_docs.files = $$QCH_FILE
unix:!macx { unix:!macx {
system("mkdir -p `dirname $$QCH_FILE` && touch $$QCH_FILE")
qch_docs.path = /share/doc/qtcreator qch_docs.path = /share/doc/qtcreator
qch_docs.CONFIG += no_check_exist
INSTALLS += qch_docs INSTALLS += qch_docs
} }
+1 -1
View File
@@ -1639,7 +1639,7 @@ static void qDumpQList(QDumper &d)
} }
qCheckAccess(pdata); qCheckAccess(pdata);
d.putItemCount("value", n); d.putItemCount("value", nn);
d.putItem("valueeditable", "false"); d.putItem("valueeditable", "false");
d.putItem("numchild", n); d.putItem("numchild", n);
if (d.dumpChildren) { if (d.dumpChildren) {
+19
View File
@@ -152,6 +152,25 @@ ClassBinding *NamespaceBinding::findClassBinding(Name *name, QSet<Binding *> *pr
if (processed->contains(this)) if (processed->contains(this))
return 0; return 0;
if (const QualifiedNameId *q = name->asQualifiedNameId()) {
Binding *current = this;
for (unsigned i = 0; i < q->nameCount(); ++i) {
Identifier *nameId = q->nameAt(i)->identifier();
if (! nameId)
return 0;
QSet<Binding *> visited;
Binding *binding = current->findClassOrNamespaceBinding(nameId, &visited); // ### TODO: check recursion.
if (! binding)
return 0;
current = binding;
}
return current->asClassBinding();
}
processed->insert(this); processed->insert(this);
Identifier *id = name->identifier(); Identifier *id = name->identifier();
+9
View File
@@ -59,6 +59,7 @@ void FindUsages::setGlobalNamespaceBinding(NamespaceBindingPtr globalNamespaceBi
QList<int> FindUsages::operator()(Symbol *symbol, Identifier *id, AST *ast) QList<int> FindUsages::operator()(Symbol *symbol, Identifier *id, AST *ast)
{ {
_processed.clear();
_references.clear(); _references.clear();
_declSymbol = symbol; _declSymbol = symbol;
_id = id; _id = id;
@@ -92,6 +93,9 @@ QString FindUsages::matchingLine(const Token &tk) const
void FindUsages::reportResult(unsigned tokenIndex, const QList<Symbol *> &candidates) void FindUsages::reportResult(unsigned tokenIndex, const QList<Symbol *> &candidates)
{ {
if (_processed.contains(tokenIndex))
return;
const bool isStrongResult = checkCandidates(candidates); const bool isStrongResult = checkCandidates(candidates);
if (isStrongResult) if (isStrongResult)
@@ -100,6 +104,11 @@ void FindUsages::reportResult(unsigned tokenIndex, const QList<Symbol *> &candid
void FindUsages::reportResult(unsigned tokenIndex) void FindUsages::reportResult(unsigned tokenIndex)
{ {
if (_processed.contains(tokenIndex))
return;
_processed.insert(tokenIndex);
const Token &tk = tokenAt(tokenIndex); const Token &tk = tokenAt(tokenIndex);
const QString lineText = matchingLine(tk); const QString lineText = matchingLine(tk);
+1
View File
@@ -114,6 +114,7 @@ private:
QList<int> _references; QList<int> _references;
LookupContext _previousContext; LookupContext _previousContext;
int _inSimpleDeclaration; int _inSimpleDeclaration;
QSet<unsigned> _processed;
}; };
} // end of namespace CPlusPlus } // end of namespace CPlusPlus
@@ -57,17 +57,22 @@ void ProgressManagerPrivate::init()
void ProgressManagerPrivate::cancelTasks(const QString &type) void ProgressManagerPrivate::cancelTasks(const QString &type)
{ {
bool found = false;
QMap<QFutureWatcher<void> *, QString>::iterator task = m_runningTasks.begin(); QMap<QFutureWatcher<void> *, QString>::iterator task = m_runningTasks.begin();
while (task != m_runningTasks.end()) { while (task != m_runningTasks.end()) {
if (task.value() != type) { if (task.value() != type) {
++task; ++task;
continue; continue;
} }
found = true;
disconnect(task.key(), SIGNAL(finished()), this, SLOT(taskFinished())); disconnect(task.key(), SIGNAL(finished()), this, SLOT(taskFinished()));
task.key()->cancel(); task.key()->cancel();
delete task.key(); delete task.key();
task = m_runningTasks.erase(task); task = m_runningTasks.erase(task);
} }
if (found) {
emit allTasksFinished(type);
}
} }
void ProgressManagerPrivate::cancelAllRunningTasks() void ProgressManagerPrivate::cancelAllRunningTasks()
@@ -88,6 +93,7 @@ FutureProgress *ProgressManagerPrivate::addTask(const QFuture<void> &future, con
m_runningTasks.insert(watcher, type); m_runningTasks.insert(watcher, type);
connect(watcher, SIGNAL(finished()), this, SLOT(taskFinished())); connect(watcher, SIGNAL(finished()), this, SLOT(taskFinished()));
watcher->setFuture(future); watcher->setFuture(future);
emit taskStarted(type);
return m_progressView->addTask(future, title, type, persistency); return m_progressView->addTask(future, title, type, persistency);
} }
@@ -101,6 +107,11 @@ void ProgressManagerPrivate::taskFinished()
QObject *taskObject = sender(); QObject *taskObject = sender();
QTC_ASSERT(taskObject, return); QTC_ASSERT(taskObject, return);
QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject); QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject);
QString type = m_runningTasks.value(task);
m_runningTasks.remove(task); m_runningTasks.remove(task);
delete task; delete task;
if (!m_runningTasks.values().contains(type)) {
emit allTasksFinished(type);
}
} }
@@ -51,6 +51,10 @@ public:
public slots: public slots:
virtual void cancelTasks(const QString &type) = 0; virtual void cancelTasks(const QString &type) = 0;
signals:
void taskStarted(const QString &type);
void allTasksFinished(const QString &type);
}; };
} // namespace Core } // namespace Core
+1
View File
@@ -68,6 +68,7 @@ CodepasterPlugin::CodepasterPlugin()
CodepasterPlugin::~CodepasterPlugin() CodepasterPlugin::~CodepasterPlugin()
{ {
qDeleteAll(m_protocols);
} }
bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_message) bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_message)
+27 -8
View File
@@ -43,6 +43,7 @@
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <texteditor/completionsupport.h> #include <texteditor/completionsupport.h>
#include <texteditor/fontsettings.h> #include <texteditor/fontsettings.h>
#include <texteditor/storagesettings.h> #include <texteditor/storagesettings.h>
@@ -55,7 +56,6 @@
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtGui/QMenu> #include <QtGui/QMenu>
#include <QtGui/QAction>
using namespace CppEditor::Internal; using namespace CppEditor::Internal;
@@ -211,18 +211,18 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
QAction *findUsagesAction = new QAction(tr("Find Usages"), this); m_findUsagesAction = new QAction(tr("Find Usages"), this);
cmd = am->registerAction(findUsagesAction, Constants::FIND_USAGES, context); cmd = am->registerAction(m_findUsagesAction, Constants::FIND_USAGES, context);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
connect(findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages())); connect(m_findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages()));
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
QAction *renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol under Cursor"), this); m_renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol under Cursor"), this);
cmd = am->registerAction(renameSymbolUnderCursorAction, cmd = am->registerAction(m_renameSymbolUnderCursorAction,
Constants::RENAME_SYMBOL_UNDER_CURSOR, context); Constants::RENAME_SYMBOL_UNDER_CURSOR, context);
cmd->setDefaultKeySequence(QKeySequence("CTRL+SHIFT+R")); cmd->setDefaultKeySequence(QKeySequence("CTRL+SHIFT+R"));
connect(renameSymbolUnderCursorAction, SIGNAL(triggered()), this, SLOT(renameSymbolUnderCursor())); connect(m_renameSymbolUnderCursorAction, SIGNAL(triggered()), this, SLOT(renameSymbolUnderCursor()));
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd); am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
@@ -244,7 +244,10 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION); cmd = am->command(TextEditor::Constants::UN_COMMENT_SELECTION);
contextMenu->addAction(cmd); contextMenu->addAction(cmd);
connect(core->progressManager(), SIGNAL(taskStarted(QString)),
this, SLOT(onTaskStarted(QString)));
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
this, SLOT(onAllTasksFinished(QString)));
readSettings(); readSettings();
return true; return true;
} }
@@ -300,4 +303,20 @@ void CppPlugin::findUsages()
editor->findUsages(); editor->findUsages();
} }
void CppPlugin::onTaskStarted(const QString &type)
{
if (type == CppTools::Constants::TASK_INDEX) {
m_renameSymbolUnderCursorAction->setEnabled(false);
m_findUsagesAction->setEnabled(false);
}
}
void CppPlugin::onAllTasksFinished(const QString &type)
{
if (type == CppTools::Constants::TASK_INDEX) {
m_renameSymbolUnderCursorAction->setEnabled(true);
m_findUsagesAction->setEnabled(true);
}
}
Q_EXPORT_PLUGIN(CppPlugin) Q_EXPORT_PLUGIN(CppPlugin)
+8 -3
View File
@@ -30,12 +30,13 @@
#ifndef CPPPLUGIN_H #ifndef CPPPLUGIN_H
#define CPPPLUGIN_H #define CPPPLUGIN_H
#include <QtCore/QtPlugin>
#include <QtCore/QStringList>
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/editormanager/ieditorfactory.h>
#include <QtCore/QtPlugin>
#include <QtCore/QStringList>
#include <QtGui/QAction>
namespace TextEditor { namespace TextEditor {
class TextEditorActionHandler; class TextEditorActionHandler;
} // namespace TextEditor } // namespace TextEditor
@@ -74,6 +75,8 @@ private slots:
void switchDeclarationDefinition(); void switchDeclarationDefinition();
void jumpToDefinition(); void jumpToDefinition();
void renameSymbolUnderCursor(); void renameSymbolUnderCursor();
void onTaskStarted(const QString &type);
void onAllTasksFinished(const QString &type);
void findUsages(); void findUsages();
private: private:
@@ -85,6 +88,8 @@ private:
TextEditor::TextEditorActionHandler *m_actionHandler; TextEditor::TextEditorActionHandler *m_actionHandler;
bool m_sortedMethodOverview; bool m_sortedMethodOverview;
QAction *m_renameSymbolUnderCursorAction;
QAction *m_findUsagesAction;
}; };
class CppEditorFactory : public Core::IEditorFactory class CppEditorFactory : public Core::IEditorFactory
+8 -8
View File
@@ -1124,14 +1124,6 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &ba
m_completionOperator, m_completionOperator,
&replacedDotOperator); &replacedDotOperator);
if (replacedDotOperator) {
// Replace . with ->
int length = m_editor->position() - m_startPosition + 1;
m_editor->setCurPos(m_startPosition - 1);
m_editor->replace(length, QLatin1String("->"));
++m_startPosition;
}
QList<Symbol *> classObjectCandidates; QList<Symbol *> classObjectCandidates;
foreach (const TypeOfExpression::Result &r, classObjectResults) { foreach (const TypeOfExpression::Result &r, classObjectResults) {
FullySpecifiedType ty = r.first.simplified(); FullySpecifiedType ty = r.first.simplified();
@@ -1150,6 +1142,14 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &ba
} }
} }
if (replacedDotOperator && ! classObjectCandidates.isEmpty()) {
// Replace . with ->
int length = m_editor->position() - m_startPosition + 1;
m_editor->setCurPos(m_startPosition - 1);
m_editor->replace(length, QLatin1String("->"));
++m_startPosition;
}
completeClass(classObjectCandidates, context, /*static lookup = */ false); completeClass(classObjectCandidates, context, /*static lookup = */ false);
if (! m_completions.isEmpty()) if (! m_completions.isEmpty())
return true; return true;
+18 -2
View File
@@ -62,7 +62,8 @@ using namespace CppTools::Internal;
using namespace CPlusPlus; using namespace CPlusPlus;
CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelManager) CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelManager)
: _modelManager(modelManager), : QObject(modelManager),
_modelManager(modelManager),
_resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>()) _resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>())
{ {
m_watcher.setPendingResultsLimit(1); m_watcher.setPendingResultsLimit(1);
@@ -249,7 +250,21 @@ static void applyChanges(QTextDocument *doc, const QString &text, const QList<Fi
foreach (const Find::SearchResultItem &item, items) { foreach (const Find::SearchResultItem &item, items) {
const int blockNumber = item.lineNumber - 1; const int blockNumber = item.lineNumber - 1;
QTextCursor tc(doc->findBlockByNumber(blockNumber)); QTextCursor tc(doc->findBlockByNumber(blockNumber));
tc.setPosition(tc.position() + item.searchTermStart);
const int cursorPosition = tc.position() + item.searchTermStart;
int cursorIndex = 0;
for (; cursorIndex < cursors.size(); ++cursorIndex) {
const QTextCursor &tc = cursors.at(cursorIndex);
if (tc.position() == cursorPosition)
break;
}
if (cursorIndex != cursors.size())
continue; // skip this change.
tc.setPosition(cursorPosition);
tc.setPosition(tc.position() + item.searchTermLength, tc.setPosition(tc.position() + item.searchTermLength,
QTextCursor::KeepAnchor); QTextCursor::KeepAnchor);
cursors.append(tc); cursors.append(tc);
@@ -335,6 +350,7 @@ void CppFindReferences::displayResult(int index)
void CppFindReferences::searchFinished() void CppFindReferences::searchFinished()
{ {
_resultWindow->finishSearch();
emit changed(); emit changed();
} }
+4
View File
@@ -195,8 +195,12 @@ DisassemblerViewAgent::~DisassemblerViewAgent()
if (d->editor) if (d->editor)
d->editor->deleteLater(); d->editor->deleteLater();
d->editor = 0; d->editor = 0;
delete d->locationMark;
d->locationMark = 0;
delete d; delete d;
d = 0; d = 0;
delete d->locationMark;
d->locationMark = 0;
} }
void DisassemblerViewAgent::cleanup() void DisassemblerViewAgent::cleanup()
+41 -22
View File
@@ -193,6 +193,11 @@ GdbEngine::GdbEngine(DebuggerManager *manager) :
m_trkOptions->fromSettings(Core::ICore::instance()->settings()); m_trkOptions->fromSettings(Core::ICore::instance()->settings());
m_gdbAdapter = 0; m_gdbAdapter = 0;
m_commandTimer = new QTimer(this);
m_commandTimer->setSingleShot(true);
m_commandTimer->setInterval(COMMAND_TIMEOUT);
connect(m_commandTimer, SIGNAL(timeout()), SLOT(commandTimeout()));
// Needs no resetting in initializeVariables() // Needs no resetting in initializeVariables()
m_busy = false; m_busy = false;
@@ -606,6 +611,9 @@ void GdbEngine::readGdbStandardError()
void GdbEngine::readGdbStandardOutput() void GdbEngine::readGdbStandardOutput()
{ {
if (m_commandTimer->isActive())
m_commandTimer->start(); // Retrigger
int newstart = 0; int newstart = 0;
int scan = m_inbuffer.size(); int scan = m_inbuffer.size();
@@ -734,7 +742,7 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd)
} }
if ((cmd.flags & NeedsStop) || !m_commandsToRunOnTemporaryBreak.isEmpty()) { if ((cmd.flags & NeedsStop) || !m_commandsToRunOnTemporaryBreak.isEmpty()) {
if (state() == InferiorStopped if (state() == InferiorStopped || state() == InferiorUnrunnable
|| state() == InferiorStarting || state() == AdapterStarted) { || state() == InferiorStarting || state() == AdapterStarted) {
// Can be safely sent now. // Can be safely sent now.
flushCommand(cmd); flushCommand(cmd);
@@ -796,10 +804,27 @@ void GdbEngine::flushCommand(const GdbCommand &cmd0)
m_gdbAdapter->write(cmd.command.toLatin1() + "\r\n"); m_gdbAdapter->write(cmd.command.toLatin1() + "\r\n");
m_commandTimer->start();
if (cmd.flags & LosesChild) if (cmd.flags & LosesChild)
setState(InferiorShuttingDown); setState(InferiorShuttingDown);
} }
void GdbEngine::commandTimeout()
{
// FIXME this needs a proper message box
debugMessage(_("TIMED OUT WAITING FOR GDB REPLY. COMMANDS STILL IN PROGRESS:"));
QList<int> keys = m_cookieForToken.keys();
qSort(keys);
foreach (int key, keys) {
const GdbCommand &cmd = m_cookieForToken[key];
debugMessage(_(" %1: %2 => %3").arg(key).arg(cmd.command).arg(_(cmd.callbackName)));
}
// This is an entirely undefined state, so we just pull the emergency brake.
setState(EngineShuttingDown, true);
m_gdbProc.kill();
}
void GdbEngine::handleResultRecord(GdbResponse *response) void GdbEngine::handleResultRecord(GdbResponse *response)
{ {
//qDebug() << "TOKEN:" << response.token //qDebug() << "TOKEN:" << response.token
@@ -927,6 +952,9 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
} else { } else {
PENDING_DEBUG("MISSING TOKENS: " << m_cookieForToken.keys()); PENDING_DEBUG("MISSING TOKENS: " << m_cookieForToken.keys());
} }
if (m_cookieForToken.isEmpty())
m_commandTimer->stop();
} }
void GdbEngine::executeDebuggerCommand(const QString &command) void GdbEngine::executeDebuggerCommand(const QString &command)
@@ -1426,7 +1454,6 @@ void GdbEngine::shutdown()
m_gdbAdapter->shutdown(); m_gdbAdapter->shutdown();
// fall-through // fall-through
case AdapterStartFailed: // Adapter "did something", but it did not help case AdapterStartFailed: // Adapter "did something", but it did not help
// FIXME set some timeout?
if (m_gdbProc.state() == QProcess::Running) { if (m_gdbProc.state() == QProcess::Running) {
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit)); postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
} else { } else {
@@ -1437,7 +1464,6 @@ void GdbEngine::shutdown()
case InferiorRunning: case InferiorRunning:
case InferiorStopping: case InferiorStopping:
case InferiorStopped: case InferiorStopped:
// FIXME set some timeout?
postCommand(_(m_gdbAdapter->inferiorShutdownCommand()), postCommand(_(m_gdbAdapter->inferiorShutdownCommand()),
NeedsStop | LosesChild, CB(handleInferiorShutdown)); NeedsStop | LosesChild, CB(handleInferiorShutdown));
break; break;
@@ -1446,7 +1472,6 @@ void GdbEngine::shutdown()
case InferiorShutDown: case InferiorShutDown:
case InferiorShutdownFailed: // Whatever case InferiorShutdownFailed: // Whatever
case InferiorUnrunnable: case InferiorUnrunnable:
// FIXME set some timeout?
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit)); postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
setState(EngineShuttingDown); // Do it after posting the command! setState(EngineShuttingDown); // Do it after posting the command!
break; break;
@@ -3246,23 +3271,13 @@ void GdbEngine::handleVarCreate(const GdbResponse &response)
if (response.resultClass == GdbResultDone) { if (response.resultClass == GdbResultDone) {
data.variable = data.iname; data.variable = data.iname;
setWatchDataType(data, response.data.findChild("type")); setWatchDataType(data, response.data.findChild("type"));
if (hasDebuggingHelperForType(data.type)) { if (manager()->watchHandler()->isExpandedIName(data.iname)
// we do not trust gdb if we have a custom dumper && !response.data.findChild("children").isValid())
if (response.data.findChild("children").isValid()) data.setChildrenNeeded();
data.setChildrenUnneeded(); else
else if (manager()->watchHandler()->isExpandedIName(data.iname)) data.setChildrenUnneeded();
data.setChildrenNeeded(); setWatchDataChildCount(data, response.data.findChild("numchild"));
insertData(data); insertData(data);
} else {
if (response.data.findChild("children").isValid())
data.setChildrenUnneeded();
else if (manager()->watchHandler()->isExpandedIName(data.iname))
data.setChildrenNeeded();
setWatchDataChildCount(data, response.data.findChild("numchild"));
//if (data.isValueNeeded() && data.childCount > 0)
// data.setValue(QString());
insertData(data);
}
} else { } else {
data.setError(QString::fromLocal8Bit(response.data.findChild("msg").data())); data.setError(QString::fromLocal8Bit(response.data.findChild("msg").data()));
if (data.isWatcher()) { if (data.isWatcher()) {
@@ -3707,7 +3722,8 @@ void GdbEngine::insertData(const WatchData &data0)
void GdbEngine::handleVarListChildrenHelper(const GdbMi &item, void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
const WatchData &parent) const WatchData &parent)
{ {
//qDebug() << "VAR_LIST_CHILDREN: APPENDEE" << data.toString(); //qDebug() << "VAR_LIST_CHILDREN: PARENT" << parent.toString();
//qDebug() << "VAR_LIST_CHILDREN: ITEM" << item.toString();
QByteArray exp = item.findChild("exp").data(); QByteArray exp = item.findChild("exp").data();
QByteArray name = item.findChild("name").data(); QByteArray name = item.findChild("name").data();
if (isAccessSpecifier(_(exp))) { if (isAccessSpecifier(_(exp))) {
@@ -4243,6 +4259,9 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
m_gdbProc.disconnect(); // From any previous runs m_gdbProc.disconnect(); // From any previous runs
QString location = gdb; QString location = gdb;
const QByteArray env = qgetenv("QTC_DEBUGGER_PATH");
if (!env.isEmpty())
location = QString::fromLatin1(env);
if (location.isEmpty()) if (location.isEmpty())
location = theDebuggerStringSetting(GdbLocation); location = theDebuggerStringSetting(GdbLocation);
QStringList gdbArgs; QStringList gdbArgs;
+4
View File
@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QAction; class QAction;
class QAbstractItemModel; class QAbstractItemModel;
class QTimer;
class QWidget; class QWidget;
class QMainWindow; class QMainWindow;
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -228,9 +229,12 @@ private: ////////// Gdb Command Management //////////
const QVariant &cookie = QVariant()); const QVariant &cookie = QVariant());
void postCommandHelper(const GdbCommand &cmd); void postCommandHelper(const GdbCommand &cmd);
void flushQueuedCommands(); void flushQueuedCommands();
Q_SLOT void commandTimeout();
void setTokenBarrier(); void setTokenBarrier();
QHash<int, GdbCommand> m_cookieForToken; QHash<int, GdbCommand> m_cookieForToken;
QTimer *m_commandTimer;
enum { COMMAND_TIMEOUT = 20000 };
QByteArray m_pendingConsoleStreamOutput; QByteArray m_pendingConsoleStreamOutput;
QByteArray m_pendingLogStreamOutput; QByteArray m_pendingLogStreamOutput;
+6
View File
@@ -73,6 +73,12 @@ StackWindow::StackWindow(DebuggerManager *manager, QWidget *parent)
this, SLOT(showAddressColumn(bool))); this, SLOT(showAddressColumn(bool)));
} }
StackWindow::~StackWindow()
{
// FIXME: leak
//delete m_disassemblerAgent;
}
void StackWindow::showAddressColumn(bool on) void StackWindow::showAddressColumn(bool on)
{ {
setColumnHidden(4, !on); setColumnHidden(4, !on);
+1
View File
@@ -50,6 +50,7 @@ class StackWindow : public QTreeView
public: public:
StackWindow(DebuggerManager *manager, QWidget *parent = 0); StackWindow(DebuggerManager *manager, QWidget *parent = 0);
~StackWindow();
signals: signals:
void frameActivated(int); void frameActivated(int);
+11 -4
View File
@@ -41,6 +41,7 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QEvent> #include <QtCore/QEvent>
#include <QtCore/QtAlgorithms> #include <QtCore/QtAlgorithms>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
#include <QtCore/QTimer> #include <QtCore/QTimer>
@@ -361,6 +362,11 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type)
} }
} }
WatchModel::~WatchModel()
{
delete m_root;
}
WatchItem *WatchModel::rootItem() const WatchItem *WatchModel::rootItem() const
{ {
return m_root; return m_root;
@@ -420,7 +426,7 @@ void WatchModel::removeOutdated()
void WatchModel::removeOutdatedHelper(WatchItem *item) void WatchModel::removeOutdatedHelper(WatchItem *item)
{ {
if (item->generation < generationCounter) { if (item->generation < generationCounter) {
removeItem(item); destroyItem(item);
} else { } else {
foreach (WatchItem *child, item->children) foreach (WatchItem *child, item->children)
removeOutdatedHelper(child); removeOutdatedHelper(child);
@@ -428,7 +434,7 @@ void WatchModel::removeOutdatedHelper(WatchItem *item)
} }
} }
void WatchModel::removeItem(WatchItem *item) void WatchModel::destroyItem(WatchItem *item)
{ {
WatchItem *parent = item->parent; WatchItem *parent = item->parent;
QModelIndex index = watchIndex(parent); QModelIndex index = watchIndex(parent);
@@ -437,6 +443,7 @@ void WatchModel::removeItem(WatchItem *item)
beginRemoveRows(index, n, n); beginRemoveRows(index, n, n);
parent->children.removeAt(n); parent->children.removeAt(n);
endRemoveRows(); endRemoveRows();
delete item;
} }
static QString parentName(const QString &iname) static QString parentName(const QString &iname)
@@ -1187,7 +1194,7 @@ void WatchHandler::removeData(const QString &iname)
return; return;
WatchItem *item = model->findItem(iname, model->m_root); WatchItem *item = model->findItem(iname, model->m_root);
if (item) if (item)
model->removeItem(item); model->destroyItem(item);
} }
void WatchHandler::watchExpression() void WatchHandler::watchExpression()
@@ -1302,7 +1309,7 @@ void WatchHandler::removeWatchExpression(const QString &exp)
m_watcherNames.remove(exp); m_watcherNames.remove(exp);
foreach (WatchItem *item, m_watchers->rootItem()->children) { foreach (WatchItem *item, m_watchers->rootItem()->children) {
if (item->exp == exp) { if (item->exp == exp) {
m_watchers->removeItem(item); m_watchers->destroyItem(item);
saveWatchers(); saveWatchers();
break; break;
} }
+2 -1
View File
@@ -180,6 +180,7 @@ class WatchModel : public QAbstractItemModel
private: private:
explicit WatchModel(WatchHandler *handler, WatchType type); explicit WatchModel(WatchHandler *handler, WatchType type);
virtual ~WatchModel();
QVariant data(const QModelIndex &index, int role) const; QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role); bool setData(const QModelIndex &index, const QVariant &value, int role);
@@ -209,7 +210,7 @@ private:
void removeOutdated(); void removeOutdated();
void removeOutdatedHelper(WatchItem *item); void removeOutdatedHelper(WatchItem *item);
WatchItem *rootItem() const; WatchItem *rootItem() const;
void removeItem(WatchItem *item); void destroyItem(WatchItem *item);
void emitDataChanged(int column, void emitDataChanged(int column,
const QModelIndex &parentIndex = QModelIndex()); const QModelIndex &parentIndex = QModelIndex());
+25 -18
View File
@@ -53,7 +53,8 @@ static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults");
SearchResultWindow::SearchResultWindow() SearchResultWindow::SearchResultWindow()
: m_currentSearch(0), : m_currentSearch(0),
m_isShowingReplaceUI(false) m_isShowingReplaceUI(false),
m_focusReplaceEdit(false)
{ {
m_widget = new QStackedWidget; m_widget = new QStackedWidget;
m_widget->setWindowTitle(name()); m_widget->setWindowTitle(name());
@@ -124,15 +125,13 @@ void SearchResultWindow::setShowReplaceUI(bool show)
m_isShowingReplaceUI = show; m_isShowingReplaceUI = show;
} }
bool SearchResultWindow::isShowingReplaceUI() const
{
return m_isShowingReplaceUI;
}
void SearchResultWindow::handleReplaceButton() void SearchResultWindow::handleReplaceButton()
{ {
QTC_ASSERT(m_currentSearch, return); QTC_ASSERT(m_currentSearch, return);
m_currentSearch->replaceButtonClicked(m_replaceTextEdit->text(), checkedItems()); // check if button is actually enabled, because this is also triggered
// by pressing return in replace line edit
if (m_replaceButton->isEnabled())
m_currentSearch->replaceButtonClicked(m_replaceTextEdit->text(), checkedItems());
} }
QList<SearchResultItem> SearchResultWindow::checkedItems() const QList<SearchResultItem> SearchResultWindow::checkedItems() const
@@ -177,9 +176,19 @@ SearchResult *SearchResultWindow::startNewSearch(SearchMode searchOrSearchAndRep
return m_currentSearch; return m_currentSearch;
} }
void SearchResultWindow::finishSearch()
{
if (m_items.count()) {
m_replaceButton->setEnabled(true);
} else {
showNoMatchesFound();
}
}
void SearchResultWindow::clearContents() void SearchResultWindow::clearContents()
{ {
setReplaceUIEnabled(false); m_replaceTextEdit->setEnabled(false);
m_replaceButton->setEnabled(false);
m_replaceTextEdit->clear(); m_replaceTextEdit->clear();
m_searchResultTreeView->clear(); m_searchResultTreeView->clear();
m_items.clear(); m_items.clear();
@@ -189,7 +198,8 @@ void SearchResultWindow::clearContents()
void SearchResultWindow::showNoMatchesFound() void SearchResultWindow::showNoMatchesFound()
{ {
setReplaceUIEnabled(false); m_replaceTextEdit->setEnabled(false);
m_replaceButton->setEnabled(false);
m_widget->setCurrentWidget(m_noMatchesFoundDisplay); m_widget->setCurrentWidget(m_noMatchesFoundDisplay);
} }
@@ -220,7 +230,8 @@ void SearchResultWindow::setFocus()
m_searchResultTreeView->setFocus(); m_searchResultTreeView->setFocus();
} else { } else {
if (!m_widget->focusWidget() if (!m_widget->focusWidget()
|| m_widget->focusWidget() == m_replaceTextEdit) { || m_widget->focusWidget() == m_replaceTextEdit
|| m_focusReplaceEdit) {
m_replaceTextEdit->setFocus(); m_replaceTextEdit->setFocus();
} else { } else {
m_searchResultTreeView->setFocus(); m_searchResultTreeView->setFocus();
@@ -257,20 +268,16 @@ void SearchResultWindow::addResult(const QString &fileName, int lineNumber, cons
m_items.append(item); m_items.append(item);
m_searchResultTreeView->appendResultLine(index, fileName, lineNumber, rowText, searchTermStart, searchTermLength); m_searchResultTreeView->appendResultLine(index, fileName, lineNumber, rowText, searchTermStart, searchTermLength);
if (index == 0) { if (index == 0) {
setReplaceUIEnabled(true); m_replaceTextEdit->setEnabled(true);
// We didn't have an item before, set the focus to the m_searchResultTreeView // We didn't have an item before, set the focus to the search widget
m_focusReplaceEdit = true;
setFocus(); setFocus();
m_focusReplaceEdit = false;
m_searchResultTreeView->selectionModel()->select(m_searchResultTreeView->model()->index(0, 0, QModelIndex()), QItemSelectionModel::Select); m_searchResultTreeView->selectionModel()->select(m_searchResultTreeView->model()->index(0, 0, QModelIndex()), QItemSelectionModel::Select);
emit navigateStateChanged(); emit navigateStateChanged();
} }
} }
void SearchResultWindow::setReplaceUIEnabled(bool enabled)
{
m_replaceTextEdit->setEnabled(enabled);
m_replaceButton->setEnabled(enabled);
}
void SearchResultWindow::handleExpandCollapseToolButton(bool checked) void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
{ {
m_searchResultTreeView->setAutoExpandResults(checked); m_searchResultTreeView->setAutoExpandResults(checked);
+4 -5
View File
@@ -103,9 +103,6 @@ public:
void setTextEditorFont(const QFont &font); void setTextEditorFont(const QFont &font);
void setShowReplaceUI(bool show);
bool isShowingReplaceUI() const;
void setTextToReplace(const QString &textToReplace); void setTextToReplace(const QString &textToReplace);
QString textToReplace() const; QString textToReplace() const;
@@ -114,17 +111,18 @@ public:
public slots: public slots:
void clearContents(); void clearContents();
void showNoMatchesFound();
void addResult(const QString &fileName, int lineNumber, const QString &lineText, void addResult(const QString &fileName, int lineNumber, const QString &lineText,
int searchTermStart, int searchTermLength, const QVariant &userData = QVariant()); int searchTermStart, int searchTermLength, const QVariant &userData = QVariant());
void finishSearch();
private slots: private slots:
void handleExpandCollapseToolButton(bool checked); void handleExpandCollapseToolButton(bool checked);
void handleJumpToSearchResult(int index, bool checked); void handleJumpToSearchResult(int index, bool checked);
void handleReplaceButton(); void handleReplaceButton();
void setReplaceUIEnabled(bool enabled); void showNoMatchesFound();
private: private:
void setShowReplaceUI(bool show);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
QList<SearchResultItem> checkedItems() const; QList<SearchResultItem> checkedItems() const;
@@ -140,6 +138,7 @@ private:
SearchResult *m_currentSearch; SearchResult *m_currentSearch;
QList<SearchResultItem> m_items; QList<SearchResultItem> m_items;
bool m_isShowingReplaceUI; bool m_isShowingReplaceUI;
bool m_focusReplaceEdit;
}; };
} // namespace Find } // namespace Find
+3 -3
View File
@@ -220,7 +220,7 @@ void CentralWidget::setSource(const QUrl &url)
qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage)); qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage));
if (!viewer && !lastViewer) { if (!viewer && !lastViewer) {
viewer = new HelpViewer(helpEngine, this); viewer = new HelpViewer(helpEngine, this, this);
viewer->installEventFilter(this); viewer->installEventFilter(this);
lastTabPage = tabWidget->addTab(viewer, QString()); lastTabPage = tabWidget->addTab(viewer, QString());
tabWidget->setCurrentIndex(lastTabPage); tabWidget->setCurrentIndex(lastTabPage);
@@ -428,7 +428,7 @@ void CentralWidget::setGlobalActions(const QList<QAction*> &actions)
void CentralWidget::setSourceInNewTab(const QUrl &url, int zoom) void CentralWidget::setSourceInNewTab(const QUrl &url, int zoom)
{ {
HelpViewer* viewer = new HelpViewer(helpEngine, this); HelpViewer* viewer = new HelpViewer(helpEngine, this, this);
viewer->installEventFilter(this); viewer->installEventFilter(this);
viewer->setZoom(zoom); viewer->setZoom(zoom);
viewer->setSource(url); viewer->setSource(url);
@@ -448,7 +448,7 @@ void CentralWidget::setSourceInNewTab(const QUrl &url, int zoom)
HelpViewer *CentralWidget::newEmptyTab() HelpViewer *CentralWidget::newEmptyTab()
{ {
HelpViewer* viewer = new HelpViewer(helpEngine, this); HelpViewer* viewer = new HelpViewer(helpEngine, this, this);
viewer->installEventFilter(this); viewer->installEventFilter(this);
viewer->setFocus(Qt::OtherFocusReason); viewer->setFocus(Qt::OtherFocusReason);
#if defined(QT_NO_WEBKIT) #if defined(QT_NO_WEBKIT)
+1 -1
View File
@@ -491,7 +491,7 @@ void HelpPlugin::createRightPaneSideBar()
addAutoReleasedObject(new Core::BaseRightPaneWidget(m_rightPaneSideBar)); addAutoReleasedObject(new Core::BaseRightPaneWidget(m_rightPaneSideBar));
rightPaneLayout->addWidget(w); rightPaneLayout->addWidget(w);
m_helpViewerForSideBar = new HelpViewer(m_helpEngine, 0); m_helpViewerForSideBar = new HelpViewer(m_helpEngine, 0, m_rightPaneSideBar);
Aggregation::Aggregate *agg = new Aggregation::Aggregate(); Aggregation::Aggregate *agg = new Aggregation::Aggregate();
agg->add(m_helpViewerForSideBar); agg->add(m_helpViewerForSideBar);
agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar)); agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar));
@@ -207,6 +207,7 @@ ProjectExplorerPlugin::ProjectExplorerPlugin()
ProjectExplorerPlugin::~ProjectExplorerPlugin() ProjectExplorerPlugin::~ProjectExplorerPlugin()
{ {
removeObject(d->m_welcomePlugin); removeObject(d->m_welcomePlugin);
delete d->m_welcomePlugin;
removeObject(this); removeObject(this);
delete d; delete d;
} }
@@ -1869,16 +1870,14 @@ void ProjectExplorerPlugin::showInGraphicalShell()
{ {
QTC_ASSERT(d->m_currentNode, return) QTC_ASSERT(d->m_currentNode, return)
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
QString explorer = Environment::systemEnvironment().searchInPath("explorer.exe"); const QString explorer = Environment::systemEnvironment().searchInPath("explorer.exe");
if (explorer.isEmpty()) { if (explorer.isEmpty()) {
QMessageBox::warning(Core::ICore::instance()->mainWindow(), QMessageBox::warning(Core::ICore::instance()->mainWindow(),
tr("Launching Windows Explorer failed"), tr("Launching Windows Explorer failed"),
tr("Could not find explorer.exe in path to launch Windows Explorer.")); tr("Could not find explorer.exe in path to launch Windows Explorer."));
return; return;
} }
QProcess::execute(explorer, QProcess::startDetached(explorer, QStringList(QLatin1String("/select,") + QDir::toNativeSeparators(d->m_currentNode->path())));
QStringList() << QString("/select,%1")
.arg(QDir::toNativeSeparators(d->m_currentNode->path())));
#elif defined(Q_OS_MAC) #elif defined(Q_OS_MAC)
QProcess::execute("/usr/bin/osascript", QStringList() QProcess::execute("/usr/bin/osascript", QStringList()
<< "-e" << "-e"
@@ -1889,15 +1888,15 @@ void ProjectExplorerPlugin::showInGraphicalShell()
<< "tell application \"Finder\" to activate"); << "tell application \"Finder\" to activate");
#else #else
// we cannot select a file here, because no file browser really supports it... // we cannot select a file here, because no file browser really supports it...
QFileInfo fileInfo(d->m_currentNode->path()); const QFileInfo fileInfo(d->m_currentNode->path());
QString xdgopen = Environment::systemEnvironment().searchInPath("xdg-open"); const QString xdgopen = Environment::systemEnvironment().searchInPath("xdg-open");
if (xdgopen.isEmpty()) { if (xdgopen.isEmpty()) {
QMessageBox::warning(Core::ICore::instance()->mainWindow(), QMessageBox::warning(Core::ICore::instance()->mainWindow(),
tr("Launching a file explorer failed"), tr("Launching a file explorer failed"),
tr("Could not find xdg-open to launch the native file explorer.")); tr("Could not find xdg-open to launch the native file explorer."));
return; return;
} }
QProcess::execute(xdgopen, QStringList() << fileInfo.path()); QProcess::startDetached(xdgopen, QStringList(fileInfo.path()));
#endif #endif
} }
@@ -35,18 +35,24 @@ namespace Internal {
struct ProjectExplorerSettings struct ProjectExplorerSettings
{ {
ProjectExplorerSettings() : buildBeforeRun(true), saveBeforeBuild(false),
showCompilerOutput(false), useJom(true) {}
bool buildBeforeRun; bool buildBeforeRun;
bool saveBeforeBuild; bool saveBeforeBuild;
bool showCompilerOutput; bool showCompilerOutput;
bool useJom; bool useJom;
bool operator==(const ProjectExplorerSettings &other) const {
return this->buildBeforeRun == other.buildBeforeRun
&& this->saveBeforeBuild == other.saveBeforeBuild
&& this->showCompilerOutput == other.showCompilerOutput
&& this->useJom == other.useJom;
}
}; };
inline bool operator==(const ProjectExplorerSettings &p1, const ProjectExplorerSettings &p2)
{
return p1.buildBeforeRun == p2.buildBeforeRun
&& p1.saveBeforeBuild == p2.saveBeforeBuild
&& p1.showCompilerOutput == p2.showCompilerOutput
&& p1.useJom == p2.useJom;
}
} // namespace ProjectExplorer } // namespace ProjectExplorer
} // namespace Internal } // namespace Internal
@@ -39,6 +39,11 @@ ProjectWelcomePage::ProjectWelcomePage()
} }
ProjectWelcomePage::~ProjectWelcomePage()
{
}
QWidget* ProjectWelcomePage::page() QWidget* ProjectWelcomePage::page()
{ {
return m_page; return m_page;
@@ -42,6 +42,7 @@ class ProjectWelcomePage : public Utils::IWelcomePage
Q_OBJECT Q_OBJECT
public: public:
ProjectWelcomePage(); ProjectWelcomePage();
~ProjectWelcomePage();
QWidget *page(); QWidget *page();
QString title() const { return tr("Develop"); } QString title() const { return tr("Develop"); }
+58 -49
View File
@@ -101,72 +101,81 @@ void WinGuiProcess::run()
ZeroMemory(m_pid, sizeof(PROCESS_INFORMATION)); ZeroMemory(m_pid, sizeof(PROCESS_INFORMATION));
m_exitCode = 0; m_exitCode = 0;
bool started = false;
HANDLE bufferReadyEvent = NULL; HANDLE bufferReadyEvent = NULL;
HANDLE dataReadyEvent = NULL; HANDLE dataReadyEvent = NULL;
HANDLE sharedFile = NULL; HANDLE sharedFile = NULL;
LPVOID sharedMem = NULL; LPVOID sharedMem = 0;
bool dbgInterface = setupDebugInterface(bufferReadyEvent, dataReadyEvent, sharedFile, sharedMem); do {
QString cmdLine = createWinCommandline(m_program, m_args); const bool dbgInterface = setupDebugInterface(bufferReadyEvent, dataReadyEvent, sharedFile, sharedMem);
bool success = CreateProcessW(0, (WCHAR*)cmdLine.utf16(),
0, 0, TRUE, CREATE_UNICODE_ENVIRONMENT,
environment().isEmpty() ? 0
: createWinEnvironment(fixWinEnvironment(environment())).data(),
workingDirectory().isEmpty() ? 0
: (WCHAR*)QDir::convertSeparators(workingDirectory()).utf16(),
&si, m_pid);
if (!success) { const QString cmdLine = createWinCommandline(m_program, m_args);
emit processError(tr("The process could not be started!")); started = CreateProcessW(0, (WCHAR*)cmdLine.utf16(),
delete m_pid; 0, 0, TRUE, CREATE_UNICODE_ENVIRONMENT,
m_pid = 0; environment().isEmpty() ? 0
return; : createWinEnvironment(fixWinEnvironment(environment())).data(),
} workingDirectory().isEmpty() ? 0
: (WCHAR*)QDir::convertSeparators(workingDirectory()).utf16(),
&si, m_pid);
if (!dbgInterface) { if (!started) {
emit receivedDebugOutput(tr("Cannot retrieve debugging output!")); emit processError(tr("The process could not be started!"));
WaitForSingleObject(m_pid->hProcess, INFINITE); break;
} else { }
LPSTR message;
LPDWORD processId;
HANDLE toWaitFor[2];
message = reinterpret_cast<LPSTR>(sharedMem) + sizeof(DWORD); if (!dbgInterface) {
processId = reinterpret_cast<LPDWORD>(sharedMem); emit receivedDebugOutput(tr("Cannot retrieve debugging output!"));
WaitForSingleObject(m_pid->hProcess, INFINITE);
} else {
LPSTR message;
LPDWORD processId;
HANDLE toWaitFor[2];
SetEvent(bufferReadyEvent); message = reinterpret_cast<LPSTR>(sharedMem) + sizeof(DWORD);
processId = reinterpret_cast<LPDWORD>(sharedMem);
toWaitFor[0] = dataReadyEvent; SetEvent(bufferReadyEvent);
toWaitFor[1] = m_pid->hProcess;
for (bool stop = false; !stop;) { toWaitFor[0] = dataReadyEvent;
DWORD ret = WaitForMultipleObjects(2, toWaitFor, FALSE, INFINITE); toWaitFor[1] = m_pid->hProcess;
switch (ret) { for (bool stop = false; !stop;) {
case WAIT_OBJECT_0 + 0: DWORD ret = WaitForMultipleObjects(2, toWaitFor, FALSE, INFINITE);
if (*processId == m_pid->dwProcessId)
emit receivedDebugOutput(QString::fromLocal8Bit(message)); switch (ret) {
SetEvent(bufferReadyEvent); case WAIT_OBJECT_0 + 0:
break; if (*processId == m_pid->dwProcessId)
case WAIT_OBJECT_0 + 1: emit receivedDebugOutput(QString::fromLocal8Bit(message));
stop = true; SetEvent(bufferReadyEvent);
break; break;
case WAIT_OBJECT_0 + 1:
stop = true;
break;
}
} }
} }
} while (false);
if (started) {
GetExitCodeProcess(m_pid->hProcess, &m_exitCode);
emit processFinished(static_cast<int>(m_exitCode));
} }
GetExitCodeProcess(m_pid->hProcess, &m_exitCode); if (sharedMem)
emit processFinished(static_cast<int>(m_exitCode)); UnmapViewOfFile(sharedMem);
if (sharedFile != NULL)
UnmapViewOfFile(sharedMem); CloseHandle(sharedFile);
CloseHandle(sharedFile); if (bufferReadyEvent != NULL)
CloseHandle(bufferReadyEvent); CloseHandle(bufferReadyEvent);
CloseHandle(dataReadyEvent); if (dataReadyEvent != NULL)
CloseHandle(m_pid->hProcess); CloseHandle(dataReadyEvent);
CloseHandle(m_pid->hThread); if (m_pid->hProcess != NULL)
CloseHandle(m_pid->hProcess);
if (m_pid->hThread != NULL)
CloseHandle(m_pid->hThread);
delete m_pid; delete m_pid;
m_pid = 0; m_pid = 0;
} }
@@ -42,6 +42,9 @@ using namespace Utils;
namespace ProjectExplorer { namespace ProjectExplorer {
namespace Internal { namespace Internal {
/* Captures the debug output of a Windows GUI application (which
* would otherwise not be visible) using the debug interface and
* emits via a signal. */
class WinGuiProcess : public QThread, public AbstractProcess class WinGuiProcess : public QThread, public AbstractProcess
{ {
Q_OBJECT Q_OBJECT
@@ -132,8 +132,10 @@ S60Manager::S60Manager(QObject *parent)
S60Manager::~S60Manager() S60Manager::~S60Manager()
{ {
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
for (int i = m_pluginObjects.size() - 1; i >= 0; i--) for (int i = m_pluginObjects.size() - 1; i >= 0; i--) {
pm->removeObject(m_pluginObjects.at(i)); pm->removeObject(m_pluginObjects.at(i));
delete m_pluginObjects.at(i);
}
} }
void S60Manager::addAutoReleasedObject(QObject *o) void S60Manager::addAutoReleasedObject(QObject *o)
+9 -11
View File
@@ -535,8 +535,6 @@ void Qt4Project::updateCodeModel()
if (debug) if (debug)
qDebug()<<"Qt4Project::updateCodeModel()"; qDebug()<<"Qt4Project::updateCodeModel()";
// TODO figure out the correct ordering of #include directories
CppTools::CppModelManagerInterface *modelmanager = CppTools::CppModelManagerInterface *modelmanager =
ExtensionSystem::PluginManager::instance() ExtensionSystem::PluginManager::instance()
->getObject<CppTools::CppModelManagerInterface>(); ->getObject<CppTools::CppModelManagerInterface>();
@@ -570,7 +568,7 @@ void Qt4Project::updateCodeModel()
const QHash<QString, QString> versionInfo = qtVersion(activeBuildConfiguration())->versionInfo(); const QHash<QString, QString> versionInfo = qtVersion(activeBuildConfiguration())->versionInfo();
const QString newQtIncludePath = versionInfo.value(QLatin1String("QT_INSTALL_HEADERS")); const QString newQtIncludePath = versionInfo.value(QLatin1String("QT_INSTALL_HEADERS"));
predefinedIncludePaths.prepend(newQtIncludePath); predefinedIncludePaths.append(newQtIncludePath);
QDir dir(newQtIncludePath); QDir dir(newQtIncludePath);
foreach (QFileInfo info, dir.entryInfoList(QDir::Dirs)) { foreach (QFileInfo info, dir.entryInfoList(QDir::Dirs)) {
const QString path = info.fileName(); const QString path = info.fileName();
@@ -578,7 +576,7 @@ void Qt4Project::updateCodeModel()
if (path == QLatin1String("Qt")) if (path == QLatin1String("Qt"))
continue; // skip $QT_INSTALL_HEADERS/Qt. There's no need to include it. continue; // skip $QT_INSTALL_HEADERS/Qt. There's no need to include it.
else if (path.startsWith(QLatin1String("Qt")) || path == QLatin1String("phonon")) else if (path.startsWith(QLatin1String("Qt")) || path == QLatin1String("phonon"))
predefinedIncludePaths.prepend(info.absoluteFilePath()); predefinedIncludePaths.append(info.absoluteFilePath());
} }
FindQt4ProFiles findQt4ProFiles; FindQt4ProFiles findQt4ProFiles;
@@ -589,13 +587,13 @@ void Qt4Project::updateCodeModel()
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
const QString newQtLibsPath = versionInfo.value(QLatin1String("QT_INSTALL_LIBS")); const QString newQtLibsPath = versionInfo.value(QLatin1String("QT_INSTALL_LIBS"));
allFrameworkPaths.prepend(newQtLibsPath); allFrameworkPaths.append(newQtLibsPath);
// put QtXXX.framework/Headers directories in include path since that qmake's behavior // put QtXXX.framework/Headers directories in include path since that qmake's behavior
QDir frameworkDir(newQtLibsPath); QDir frameworkDir(newQtLibsPath);
foreach (QFileInfo info, frameworkDir.entryInfoList(QDir::Dirs)) { foreach (QFileInfo info, frameworkDir.entryInfoList(QDir::Dirs)) {
if (! info.fileName().startsWith(QLatin1String("Qt"))) if (! info.fileName().startsWith(QLatin1String("Qt")))
continue; continue;
allIncludePaths.prepend(info.absoluteFilePath()+"/Headers"); allIncludePaths.append(info.absoluteFilePath()+"/Headers");
} }
#endif #endif
@@ -632,9 +630,9 @@ void Qt4Project::updateCodeModel()
const QStringList proIncludePaths = pro->variableValue(IncludePathVar); const QStringList proIncludePaths = pro->variableValue(IncludePathVar);
foreach (const QString &includePath, proIncludePaths) { foreach (const QString &includePath, proIncludePaths) {
if (!allIncludePaths.contains(includePath)) if (!allIncludePaths.contains(includePath))
allIncludePaths.prepend(includePath); allIncludePaths.append(includePath);
if (!info.includes.contains(includePath)) if (!info.includes.contains(includePath))
info.includes.prepend(includePath); info.includes.append(includePath);
} }
{ // Pkg Config support { // Pkg Config support
@@ -646,13 +644,13 @@ void Qt4Project::updateCodeModel()
process.waitForFinished(); process.waitForFinished();
QString result = process.readAllStandardOutput(); QString result = process.readAllStandardOutput();
foreach(const QString &part, result.trimmed().split(' ', QString::SkipEmptyParts)) { foreach(const QString &part, result.trimmed().split(' ', QString::SkipEmptyParts)) {
info.includes.prepend(part.mid(2)); // Chop off "-I" info.includes.append(part.mid(2)); // Chop off "-I"
} }
} }
} }
// Add mkspec directory // Add mkspec directory
info.includes.prepend(qtVersion(activeBuildConfiguration())->mkspecPath()); info.includes.append(qtVersion(activeBuildConfiguration())->mkspecPath());
info.frameworkPaths = allFrameworkPaths; info.frameworkPaths = allFrameworkPaths;
@@ -666,7 +664,7 @@ void Qt4Project::updateCodeModel()
} }
// Add mkspec directory // Add mkspec directory
allIncludePaths.prepend(qtVersion(activeBuildConfiguration())->mkspecPath()); allIncludePaths.append(qtVersion(activeBuildConfiguration())->mkspecPath());
// Dump things out // Dump things out
// This is debugging output... // This is debugging output...
@@ -395,8 +395,7 @@ void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newD
} }
qDeleteAll(m_versions); qDeleteAll(m_versions);
m_versions.clear(); m_versions.clear();
foreach(QtVersion *version, newVersions) m_versions = newVersions;
m_versions.append(new QtVersion(*version));
if (versionPathsChanged) if (versionPathsChanged)
updateDocumentation(); updateDocumentation();
updateUniqueIdToIndexMap(); updateUniqueIdToIndexMap();
@@ -416,8 +415,6 @@ void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newD
writeVersionsIntoSettings(); writeVersionsIntoSettings();
} }
/// ///
/// QtVersion /// QtVersion
/// ///
+1
View File
@@ -121,6 +121,7 @@ void BaseFileFind::displayResult(int index) {
void BaseFileFind::searchFinished() void BaseFileFind::searchFinished()
{ {
m_resultWindow->finishSearch();
m_isSearching = false; m_isSearching = false;
m_resultLabel = 0; m_resultLabel = 0;
emit changed(); emit changed();
+3 -2
View File
@@ -1990,8 +1990,9 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
if (d->m_visibleWrapColumn > 0) { if (d->m_visibleWrapColumn > 0) {
lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4; lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4;
painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()), if (lineX < viewportRect.width())
d->m_ifdefedOutFormat.background()); painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()),
d->m_ifdefedOutFormat.background());
} }
// // keep right margin clean from full-width selection // // keep right margin clean from full-width selection
+3 -3
View File
@@ -603,7 +603,7 @@ void Lexer::scan_helper(Token *tok)
do { do {
yyinp(); yyinp();
if (! (isalnum(_yychar) || _yychar == '_')) if (! (isalnum(_yychar) || _yychar == '_' || _yychar == '$'))
break; break;
} while (_yychar); } while (_yychar);
@@ -674,9 +674,9 @@ void Lexer::scan_helper(Token *tok)
if (control()) if (control())
tok->string = control()->findOrInsertStringLiteral(yytext, yylen); tok->string = control()->findOrInsertStringLiteral(yytext, yylen);
} else if (std::isalpha(ch) || ch == '_') { } else if (std::isalpha(ch) || ch == '_' || ch == '$') {
const char *yytext = _currentChar - 1; const char *yytext = _currentChar - 1;
while (std::isalnum(_yychar) || _yychar == '_') while (std::isalnum(_yychar) || _yychar == '_' || _yychar == '$')
yyinp(); yyinp();
int yylen = _currentChar - yytext; int yylen = _currentChar - yytext;
if (f._scanKeywords) if (f._scanKeywords)
+8
View File
@@ -1200,6 +1200,14 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, bool stopAtCppInitializer)
break; break;
} }
if (LA() == T___ASM__ && LA(2) == T_LPAREN) { // ### store the asm specifier in the AST
consumeToken(); // skip __asm__
consumeToken(); // skip T_LPAREN
if (skipUntil(T_RPAREN))
consumeToken(); // skip T_RPAREN
}
SpecifierAST **spec_ptr = &node->post_attributes; SpecifierAST **spec_ptr = &node->post_attributes;
while (LA() == T___ATTRIBUTE__) { while (LA() == T___ATTRIBUTE__) {
parseAttributeSpecifier(*spec_ptr); parseAttributeSpecifier(*spec_ptr);
+6 -6
View File
@@ -230,14 +230,14 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *,
return false; return false;
} }
HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *parent) HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *central, QWidget *parent)
: QWebView(parent) : QWebView(parent)
, helpEngine(engine) , helpEngine(engine)
, parentWidget(parent) , parentWidget(central)
, multiTabsAllowed(true) , multiTabsAllowed(true)
, loadFinished(false) , loadFinished(false)
{ {
setPage(new HelpPage(parent, helpEngine, this)); setPage(new HelpPage(central, helpEngine, this));
settings()->setAttribute(QWebSettings::PluginsEnabled, false); settings()->setAttribute(QWebSettings::PluginsEnabled, false);
settings()->setAttribute(QWebSettings::JavaEnabled, false); settings()->setAttribute(QWebSettings::JavaEnabled, false);
@@ -245,7 +245,7 @@ HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *paren
QAction* action = pageAction(QWebPage::OpenLinkInNewWindow); QAction* action = pageAction(QWebPage::OpenLinkInNewWindow);
action->setText(tr("Open Link in New Tab")); action->setText(tr("Open Link in New Tab"));
if (!parent) { if (!central) {
multiTabsAllowed = false; multiTabsAllowed = false;
action->setVisible(false); action->setVisible(false);
} }
@@ -378,13 +378,13 @@ void HelpViewer::setLoadFinished(bool ok)
#else // !defined(QT_NO_WEBKIT) #else // !defined(QT_NO_WEBKIT)
HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *parent) HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *central, QWidget *parent)
: QTextBrowser(parent) : QTextBrowser(parent)
, zoomCount(0) , zoomCount(0)
, controlPressed(false) , controlPressed(false)
, lastAnchor(QString()) , lastAnchor(QString())
, helpEngine(engine) , helpEngine(engine)
, parentWidget(parent) , parentWidget(central)
{ {
document()->setDocumentMargin(8); document()->setDocumentMargin(8);
} }
+2 -2
View File
@@ -64,7 +64,7 @@ class HelpViewer : public QWebView
Q_OBJECT Q_OBJECT
public: public:
HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *parent); HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *central, QWidget *parent);
void setSource(const QUrl &url); void setSource(const QUrl &url);
inline QUrl source() const inline QUrl source() const
@@ -130,7 +130,7 @@ class HelpViewer : public QTextBrowser
Q_OBJECT Q_OBJECT
public: public:
HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *parent); HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *central, QWidget *parent);
void setSource(const QUrl &url); void setSource(const QUrl &url);
void zoomIn(int range = 1); void zoomIn(int range = 1);
+261 -159
View File
@@ -170,6 +170,8 @@ private slots:
void dump_misc(); void dump_misc();
void dump_std_list(); void dump_std_list();
void dump_std_vector(); void dump_std_vector();
void dump_std_string();
void dump_std_wstring();
void dump_Foo(); void dump_Foo();
void dump_QByteArray(); void dump_QByteArray();
void dump_QChar(); void dump_QChar();
@@ -182,6 +184,7 @@ private slots:
void dump_QList_QString(); void dump_QList_QString();
void dump_QList_QString3(); void dump_QList_QString3();
void dump_QList_Int3(); void dump_QList_Int3();
void dump_QMap_QString_QString();
void dump_QPoint(); void dump_QPoint();
void dump_QRect(); void dump_QRect();
void dump_QSharedPointer(); void dump_QSharedPointer();
@@ -748,9 +751,9 @@ void tst_Gdb::dump_Foo()
{ {
prepare("dump_Foo"); prepare("dump_Foo");
next(); next();
run("B","{iname='local.f',addr='-',name='f',type='Foo'," run("B","{iname='local.f',name='f',type='Foo',"
"value='-',numchild='5'}", "", 0); "value='-',numchild='5'}", "", 0);
run("B","{iname='local.f',addr='-',name='f',type='Foo'," run("B","{iname='local.f',name='f',type='Foo',"
"value='-',numchild='5',children=[" "value='-',numchild='5',children=["
"{iname='local.f.a',name='a',type='int',value='0',numchild='0'}," "{iname='local.f.a',name='a',type='int',value='0',numchild='0'},"
"{iname='local.f.b',name='b',type='int',value='2',numchild='0'}," "{iname='local.f.b',name='b',type='int',value='2',numchild='0'},"
@@ -782,9 +785,9 @@ void tst_Gdb::dump_array()
prepare("dump_array_char"); prepare("dump_array_char");
next(); next();
// FIXME: numchild should be '4', not '1' // FIXME: numchild should be '4', not '1'
run("B","{iname='local.s',addr='-',name='s',type='char [4]'," run("B","{iname='local.s',name='s',type='char [4]',"
"value='-',numchild='1'}", ""); "value='-',numchild='1'}", "");
run("B","{iname='local.s',addr='-',name='s',type='char [4]'," run("B","{iname='local.s',name='s',type='char [4]',"
"value='-',numchild='1',childtype='char',childnumchild='0'," "value='-',numchild='1',childtype='char',childnumchild='0',"
"children=[{value='88 'X''},{value='89 'Y''},{value='90 'Z''}," "children=[{value='88 'X''},{value='89 'Y''},{value='90 'Z''},"
"{value='0 '\\\\000''}]}", "{value='0 '\\\\000''}]}",
@@ -793,9 +796,9 @@ void tst_Gdb::dump_array()
prepare("dump_array_int"); prepare("dump_array_int");
next(); next();
// FIXME: numchild should be '3', not '1' // FIXME: numchild should be '3', not '1'
run("B","{iname='local.s',addr='-',name='s',type='int [3]'," run("B","{iname='local.s',name='s',type='int [3]',"
"value='-',numchild='1'}", ""); "value='-',numchild='1'}", "");
run("B","{iname='local.s',addr='-',name='s',type='int [3]'," run("B","{iname='local.s',name='s',type='int [3]',"
"value='-',numchild='1',childtype='int',childnumchild='0'," "value='-',numchild='1',childtype='int',childnumchild='0',"
"children=[{value='1'},{value='2'},{value='3'}]}", "children=[{value='1'},{value='2'},{value='3'}]}",
"local.s"); "local.s");
@@ -815,9 +818,9 @@ void tst_Gdb::dump_misc()
{ {
prepare("dump_misc"); prepare("dump_misc");
next(); next();
run("B","{iname='local.s',addr='-',name='s',type='int *'," run("B","{iname='local.s',name='s',type='int *',"
"value='-',numchild='1'}", "", 0); "value='-',numchild='1'}", "", 0);
run("B","{iname='local.s',addr='-',name='s',type='int *'," run("B","{iname='local.s',name='s',type='int *',"
"value='-',numchild='1',children=[{iname='local.s.*'," "value='-',numchild='1',children=[{iname='local.s.*',"
"name='*s',type='int',value='1',numchild='0'}]}", "local.s", 0); "name='*s',type='int',value='1',numchild='0'}]}", "local.s", 0);
} }
@@ -1010,9 +1013,9 @@ void tst_Gdb::dump_QAbstractItemAndModelIndex()
void tst_Gdb::dump_QAbstractItemModelHelper(QAbstractItemModel &m) void tst_Gdb::dump_QAbstractItemModelHelper(QAbstractItemModel &m)
{ {
QByteArray address = ptrToBa(&m); QByteArray address = ptrToBa(&m);
QByteArray expected = QByteArray("tiname='iname',addr='%'," QByteArray expected = QByteArray("tiname='iname',"
"type='"NS"QAbstractItemModel',value='(%,%)',numchild='1',children=[" "type='"NS"QAbstractItemModel',value='(%,%)',numchild='1',children=["
"{numchild='1',name='"NS"QObject',addr='%',value='%'," "{numchild='1',name='"NS"QObject',value='%',"
"valueencoded='2',type='"NS"QObject',displayedtype='%'}") "valueencoded='2',type='"NS"QObject',displayedtype='%'}")
<< address << address
<< N(m.rowCount()) << N(m.rowCount())
@@ -1025,7 +1028,7 @@ void tst_Gdb::dump_QAbstractItemModelHelper(QAbstractItemModel &m)
for (int column = 0; column < m.columnCount(); ++column) { for (int column = 0; column < m.columnCount(); ++column) {
QModelIndex mi = m.index(row, column); QModelIndex mi = m.index(row, column);
expected.append(QByteArray(",{name='[%,%]',value='%'," expected.append(QByteArray(",{name='[%,%]',value='%',"
"valueencoded='2',numchild='1',addr='$%,%,%,%'," "valueencoded='2',numchild='1',%,%,%',"
"type='"NS"QAbstractItem'}") "type='"NS"QAbstractItem'}")
<< N(row) << N(row)
<< N(column) << N(column)
@@ -1089,27 +1092,27 @@ void tst_Gdb::dump_QByteArray()
{ {
prepare("dump_QByteArray"); prepare("dump_QByteArray");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.ba',addr='-',name='ba',type='"NS"QByteArray'," run("A","{iname='local.ba',name='ba',type='"NS"QByteArray',"
"value='<not in scope>',numchild='0'}"); "value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.ba',addr='-',name='ba',type='"NS"QByteArray'," run("B","{iname='local.ba',name='ba',type='"NS"QByteArray',"
"valueencoded='6',value='',numchild='0'}"); "valueencoded='6',value='',numchild='0'}");
next(); next();
run("C","{iname='local.ba',addr='-',name='ba',type='"NS"QByteArray'," run("C","{iname='local.ba',name='ba',type='"NS"QByteArray',"
"valueencoded='6',value='61',numchild='1'}"); "valueencoded='6',value='61',numchild='1'}");
next(); next();
run("D","{iname='local.ba',addr='-',name='ba',type='"NS"QByteArray'," run("D","{iname='local.ba',name='ba',type='"NS"QByteArray',"
"valueencoded='6',value='6162',numchild='2'}"); "valueencoded='6',value='6162',numchild='2'}");
next(); next();
run("E","{iname='local.ba',addr='-',name='ba',type='"NS"QByteArray'," run("E","{iname='local.ba',name='ba',type='"NS"QByteArray',"
"valueencoded='6',value='616161616161616161616161616161616161" "valueencoded='6',value='616161616161616161616161616161616161"
"616161616161616161616161616161616161616161616161616161616161" "616161616161616161616161616161616161616161616161616161616161"
"616161616161616161616161616161616161616161616161616161616161" "616161616161616161616161616161616161616161616161616161616161"
"6161616161616161616161616161616161616161616161',numchild='101'}"); "6161616161616161616161616161616161616161616161',numchild='101'}");
next(); next();
run("F","{iname='local.ba',addr='-',name='ba',type='"NS"QByteArray'," run("F","{iname='local.ba',name='ba',type='"NS"QByteArray',"
"valueencoded='6',value='616263070a0d1b27223f',numchild='10'}"); "valueencoded='6',value='616263070a0d1b27223f',numchild='10'}");
run("F","{iname='local.ba',addr='-',name='ba',type='"NS"QByteArray'," run("F","{iname='local.ba',name='ba',type='"NS"QByteArray',"
"valueencoded='6',value='616263070a0d1b27223f',numchild='10'," "valueencoded='6',value='616263070a0d1b27223f',numchild='10',"
"childtype='char',childnumchild='0'," "childtype='char',childnumchild='0',"
"children=[{value='97 'a''},{value='98 'b''}," "children=[{value='97 'a''},{value='98 'b''},"
@@ -1135,27 +1138,27 @@ void tst_Gdb::dump_QChar()
next(); next();
// Case 1: Printable ASCII character. // Case 1: Printable ASCII character.
run("B","{iname='local.c',addr='-',name='c',type='"NS"QChar'," run("B","{iname='local.c',name='c',type='"NS"QChar',"
"value=''X', ucs=88',numchild='0'}"); "value=''X', ucs=88',numchild='0'}");
next(); next();
// Case 2: Printable non-ASCII character. // Case 2: Printable non-ASCII character.
run("C","{iname='local.c',addr='-',name='c',type='"NS"QChar'," run("C","{iname='local.c',name='c',type='"NS"QChar',"
"value=''?', ucs=1536',numchild='0'}"); "value=''?', ucs=1536',numchild='0'}");
next(); next();
// Case 3: Non-printable ASCII character. // Case 3: Non-printable ASCII character.
run("D","{iname='local.c',addr='-',name='c',type='"NS"QChar'," run("D","{iname='local.c',name='c',type='"NS"QChar',"
"value=''?', ucs=7',numchild='0'}"); "value=''?', ucs=7',numchild='0'}");
next(); next();
// Case 4: Non-printable non-ASCII character. // Case 4: Non-printable non-ASCII character.
run("E","{iname='local.c',addr='-',name='c',type='"NS"QChar'," run("E","{iname='local.c',name='c',type='"NS"QChar',"
"value=''?', ucs=159',numchild='0'}"); "value=''?', ucs=159',numchild='0'}");
next(); next();
// Case 5: Printable ASCII Character that looks like the replacement character. // Case 5: Printable ASCII Character that looks like the replacement character.
run("F","{iname='local.c',addr='-',name='c',type='"NS"QChar'," run("F","{iname='local.c',name='c',type='"NS"QChar',"
"value=''?', ucs=63',numchild='0'}"); "value=''?', ucs=63',numchild='0'}");
} }
@@ -2242,28 +2245,28 @@ void tst_Gdb::dump_std_list()
{ {
prepare("dump_std_list"); prepare("dump_std_list");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"numchild='0'}"); "numchild='0'}");
next(); next();
run("B", "{iname='local.list',addr='-',name='list'," run("B", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >'," "type='std::list<int, std::allocator<int> >',"
"value='<0 items>',numchild='0',children=[]}", "value='<0 items>',numchild='0',children=[]}",
"local.list"); "local.list");
next(); next();
run("C", "{iname='local.list',addr='-',name='list'," run("C", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >'," "type='std::list<int, std::allocator<int> >',"
"value='<1 items>',numchild='1'," "value='<1 items>',numchild='1',"
"childtype='int',childnumchild='0',children=[{value='45'}]}", "childtype='int',childnumchild='0',children=[{value='45'}]}",
"local.list"); "local.list");
next(); next();
run("D", "{iname='local.list',addr='-',name='list'," run("D", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >'," "type='std::list<int, std::allocator<int> >',"
"value='<2 items>',numchild='2'," "value='<2 items>',numchild='2',"
"childtype='int',childnumchild='0',children=[" "childtype='int',childnumchild='0',children=["
"{value='45'},{value='46'}]}", "{value='45'},{value='46'}]}",
"local.list"); "local.list");
next(); next();
run("E", "{iname='local.list',addr='-',name='list'," run("E", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >'," "type='std::list<int, std::allocator<int> >',"
"value='<3 items>',numchild='3'," "value='<3 items>',numchild='3',"
"childtype='int',childnumchild='0',children=[" "childtype='int',childnumchild='0',children=["
@@ -2272,6 +2275,58 @@ void tst_Gdb::dump_std_list()
} }
///////////////////////////// std::string //////////////////////////////////
void dump_std_string()
{
/* A */ std::string str;
/* B */ str = "Hallo";
/* C */ (void) 0;
}
void tst_Gdb::dump_std_string()
{
prepare("dump_std_string");
if (checkUninitialized)
run("A","{iname='local.str',name='str',"
"numchild='0'}");
next();
run("B","{iname='local.str',name='str',type='std::string',"
"valueencoded='6',value='',numchild='0'}");
next();
run("C","{iname='local.str',name='str',type='std::string',"
"valueencoded='6',value='48616c6c6f',numchild='0'}");
}
///////////////////////////// std::wstring //////////////////////////////////
void dump_std_wstring()
{
/* A */ std::wstring str;
/* B */ str = L"Hallo";
/* C */ (void) 0;
}
void tst_Gdb::dump_std_wstring()
{
prepare("dump_std_wstring");
if (checkUninitialized)
run("A","{iname='local.str',name='str',"
"numchild='0'}");
next();
run("B","{iname='local.str',name='str',type='std::string',valueencoded='6',"
"value='',numchild='0'}");
next();
if (sizeof(wchar_t) == 2)
run("C","{iname='local.str',name='str',type='std::string',valueencoded='6',"
"value='00480061006c006c006f',numchild='0'}");
else
run("C","{iname='local.str',name='str',type='std::string',valueencoded='6',"
"value='00000048000000610000006c0000006c0000006f',numchild='0'}");
}
///////////////////////////// std::vector<int> ////////////////////////////// ///////////////////////////// std::vector<int> //////////////////////////////
void dump_std_vector() void dump_std_vector()
@@ -2291,19 +2346,19 @@ void tst_Gdb::dump_std_vector()
prepare("dump_std_vector"); prepare("dump_std_vector");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.vector',addr='-',name='vector'," run("A","{iname='local.vector',name='vector',"
"numchild='0'}"); "numchild='0'}");
next(2); next(2);
run("B","{iname='local.vector',addr='-',name='vector',type='"VECTOR"'," run("B","{iname='local.vector',name='vector',type='"VECTOR"',"
"value='<0 items>',numchild='0'}," "value='<0 items>',numchild='0'},"
"{iname='local.list',addr='-',name='list',type='"LIST"'," "{iname='local.list',name='list',type='"LIST"',"
"value='<0 items>',numchild='0'}"); "value='<0 items>',numchild='0'}");
next(3); next(3);
run("E","{iname='local.vector',addr='-',name='vector',type='"VECTOR"'," run("E","{iname='local.vector',name='vector',type='"VECTOR"',"
"value='<2 items>',numchild='2',childtype='"LIST" *'," "value='<2 items>',numchild='2',childtype='"LIST" *',"
"childnumchild='1',children=[{type='"LIST"',value='<2 items>'," "childnumchild='1',children=[{type='"LIST"',value='<2 items>',"
"numchild='2'},{value='<null>',numchild='0'}]}," "numchild='2'},{value='<null>',numchild='0'}]},"
"{iname='local.list',addr='-',name='list',type='"LIST"'," "{iname='local.list',name='list',type='"LIST"',"
"value='<0 items>',numchild='0'}", "value='<0 items>',numchild='0'}",
"local.vector,local.vector.0"); "local.vector,local.vector.0");
} }
@@ -2354,13 +2409,13 @@ void tst_Gdb::dump_QHash_int_int()
prepare("dump_QHash_int_int"); prepare("dump_QHash_int_int");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.h',addr='-',name='h'," run("A","{iname='local.h',name='h',"
"type='"NS"QHash<int, int>',value='<not in scope>'," "type='"NS"QHash<int, int>',value='<not in scope>',"
"numchild='0'}"); "numchild='0'}");
next(); next();
next(); next();
next(); next();
run("D","{iname='local.h',addr='-',name='h'," run("D","{iname='local.h',name='h',"
"type='"NS"QHash<int, int>',value='<2 items>',numchild='2'," "type='"NS"QHash<int, int>',value='<2 items>',numchild='2',"
"childtype='int',childnumchild='0',children=[" "childtype='int',childnumchild='0',children=["
"{name='43',value='44'}," "{name='43',value='44'},"
@@ -2382,30 +2437,30 @@ void tst_Gdb::dump_QHash_QString_QString()
{ {
prepare("dump_QHash_QString_QString"); prepare("dump_QHash_QString_QString");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.h',addr='-',name='h'," run("A","{iname='local.h',name='h',"
"type='"NS"QHash<"NS"QString, "NS"QString>',value='<not in scope>'," "type='"NS"QHash<"NS"QString, "NS"QString>',value='<not in scope>',"
"numchild='0'}"); "numchild='0'}");
next(); next();
//run("B","{iname='local.h',addr='-',name='h'," run("B","{iname='local.h',name='h',"
// "type='"NS"QHash<"NS"QString, "NS"QString>',value='<0 items>'," "type='"NS"QHash<"NS"QString, "NS"QString>',value='<0 items>',"
// "numchild='0'}"); "numchild='0'}");
next(); next();
next(); next();
//run("D","{iname='local.h',addr='-',name='h'," run("D","{iname='local.h',name='h',"
// "type='"NS"QHash<"NS"QString, "NS"QString>',value='<2 items>'," "type='"NS"QHash<"NS"QString, "NS"QString>',value='<2 items>',"
// "numchild='2'}"); "numchild='2'}");
run("D","{iname='local.h',addr='-',name='h'," run("D","{iname='local.h',name='h',"
"type='"NS"QHash<"NS"QString, "NS"QString>',value='<2 items>'," "type='"NS"QHash<"NS"QString, "NS"QString>',value='<2 items>',"
"numchild='2',childtype='"NS"QHashNode<"NS"QString, "NS"QString>'," "numchild='2',childtype='"NS"QHashNode<"NS"QString, "NS"QString>',"
"children=[" "children=["
"{value=' ',numchild='2',children=[{name='key',valueencoded='7'," "{value=' ',numchild='2',children=[{name='key',type='"NS"QString',"
"value='66006f006f00',numchild='0'}," "valueencoded='7',value='66006f006f00',numchild='0'},"
"{name='value',valueencoded='7'," "{name='value',type='"NS"QString',"
"value='620061007200',numchild='0'}]}," "valueencoded='7',value='620061007200',numchild='0'}]},"
"{value=' ',numchild='2',children=[{name='key',valueencoded='7'," "{value=' ',numchild='2',children=[{name='key',type='"NS"QString',"
"value='680065006c006c006f00',numchild='0'}," "valueencoded='7',value='680065006c006c006f00',numchild='0'},"
"{name='value',valueencoded='7'," "{name='value',type='"NS"QString',valueencoded='7',"
"value='77006f0072006c006400',numchild='0'}]}" "value='77006f0072006c006400',numchild='0'}]}"
"]}", "]}",
"local.h,local.h.0,local.h.1"); "local.h,local.h.0,local.h.1");
} }
@@ -2425,22 +2480,22 @@ void tst_Gdb::dump_QList_int()
{ {
prepare("dump_QList_int"); prepare("dump_QList_int");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<not in scope>',numchild='0'}"); "type='"NS"QList<int>',value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.list',addr='-',name='list'," run("B","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<0 items>',numchild='0'}"); "type='"NS"QList<int>',value='<0 items>',numchild='0'}");
next(); next();
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<1 items>',numchild='1'}"); "type='"NS"QList<int>',value='<1 items>',numchild='1'}");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<1 items>',numchild='1'," "type='"NS"QList<int>',value='<1 items>',numchild='1',"
"childtype='int',childnumchild='0',children=[" "childtype='int',childnumchild='0',children=["
"{value='1'}]}", "local.list"); "{value='1'}]}", "local.list");
next(); next();
run("D","{iname='local.list',addr='-',name='list'," run("D","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<2 items>',numchild='2'}"); "type='"NS"QList<int>',value='<2 items>',numchild='2'}");
run("D","{iname='local.list',addr='-',name='list'," run("D","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<2 items>',numchild='2'," "type='"NS"QList<int>',value='<2 items>',numchild='2',"
"childtype='int',childnumchild='0',children=[" "childtype='int',childnumchild='0',children=["
"{value='1'},{value='2'}]}", "local.list"); "{value='1'},{value='2'}]}", "local.list");
@@ -2462,13 +2517,13 @@ void tst_Gdb::dump_QList_int_star()
{ {
prepare("dump_QList_int_star"); prepare("dump_QList_int_star");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"type='"NS"QList<int*>',value='<not in scope>',numchild='0'}"); "type='"NS"QList<int*>',value='<not in scope>',numchild='0'}");
next(); next();
next(); next();
next(); next();
next(); next();
run("E","{iname='local.list',addr='-',name='list'," run("E","{iname='local.list',name='list',"
"type='"NS"QList<int*>',value='<3 items>',numchild='3'," "type='"NS"QList<int*>',value='<3 items>',numchild='3',"
"childtype='int',childnumchild='0',children=[" "childtype='int',childnumchild='0',children=["
"{value='1'},{value='<null>',type='int *'},{value='2'}]}", "local.list"); "{value='1'},{value='<null>',type='int *'},{value='2'}]}", "local.list");
@@ -2488,15 +2543,15 @@ void tst_Gdb::dump_QList_char()
{ {
prepare("dump_QList_char"); prepare("dump_QList_char");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"type='"NS"QList<char>',value='<not in scope>',numchild='0'}"); "type='"NS"QList<char>',value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.list',addr='-',name='list'," run("B","{iname='local.list',name='list',"
"type='"NS"QList<char>',value='<0 items>',numchild='0'}"); "type='"NS"QList<char>',value='<0 items>',numchild='0'}");
next(); next();
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<char>',value='<1 items>',numchild='1'}"); "type='"NS"QList<char>',value='<1 items>',numchild='1'}");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<char>',value='<1 items>',numchild='1'," "type='"NS"QList<char>',value='<1 items>',numchild='1',"
"childtype='char',childnumchild='0',children=[" "childtype='char',childnumchild='0',children=["
"{value='97 'a''}]}", "local.list"); "{value='97 'a''}]}", "local.list");
@@ -2518,21 +2573,21 @@ void tst_Gdb::dump_QList_char_star()
{ {
prepare("dump_QList_char_star"); prepare("dump_QList_char_star");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"type='"NS"QList<char const*>',value='<not in scope>',numchild='0'}"); "type='"NS"QList<char const*>',value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.list',addr='-',name='list'," run("B","{iname='local.list',name='list',"
"type='"NS"QList<char const*>',value='<0 items>',numchild='0'}"); "type='"NS"QList<char const*>',value='<0 items>',numchild='0'}");
next(); next();
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<char const*>',value='<1 items>',numchild='1'}"); "type='"NS"QList<char const*>',value='<1 items>',numchild='1'}");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<char const*>',value='<1 items>',numchild='1'," "type='"NS"QList<char const*>',value='<1 items>',numchild='1',"
"childtype='const char *',childnumchild='1',children=[" "childtype='const char *',childnumchild='1',children=["
"{valueencoded='6',value='61',numchild='0'}]}", "local.list"); "{valueencoded='6',value='61',numchild='0'}]}", "local.list");
next(); next();
next(); next();
run("E","{iname='local.list',addr='-',name='list'," run("E","{iname='local.list',name='list',"
"type='"NS"QList<char const*>',value='<3 items>',numchild='3'," "type='"NS"QList<char const*>',value='<3 items>',numchild='3',"
"childtype='const char *',childnumchild='1',children=[" "childtype='const char *',childnumchild='1',children=["
"{valueencoded='6',value='61',numchild='0'}," "{valueencoded='6',value='61',numchild='0'},"
@@ -2554,15 +2609,15 @@ void tst_Gdb::dump_QList_QString()
{ {
prepare("dump_QList_QString"); prepare("dump_QList_QString");
if (0 && checkUninitialized) if (0 && checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"type='"NS"QList<"NS"QString>',value='<not in scope>',numchild='0'}"); "type='"NS"QList<"NS"QString>',value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.list',addr='-',name='list'," run("B","{iname='local.list',name='list',"
"type='"NS"QList<"NS"QString>',value='<0 items>',numchild='0'}"); "type='"NS"QList<"NS"QString>',value='<0 items>',numchild='0'}");
next(); next();
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<"NS"QString>',value='<1 items>',numchild='1'}"); "type='"NS"QList<"NS"QString>',value='<1 items>',numchild='1'}");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<"NS"QString>',value='<1 items>',numchild='1'," "type='"NS"QList<"NS"QString>',value='<1 items>',numchild='1',"
"childtype='"NS"QString',childnumchild='0',children=[" "childtype='"NS"QString',childnumchild='0',children=["
"{valueencoded='7',value='480061006c006c006f00'}]}", "local.list"); "{valueencoded='7',value='480061006c006c006f00'}]}", "local.list");
@@ -2582,19 +2637,19 @@ void tst_Gdb::dump_QList_QString3()
{ {
prepare("dump_QList_QString3"); prepare("dump_QList_QString3");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"type='"NS"QList<QString3>',value='<not in scope>',numchild='0'}"); "type='"NS"QList<QString3>',value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.list',addr='-',name='list'," run("B","{iname='local.list',name='list',"
"type='"NS"QList<QString3>',value='<0 items>',numchild='0'}"); "type='"NS"QList<QString3>',value='<0 items>',numchild='0'}");
next(); next();
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<QString3>',value='<1 items>',numchild='1'}"); "type='"NS"QList<QString3>',value='<1 items>',numchild='1'}");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<QString3>',value='<1 items>',numchild='1'," "type='"NS"QList<QString3>',value='<1 items>',numchild='1',"
"childtype='QString3',children=[" "childtype='QString3',children=["
"{value='{...}',numchild='3'}]}", "local.list"); "{value='{...}',numchild='3'}]}", "local.list");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<QString3>',value='<1 items>',numchild='1'," "type='"NS"QList<QString3>',value='<1 items>',numchild='1',"
"childtype='QString3',children=[{value='{...}',numchild='3',children=[" "childtype='QString3',children=[{value='{...}',numchild='3',children=["
"{iname='local.list.0.s1',name='s1',type='"NS"QString'," "{iname='local.list.0.s1',name='s1',type='"NS"QString',"
@@ -2620,19 +2675,19 @@ void tst_Gdb::dump_QList_Int3()
{ {
prepare("dump_QList_Int3"); prepare("dump_QList_Int3");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list'," run("A","{iname='local.list',name='list',"
"type='"NS"QList<Int3>',value='<not in scope>',numchild='0'}"); "type='"NS"QList<Int3>',value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.list',addr='-',name='list'," run("B","{iname='local.list',name='list',"
"type='"NS"QList<Int3>',value='<0 items>',numchild='0'}"); "type='"NS"QList<Int3>',value='<0 items>',numchild='0'}");
next(); next();
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<Int3>',value='<1 items>',numchild='1'}"); "type='"NS"QList<Int3>',value='<1 items>',numchild='1'}");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<Int3>',value='<1 items>',numchild='1'," "type='"NS"QList<Int3>',value='<1 items>',numchild='1',"
"childtype='Int3',children=[{value='{...}',numchild='3'}]}", "childtype='Int3',children=[{value='{...}',numchild='3'}]}",
"local.list"); "local.list");
run("C","{iname='local.list',addr='-',name='list'," run("C","{iname='local.list',name='list',"
"type='"NS"QList<Int3>',value='<1 items>',numchild='1'," "type='"NS"QList<Int3>',value='<1 items>',numchild='1',"
"childtype='Int3',children=[{value='{...}',numchild='3',children=[" "childtype='Int3',children=[{value='{...}',numchild='3',children=["
"{iname='local.list.0.i1',name='i1',type='int',value='42',numchild='0'}," "{iname='local.list.0.i1',name='i1',type='int',value='42',numchild='0'},"
@@ -2642,6 +2697,49 @@ void tst_Gdb::dump_QList_Int3()
} }
///////////////////////////// QMap<QString, QString> //////////////////////////////
void dump_QMap_QString_QString()
{
/* A */ QMap<QString, QString> h;
/* B */ h["hello"] = "world";
/* C */ h["foo"] = "bar";
/* D */ (void) 0;
}
void tst_Gdb::dump_QMap_QString_QString()
{
prepare("dump_QMap_QString_QString");
if (checkUninitialized)
run("A","{iname='local.h',name='h',"
"type='"NS"QMap<"NS"QString, "NS"QString>',value='<not in scope>',"
"numchild='0'}");
next();
run("B","{iname='local.h',name='h',"
"type='"NS"QMap<"NS"QString, "NS"QString>',value='<0 items>',"
"numchild='0'}");
next();
next();
run("D","{iname='local.h',name='h',"
"type='"NS"QMap<"NS"QString, "NS"QString>',value='<2 items>',"
"numchild='2'}");
run("D","{iname='local.h',name='h',"
"type='"NS"QMap<"NS"QString, "NS"QString>',value='<2 items>',"
"numchild='2',childtype='"NS"QMapNode<"NS"QString, "NS"QString>',"
"children=["
"{value=' ',numchild='2',children=[{name='key',type='"NS"QString',"
"valueencoded='7',value='66006f006f00',numchild='0'},"
"{name='value',type='"NS"QString',"
"valueencoded='7',value='620061007200',numchild='0'}]},"
"{value=' ',numchild='2',children=[{name='key',type='"NS"QString',"
"valueencoded='7',value='680065006c006c006f00',numchild='0'},"
"{name='value',type='"NS"QString',valueencoded='7',"
"value='77006f0072006c006400',numchild='0'}]}"
"]}",
"local.h,local.h.0,local.h.1");
}
///////////////////////////// QPoint ///////////////////////////////// ///////////////////////////// QPoint /////////////////////////////////
void dump_QPoint() void dump_QPoint()
@@ -2655,10 +2753,10 @@ void tst_Gdb::dump_QPoint()
prepare("dump_QPoint"); prepare("dump_QPoint");
next(); next();
next(); next();
run("C","{iname='local.p',addr='-',name='p',type='"NS"QPoint'," run("C","{iname='local.p',name='p',type='"NS"QPoint',"
"value='(43, 44)',numchild='2',childtype='int',childnumchild='0'," "value='(43, 44)',numchild='2',childtype='int',childnumchild='0',"
"children=[{name='x',value='43'},{name='y',value='44'}]}," "children=[{name='x',value='43'},{name='y',value='44'}]},"
"{iname='local.f',addr='-',name='f',type='"NS"QPointF'," "{iname='local.f',name='f',type='"NS"QPointF',"
"value='(45, 46)',numchild='2',childtype='double',childnumchild='0'," "value='(45, 46)',numchild='2',childtype='double',childnumchild='0',"
"children=[{name='x',value='45'},{name='y',value='46'}]}", "children=[{name='x',value='45'},{name='y',value='46'}]}",
"local.p,local.f"); "local.p,local.f");
@@ -2679,11 +2777,11 @@ void tst_Gdb::dump_QRect()
next(); next();
next(); next();
run("C","{iname='local.p',addr='-',name='p',type='"NS"QRect'," run("C","{iname='local.p',name='p',type='"NS"QRect',"
"value='100x200+43+44',numchild='4',childtype='int',childnumchild='0'," "value='100x200+43+44',numchild='4',childtype='int',childnumchild='0',"
"children=[{name='x1',value='43'},{name='y1',value='44'}," "children=[{name='x1',value='43'},{name='y1',value='44'},"
"{name='x2',value='142'},{name='y2',value='243'}]}," "{name='x2',value='142'},{name='y2',value='243'}]},"
"{iname='local.f',addr='-',name='f',type='"NS"QRectF'," "{iname='local.f',name='f',type='"NS"QRectF',"
"value='100x200+45+46',numchild='4',childtype='double',childnumchild='0'," "value='100x200+45+46',numchild='4',childtype='double',childnumchild='0',"
"children=[{name='x',value='45'},{name='y',value='46'}," "children=[{name='x',value='45'},{name='y',value='46'},"
"{name='w',value='100'},{name='h',value='200'}]}", "{name='w',value='100'},{name='h',value='200'}]}",
@@ -2724,65 +2822,65 @@ void tst_Gdb::dump_QSharedPointer()
#if QT_VERSION >= 0x040500 #if QT_VERSION >= 0x040500
prepare("dump_QSharedPointer"); prepare("dump_QSharedPointer");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.simplePtr',addr='-',name='simplePtr'," run("A","{iname='local.simplePtr',name='simplePtr',"
"'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}," "'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'},"
"{iname='local.simplePtr2',addr='-',name='simplePtr2'," "{iname='local.simplePtr2',name='simplePtr2',"
"'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}," "'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'},"
"{iname='local.simplePtr3',addr='-',name='simplePtr3'," "{iname='local.simplePtr3',name='simplePtr3',"
"'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}," "'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'},"
"{iname='local.simplePtr4',addr='-',name='simplePtr3'," "{iname='local.simplePtr4',name='simplePtr3',"
"'type='"NS"QWeakPointer<int>',value='<not in scope>',numchild='0'}," "'type='"NS"QWeakPointer<int>',value='<not in scope>',numchild='0'},"
"{iname='local.compositePtr',addr='-',name='compositePtr'," "{iname='local.compositePtr',name='compositePtr',"
"'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}," "'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'},"
"{iname='local.compositePtr2',addr='-',name='compositePtr2'," "{iname='local.compositePtr2',name='compositePtr2',"
"'type='"NS"QSharedPointer<int>'value='<not in scope>',numchild='0'}," "'type='"NS"QSharedPointer<int>'value='<not in scope>',numchild='0'},"
"{iname='local.compositePtr3',addr='-',name='compositePtr3'," "{iname='local.compositePtr3',name='compositePtr3',"
"'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}," "'type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'},"
"{iname='local.compositePtr4',addr='-',name='compositePtr4'," "{iname='local.compositePtr4',name='compositePtr4',"
"'type='"NS"QWeakPointer<int>',value='<not in scope>',numchild='0'}"); "'type='"NS"QWeakPointer<int>',value='<not in scope>',numchild='0'}");
next(8); next(8);
run("C","{iname='local.simplePtr',addr='-',name='simplePtr'," run("C","{iname='local.simplePtr',name='simplePtr',"
"type='"NS"QSharedPointer<int>',value='<null>',numchild='0'}," "type='"NS"QSharedPointer<int>',value='<null>',numchild='0'},"
"{iname='local.simplePtr2',addr='-',name='simplePtr2'," "{iname='local.simplePtr2',name='simplePtr2',"
"type='"NS"QSharedPointer<int>',value='',numchild='3'}," "type='"NS"QSharedPointer<int>',value='',numchild='3'},"
"{iname='local.simplePtr3',addr='-',name='simplePtr3'," "{iname='local.simplePtr3',name='simplePtr3',"
"type='"NS"QSharedPointer<int>',value='',numchild='3'}," "type='"NS"QSharedPointer<int>',value='',numchild='3'},"
"{iname='local.simplePtr4',addr='-',name='simplePtr4'," "{iname='local.simplePtr4',name='simplePtr4',"
"type='"NS"QWeakPointer<int>',value='',numchild='3'}," "type='"NS"QWeakPointer<int>',value='',numchild='3'},"
"{iname='local.compositePtr',addr='-',name='compositePtr'," "{iname='local.compositePtr',name='compositePtr',"
"type='"NS"QSharedPointer<"NS"QString>',value='<null>',numchild='0'}," "type='"NS"QSharedPointer<"NS"QString>',value='<null>',numchild='0'},"
"{iname='local.compositePtr2',addr='-',name='compositePtr2'," "{iname='local.compositePtr2',name='compositePtr2',"
"type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'}," "type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'},"
"{iname='local.compositePtr3',addr='-',name='compositePtr3'," "{iname='local.compositePtr3',name='compositePtr3',"
"type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'}," "type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'},"
"{iname='local.compositePtr4',addr='-',name='compositePtr4'," "{iname='local.compositePtr4',name='compositePtr4',"
"type='"NS"QWeakPointer<"NS"QString>',value='',numchild='3'}"); "type='"NS"QWeakPointer<"NS"QString>',value='',numchild='3'}");
run("C","{iname='local.simplePtr',addr='-',name='simplePtr'," run("C","{iname='local.simplePtr',name='simplePtr',"
"type='"NS"QSharedPointer<int>',value='<null>',numchild='0'}," "type='"NS"QSharedPointer<int>',value='<null>',numchild='0'},"
"{iname='local.simplePtr2',addr='-',name='simplePtr2'," "{iname='local.simplePtr2',name='simplePtr2',"
"type='"NS"QSharedPointer<int>',value='',numchild='3',children=[" "type='"NS"QSharedPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'}," "{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',type='int',numchild='0'}," "{name='weakref',value='3',type='int',numchild='0'},"
"{name='strongref',value='2',type='int',numchild='0'}]}," "{name='strongref',value='2',type='int',numchild='0'}]},"
"{iname='local.simplePtr3',addr='-',name='simplePtr3'," "{iname='local.simplePtr3',name='simplePtr3',"
"type='"NS"QSharedPointer<int>',value='',numchild='3',children=[" "type='"NS"QSharedPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'}," "{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',type='int',numchild='0'}," "{name='weakref',value='3',type='int',numchild='0'},"
"{name='strongref',value='2',type='int',numchild='0'}]}," "{name='strongref',value='2',type='int',numchild='0'}]},"
"{iname='local.simplePtr4',addr='-',name='simplePtr4'," "{iname='local.simplePtr4',name='simplePtr4',"
"type='"NS"QWeakPointer<int>',value='',numchild='3',children=[" "type='"NS"QWeakPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'}," "{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',type='int',numchild='0'}," "{name='weakref',value='3',type='int',numchild='0'},"
"{name='strongref',value='2',type='int',numchild='0'}]}," "{name='strongref',value='2',type='int',numchild='0'}]},"
"{iname='local.compositePtr',addr='-',name='compositePtr'," "{iname='local.compositePtr',name='compositePtr',"
"type='"NS"QSharedPointer<"NS"QString>',value='<null>',numchild='0'}," "type='"NS"QSharedPointer<"NS"QString>',value='<null>',numchild='0'},"
"{iname='local.compositePtr2',addr='-',name='compositePtr2'," "{iname='local.compositePtr2',name='compositePtr2',"
"type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'}," "type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'},"
"{iname='local.compositePtr3',addr='-',name='compositePtr3'," "{iname='local.compositePtr3',name='compositePtr3',"
"type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'}," "type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3'},"
"{iname='local.compositePtr4',addr='-',name='compositePtr4'," "{iname='local.compositePtr4',name='compositePtr4',"
"type='"NS"QWeakPointer<"NS"QString>',value='',numchild='3'}", "type='"NS"QWeakPointer<"NS"QString>',value='',numchild='3'}",
"local.simplePtr,local.simplePtr2,local.simplePtr3,local.simplePtr4," "local.simplePtr,local.simplePtr2,local.simplePtr3,local.simplePtr4,"
"local.compositePtr,local.compositePtr,local.compositePtr," "local.compositePtr,local.compositePtr,local.compositePtr,"
@@ -2804,10 +2902,10 @@ void tst_Gdb::dump_QSize()
{ {
prepare("dump_QSize"); prepare("dump_QSize");
next(2); next(2);
run("C","{iname='local.p',addr='-',name='p',type='"NS"QSize'," run("C","{iname='local.p',name='p',type='"NS"QSize',"
"value='(43, 44)',numchild='2',childtype='int',childnumchild='0'," "value='(43, 44)',numchild='2',childtype='int',childnumchild='0',"
"children=[{name='w',value='43'},{name='h',value='44'}]}," "children=[{name='w',value='43'},{name='h',value='44'}]},"
"{iname='local.f',addr='-',name='f',type='"NS"QSizeF'," "{iname='local.f',name='f',type='"NS"QSizeF',"
"value='(45, 46)',numchild='2',childtype='double',childnumchild='0'," "value='(45, 46)',numchild='2',childtype='double',childnumchild='0',"
"children=[{name='w',value='45'},{name='h',value='46'}]}", "children=[{name='w',value='45'},{name='h',value='46'}]}",
"local.p,local.f"); "local.p,local.f");
@@ -2828,24 +2926,24 @@ void tst_Gdb::dump_QStack()
{ {
prepare("dump_QStack"); prepare("dump_QStack");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.v',addr='-',name='v',type='"NS"QStack<int>'," run("A","{iname='local.v',name='v',type='"NS"QStack<int>',"
"value='<not in scope>',numchild='0'}"); "value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.v',addr='-',name='v',type='"NS"QStack<int>'," run("B","{iname='local.v',name='v',type='"NS"QStack<int>',"
"value='<0 items>',numchild='0'}"); "value='<0 items>',numchild='0'}");
run("B","{iname='local.v',addr='-',name='v',type='"NS"QStack<int>'," run("B","{iname='local.v',name='v',type='"NS"QStack<int>',"
"value='<0 items>',numchild='0',children=[]}", "local.v"); "value='<0 items>',numchild='0',children=[]}", "local.v");
next(); next();
run("C","{iname='local.v',addr='-',name='v',type='"NS"QStack<int>'," run("C","{iname='local.v',name='v',type='"NS"QStack<int>',"
"value='<1 items>',numchild='1'}"); "value='<1 items>',numchild='1'}");
run("C","{iname='local.v',addr='-',name='v',type='"NS"QStack<int>'," run("C","{iname='local.v',name='v',type='"NS"QStack<int>',"
"value='<1 items>',numchild='1',childtype='int'," "value='<1 items>',numchild='1',childtype='int',"
"childnumchild='0',children=[{value='3'}]}", // rounding... "childnumchild='0',children=[{value='3'}]}", // rounding...
"local.v"); "local.v");
next(); next();
run("D","{iname='local.v',addr='-',name='v',type='"NS"QStack<int>'," run("D","{iname='local.v',name='v',type='"NS"QStack<int>',"
"value='<2 items>',numchild='2'}"); "value='<2 items>',numchild='2'}");
run("D","{iname='local.v',addr='-',name='v',type='"NS"QStack<int>'," run("D","{iname='local.v',name='v',type='"NS"QStack<int>',"
"value='<2 items>',numchild='2',childtype='int'," "value='<2 items>',numchild='2',childtype='int',"
"childnumchild='0',children=[{value='3'},{value='2'}]}", "childnumchild='0',children=[{value='3'},{value='2'}]}",
"local.v"); "local.v");
@@ -2866,19 +2964,19 @@ void tst_Gdb::dump_QString()
{ {
prepare("dump_QString"); prepare("dump_QString");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.s',addr='-',name='s',type='"NS"QString'," run("A","{iname='local.s',name='s',type='"NS"QString',"
"value='<not in scope>',numchild='0'}"); "value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.s',addr='-',name='s',type='"NS"QString'," run("B","{iname='local.s',name='s',type='"NS"QString',"
"valueencoded='7',value='',numchild='0'}", "local.s"); "valueencoded='7',value='',numchild='0'}", "local.s");
// Plain C style dumping: // Plain C style dumping:
run("B","{iname='local.s',addr='-',name='s',type='"NS"QString'," run("B","{iname='local.s',name='s',type='"NS"QString',"
"value='{...}',numchild='5'}", "", 0); "value='{...}',numchild='5'}", "", 0);
run("B","{iname='local.s',addr='-',name='s',type='"NS"QString'," run("B","{iname='local.s',name='s',type='"NS"QString',"
"value='{...}',numchild='5',children=[" "value='{...}',numchild='5',children=["
"{iname='local.s.d',name='d',type='"NS"QString::Data *'," "{iname='local.s.d',name='d',type='"NS"QString::Data *',"
"value='-',numchild='1'}]}", "local.s", 0); "value='-',numchild='1'}]}", "local.s", 0);
run("B","{iname='local.s',addr='-',name='s',type='"NS"QString'," run("B","{iname='local.s',name='s',type='"NS"QString',"
"value='{...}',numchild='5'," "value='{...}',numchild='5',"
"children=[{iname='local.s.d',name='d'," "children=[{iname='local.s.d',name='d',"
"type='"NS"QString::Data *',value='-',numchild='1'," "type='"NS"QString::Data *',value='-',numchild='1',"
@@ -2886,10 +2984,10 @@ void tst_Gdb::dump_QString()
"type='"NS"QString::Data',value='{...}',numchild='11'}]}]}", "type='"NS"QString::Data',value='{...}',numchild='11'}]}]}",
"local.s,local.s.d", 0); "local.s,local.s.d", 0);
next(); next();
run("C","{iname='local.s',addr='-',name='s',type='"NS"QString'," run("C","{iname='local.s',name='s',type='"NS"QString',"
"valueencoded='7',value='680061006c006c006f00',numchild='0'}"); "valueencoded='7',value='680061006c006c006f00',numchild='0'}");
next(); next();
run("D","{iname='local.s',addr='-',name='s',type='"NS"QString'," run("D","{iname='local.s',name='s',type='"NS"QString',"
"valueencoded='7',value='680061006c006c006f007800',numchild='0'}"); "valueencoded='7',value='680061006c006c006f007800',numchild='0'}");
} }
@@ -2908,25 +3006,25 @@ void tst_Gdb::dump_QStringList()
{ {
prepare("dump_QStringList"); prepare("dump_QStringList");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.s',addr='-',name='s',type='"NS"QStringList'," run("A","{iname='local.s',name='s',type='"NS"QStringList',"
"value='<not in scope>',numchild='0'}"); "value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.s',addr='-',name='s',type='"NS"QStringList'," run("B","{iname='local.s',name='s',type='"NS"QStringList',"
"value='<0 items>',numchild='0'}"); "value='<0 items>',numchild='0'}");
run("B","{iname='local.s',addr='-',name='s',type='"NS"QStringList'," run("B","{iname='local.s',name='s',type='"NS"QStringList',"
"value='<0 items>',numchild='0',children=[]}", "local.s"); "value='<0 items>',numchild='0',children=[]}", "local.s");
next(); next();
run("C","{iname='local.s',addr='-',name='s',type='"NS"QStringList'," run("C","{iname='local.s',name='s',type='"NS"QStringList',"
"value='<1 items>',numchild='1'}"); "value='<1 items>',numchild='1'}");
run("C","{iname='local.s',addr='-',name='s',type='"NS"QStringList'," run("C","{iname='local.s',name='s',type='"NS"QStringList',"
"value='<1 items>',numchild='1',childtype='"NS"QString'," "value='<1 items>',numchild='1',childtype='"NS"QString',"
"childnumchild='0',children=[{valueencoded='7'," "childnumchild='0',children=[{valueencoded='7',"
"value='680065006c006c006f00'}]}", "value='680065006c006c006f00'}]}",
"local.s"); "local.s");
next(); next();
run("D","{iname='local.s',addr='-',name='s',type='"NS"QStringList'," run("D","{iname='local.s',name='s',type='"NS"QStringList',"
"value='<2 items>',numchild='2'}"); "value='<2 items>',numchild='2'}");
run("D","{iname='local.s',addr='-',name='s',type='"NS"QStringList'," run("D","{iname='local.s',name='s',type='"NS"QStringList',"
"value='<2 items>',numchild='2',childtype='"NS"QString'," "value='<2 items>',numchild='2',childtype='"NS"QString',"
"childnumchild='0',children=[" "childnumchild='0',children=["
"{valueencoded='7',value='680065006c006c006f00'}," "{valueencoded='7',value='680065006c006c006f00'},"
@@ -2949,24 +3047,24 @@ void tst_Gdb::dump_QVector()
{ {
prepare("dump_QVector"); prepare("dump_QVector");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.v',addr='-',name='v',type='"NS"QVector<double>'," run("A","{iname='local.v',name='v',type='"NS"QVector<double>',"
"value='<not in scope>',numchild='0'}"); "value='<not in scope>',numchild='0'}");
next(); next();
run("B","{iname='local.v',addr='-',name='v',type='"NS"QVector<double>'," run("B","{iname='local.v',name='v',type='"NS"QVector<double>',"
"value='<0 items>',numchild='0'}"); "value='<0 items>',numchild='0'}");
run("B","{iname='local.v',addr='-',name='v',type='"NS"QVector<double>'," run("B","{iname='local.v',name='v',type='"NS"QVector<double>',"
"value='<0 items>',numchild='0',children=[]}", "local.v"); "value='<0 items>',numchild='0',children=[]}", "local.v");
next(); next();
run("C","{iname='local.v',addr='-',name='v',type='"NS"QVector<double>'," run("C","{iname='local.v',name='v',type='"NS"QVector<double>',"
"value='<1 items>',numchild='1'}"); "value='<1 items>',numchild='1'}");
run("C","{iname='local.v',addr='-',name='v',type='"NS"QVector<double>'," run("C","{iname='local.v',name='v',type='"NS"QVector<double>',"
"value='<1 items>',numchild='1',childtype='double'," "value='<1 items>',numchild='1',childtype='double',"
"childnumchild='0',children=[{value='-'}]}", // rounding... "childnumchild='0',children=[{value='-'}]}", // rounding...
"local.v"); "local.v");
next(); next();
run("D","{iname='local.v',addr='-',name='v',type='"NS"QVector<double>'," run("D","{iname='local.v',name='v',type='"NS"QVector<double>',"
"value='<2 items>',numchild='2'}"); "value='<2 items>',numchild='2'}");
run("D","{iname='local.v',addr='-',name='v',type='"NS"QVector<double>'," run("D","{iname='local.v',name='v',type='"NS"QVector<double>',"
"value='<2 items>',numchild='2',childtype='double'," "value='<2 items>',numchild='2',childtype='double',"
"childnumchild='0',children=[{value='-'},{value='-'}]}", "childnumchild='0',children=[{value='-'},{value='-'}]}",
"local.v"); "local.v");
@@ -3034,7 +3132,7 @@ void dump_QVariant()
void tst_Gdb::dump_QVariant() void tst_Gdb::dump_QVariant()
{ {
#define PRE "iname='local.v',addr='-',name='v',type='"NS"QVariant'," #define PRE "iname='local.v',name='v',type='"NS"QVariant',"
prepare("dump_QVariant"); prepare("dump_QVariant");
if (checkUninitialized) /*<not in scope>*/ if (checkUninitialized) /*<not in scope>*/
run("A","{"PRE"'value=<not in scope>',numchild='0'}"); run("A","{"PRE"'value=<not in scope>',numchild='0'}");
@@ -3220,13 +3318,13 @@ void tst_Gdb::dump_QWeakPointer_11()
// Case 1.1: Null pointer. // Case 1.1: Null pointer.
prepare("dump_QWeakPointer_11"); prepare("dump_QWeakPointer_11");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.sp',addr='-',name='sp'," run("A","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}"); "type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}");
next(); next();
next(); next();
run("B","{iname='local.sp',addr='-',name='sp'," run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='<null>',numchild='0'}," "type='"NS"QSharedPointer<int>',value='<null>',numchild='0'},"
"{iname='local.wp',addr='-',name='wp'," "{iname='local.wp',name='wp',"
"type='"NS"QWeakPointer<int>',value='<null>',numchild='0'}"); "type='"NS"QWeakPointer<int>',value='<null>',numchild='0'}");
} }
@@ -3244,20 +3342,20 @@ void tst_Gdb::dump_QWeakPointer_12()
// Case 1.2: Weak pointer is unique. // Case 1.2: Weak pointer is unique.
prepare("dump_QWeakPointer_12"); prepare("dump_QWeakPointer_12");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.sp',addr='-',name='sp'," run("A","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}"); "type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}");
next(); next();
next(); next();
run("B","{iname='local.sp',addr='-',name='sp'," run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='',numchild='3'}," "type='"NS"QSharedPointer<int>',value='',numchild='3'},"
"{iname='local.wp',addr='-',name='wp'," "{iname='local.wp',name='wp',"
"type='"NS"QWeakPointer<int>',value='',numchild='3'}"); "type='"NS"QWeakPointer<int>',value='',numchild='3'}");
run("B","{iname='local.sp',addr='-',name='sp'," run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='',numchild='3',children=[" "type='"NS"QSharedPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'}," "{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='2',type='int',numchild='0'}," "{name='weakref',value='2',type='int',numchild='0'},"
"{name='strongref',value='2',type='int',numchild='0'}]}," "{name='strongref',value='2',type='int',numchild='0'}]},"
"{iname='local.wp',addr='-',name='wp'," "{iname='local.wp',name='wp',"
"type='"NS"QWeakPointer<int>',value='',numchild='3',children=[" "type='"NS"QWeakPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'}," "{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='2',type='int',numchild='0'}," "{name='weakref',value='2',type='int',numchild='0'},"
@@ -3280,28 +3378,28 @@ void tst_Gdb::dump_QWeakPointer_13()
// Case 1.3: There are other weak pointers. // Case 1.3: There are other weak pointers.
prepare("dump_QWeakPointer_13"); prepare("dump_QWeakPointer_13");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.sp',addr='-',name='sp'," run("A","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}"); "type='"NS"QSharedPointer<int>',value='<not in scope>',numchild='0'}");
next(); next();
next(); next();
next(); next();
run("B","{iname='local.sp',addr='-',name='sp'," run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='',numchild='3'}," "type='"NS"QSharedPointer<int>',value='',numchild='3'},"
"{iname='local.wp',addr='-',name='wp'," "{iname='local.wp',name='wp',"
"type='"NS"QWeakPointer<int>',value='',numchild='3'}," "type='"NS"QWeakPointer<int>',value='',numchild='3'},"
"{iname='local.wp2',addr='-',name='wp2'," "{iname='local.wp2',name='wp2',"
"type='"NS"QWeakPointer<int>',value='',numchild='3'}"); "type='"NS"QWeakPointer<int>',value='',numchild='3'}");
run("B","{iname='local.sp',addr='-',name='sp'," run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='',numchild='3',children=[" "type='"NS"QSharedPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'}," "{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',type='int',numchild='0'}," "{name='weakref',value='3',type='int',numchild='0'},"
"{name='strongref',value='3',type='int',numchild='0'}]}," "{name='strongref',value='3',type='int',numchild='0'}]},"
"{iname='local.wp',addr='-',name='wp'," "{iname='local.wp',name='wp',"
"type='"NS"QWeakPointer<int>',value='',numchild='3',children=[" "type='"NS"QWeakPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'}," "{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',type='int',numchild='0'}," "{name='weakref',value='3',type='int',numchild='0'},"
"{name='strongref',value='3',type='int',numchild='0'}]}," "{name='strongref',value='3',type='int',numchild='0'}]},"
"{iname='local.wp2',addr='-',name='wp2'," "{iname='local.wp2',name='wp2',"
"type='"NS"QWeakPointer<int>',value='',numchild='3'}", "type='"NS"QWeakPointer<int>',value='',numchild='3'}",
"local.sp,local.wp"); "local.sp,local.wp");
} }
@@ -3320,17 +3418,17 @@ void tst_Gdb::dump_QWeakPointer_2()
// Case 2: Composite type. // Case 2: Composite type.
prepare("dump_QWeakPointer_2"); prepare("dump_QWeakPointer_2");
if (checkUninitialized) if (checkUninitialized)
run("A","{iname='local.sp',addr='-',name='sp'," run("A","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<"NS"QString>',value='<not in scope>',numchild='0'}"); "type='"NS"QSharedPointer<"NS"QString>',value='<not in scope>',numchild='0'}");
next(); next();
next(); next();
run("B","{iname='local.sp',addr='-',name='sp'," run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3',children=[" "type='"NS"QSharedPointer<"NS"QString>',value='',numchild='3',children=["
"{name='data',type='"NS"QString'," "{name='data',type='"NS"QString',"
"valueencoded='7',value='5400650073007400',numchild='0'}," "valueencoded='7',value='5400650073007400',numchild='0'},"
"{name='weakref',value='2',type='int',numchild='0'}," "{name='weakref',value='2',type='int',numchild='0'},"
"{name='strongref',value='2',type='int',numchild='0'}]}," "{name='strongref',value='2',type='int',numchild='0'}]},"
"{iname='local.wp',addr='-',name='wp'," "{iname='local.wp',name='wp',"
"type='"NS"QWeakPointer<"NS"QString>',value='',numchild='3',children=[" "type='"NS"QWeakPointer<"NS"QString>',value='',numchild='3',children=["
"{name='data',type='"NS"QString'," "{name='data',type='"NS"QString',"
"valueencoded='7',value='5400650073007400',numchild='0'}," "valueencoded='7',value='5400650073007400',numchild='0'},"
@@ -3368,11 +3466,14 @@ int main(int argc, char *argv[])
dump_array_int(); dump_array_int();
dump_std_list(); dump_std_list();
dump_std_vector(); dump_std_vector();
dump_std_string();
dump_std_wstring();
dump_Foo(); dump_Foo();
dump_misc(); dump_misc();
dump_QByteArray(); dump_QByteArray();
dump_QChar(); dump_QChar();
dump_QHash_int_int(); dump_QHash_int_int();
dump_QHash_QString_QString();
dump_QList_char(); dump_QList_char();
dump_QList_char_star(); dump_QList_char_star();
dump_QList_int(); dump_QList_int();
@@ -3380,6 +3481,7 @@ int main(int argc, char *argv[])
dump_QList_Int3(); dump_QList_Int3();
dump_QList_QString(); dump_QList_QString();
dump_QList_QString3(); dump_QList_QString3();
dump_QMap_QString_QString();
dump_QPoint(); dump_QPoint();
dump_QRect(); dump_QRect();
dump_QSharedPointer(); dump_QSharedPointer();
+6
View File
@@ -157,6 +157,12 @@ public:
void testArray() void testArray()
{ {
X xxx; X xxx;
(void *) 0;
double d[3][3];
for (int i = 0; i != 3; ++i)
for (int j = 0; j != 3; ++j)
d[i][j] = i + j;
char c[20]; char c[20];
c[0] = 'a'; c[0] = 'a';
c[1] = 'b'; c[1] = 'b';