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
unix:!macx {
system("mkdir -p `dirname $$QCH_FILE` && touch $$QCH_FILE")
qch_docs.path = /share/doc/qtcreator
qch_docs.CONFIG += no_check_exist
INSTALLS += qch_docs
}
+1 -1
View File
@@ -1639,7 +1639,7 @@ static void qDumpQList(QDumper &d)
}
qCheckAccess(pdata);
d.putItemCount("value", n);
d.putItemCount("value", nn);
d.putItem("valueeditable", "false");
d.putItem("numchild", n);
if (d.dumpChildren) {
+19
View File
@@ -152,6 +152,25 @@ ClassBinding *NamespaceBinding::findClassBinding(Name *name, QSet<Binding *> *pr
if (processed->contains(this))
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);
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)
{
_processed.clear();
_references.clear();
_declSymbol = symbol;
_id = id;
@@ -92,6 +93,9 @@ QString FindUsages::matchingLine(const Token &tk) const
void FindUsages::reportResult(unsigned tokenIndex, const QList<Symbol *> &candidates)
{
if (_processed.contains(tokenIndex))
return;
const bool isStrongResult = checkCandidates(candidates);
if (isStrongResult)
@@ -100,6 +104,11 @@ void FindUsages::reportResult(unsigned tokenIndex, const QList<Symbol *> &candid
void FindUsages::reportResult(unsigned tokenIndex)
{
if (_processed.contains(tokenIndex))
return;
_processed.insert(tokenIndex);
const Token &tk = tokenAt(tokenIndex);
const QString lineText = matchingLine(tk);
+1
View File
@@ -114,6 +114,7 @@ private:
QList<int> _references;
LookupContext _previousContext;
int _inSimpleDeclaration;
QSet<unsigned> _processed;
};
} // end of namespace CPlusPlus
@@ -57,17 +57,22 @@ void ProgressManagerPrivate::init()
void ProgressManagerPrivate::cancelTasks(const QString &type)
{
bool found = false;
QMap<QFutureWatcher<void> *, QString>::iterator task = m_runningTasks.begin();
while (task != m_runningTasks.end()) {
if (task.value() != type) {
++task;
continue;
}
found = true;
disconnect(task.key(), SIGNAL(finished()), this, SLOT(taskFinished()));
task.key()->cancel();
delete task.key();
task = m_runningTasks.erase(task);
}
if (found) {
emit allTasksFinished(type);
}
}
void ProgressManagerPrivate::cancelAllRunningTasks()
@@ -88,6 +93,7 @@ FutureProgress *ProgressManagerPrivate::addTask(const QFuture<void> &future, con
m_runningTasks.insert(watcher, type);
connect(watcher, SIGNAL(finished()), this, SLOT(taskFinished()));
watcher->setFuture(future);
emit taskStarted(type);
return m_progressView->addTask(future, title, type, persistency);
}
@@ -101,6 +107,11 @@ void ProgressManagerPrivate::taskFinished()
QObject *taskObject = sender();
QTC_ASSERT(taskObject, return);
QFutureWatcher<void> *task = static_cast<QFutureWatcher<void> *>(taskObject);
QString type = m_runningTasks.value(task);
m_runningTasks.remove(task);
delete task;
if (!m_runningTasks.values().contains(type)) {
emit allTasksFinished(type);
}
}
@@ -51,6 +51,10 @@ public:
public slots:
virtual void cancelTasks(const QString &type) = 0;
signals:
void taskStarted(const QString &type);
void allTasksFinished(const QString &type);
};
} // namespace Core
+1
View File
@@ -68,6 +68,7 @@ CodepasterPlugin::CodepasterPlugin()
CodepasterPlugin::~CodepasterPlugin()
{
qDeleteAll(m_protocols);
}
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/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <texteditor/completionsupport.h>
#include <texteditor/fontsettings.h>
#include <texteditor/storagesettings.h>
@@ -55,7 +56,6 @@
#include <QtCore/QFileInfo>
#include <QtCore/QSettings>
#include <QtGui/QMenu>
#include <QtGui/QAction>
using namespace CppEditor::Internal;
@@ -211,18 +211,18 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
contextMenu->addAction(cmd);
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
QAction *findUsagesAction = new QAction(tr("Find Usages"), this);
cmd = am->registerAction(findUsagesAction, Constants::FIND_USAGES, context);
m_findUsagesAction = new QAction(tr("Find Usages"), this);
cmd = am->registerAction(m_findUsagesAction, Constants::FIND_USAGES, context);
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);
am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
QAction *renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol under Cursor"), this);
cmd = am->registerAction(renameSymbolUnderCursorAction,
m_renameSymbolUnderCursorAction = new QAction(tr("Rename Symbol under Cursor"), this);
cmd = am->registerAction(m_renameSymbolUnderCursorAction,
Constants::RENAME_SYMBOL_UNDER_CURSOR, context);
cmd->setDefaultKeySequence(QKeySequence("CTRL+SHIFT+R"));
connect(renameSymbolUnderCursorAction, SIGNAL(triggered()), this, SLOT(renameSymbolUnderCursor()));
connect(m_renameSymbolUnderCursorAction, SIGNAL(triggered()), this, SLOT(renameSymbolUnderCursor()));
contextMenu->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);
contextMenu->addAction(cmd);
connect(core->progressManager(), SIGNAL(taskStarted(QString)),
this, SLOT(onTaskStarted(QString)));
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
this, SLOT(onAllTasksFinished(QString)));
readSettings();
return true;
}
@@ -300,4 +303,20 @@ void CppPlugin::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)
+8 -3
View File
@@ -30,12 +30,13 @@
#ifndef CPPPLUGIN_H
#define CPPPLUGIN_H
#include <QtCore/QtPlugin>
#include <QtCore/QStringList>
#include <extensionsystem/iplugin.h>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <QtCore/QtPlugin>
#include <QtCore/QStringList>
#include <QtGui/QAction>
namespace TextEditor {
class TextEditorActionHandler;
} // namespace TextEditor
@@ -74,6 +75,8 @@ private slots:
void switchDeclarationDefinition();
void jumpToDefinition();
void renameSymbolUnderCursor();
void onTaskStarted(const QString &type);
void onAllTasksFinished(const QString &type);
void findUsages();
private:
@@ -85,6 +88,8 @@ private:
TextEditor::TextEditorActionHandler *m_actionHandler;
bool m_sortedMethodOverview;
QAction *m_renameSymbolUnderCursorAction;
QAction *m_findUsagesAction;
};
class CppEditorFactory : public Core::IEditorFactory
+8 -8
View File
@@ -1124,14 +1124,6 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &ba
m_completionOperator,
&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;
foreach (const TypeOfExpression::Result &r, classObjectResults) {
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);
if (! m_completions.isEmpty())
return true;
+18 -2
View File
@@ -62,7 +62,8 @@ using namespace CppTools::Internal;
using namespace CPlusPlus;
CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelManager)
: _modelManager(modelManager),
: QObject(modelManager),
_modelManager(modelManager),
_resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>())
{
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) {
const int blockNumber = item.lineNumber - 1;
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,
QTextCursor::KeepAnchor);
cursors.append(tc);
@@ -335,6 +350,7 @@ void CppFindReferences::displayResult(int index)
void CppFindReferences::searchFinished()
{
_resultWindow->finishSearch();
emit changed();
}
+4
View File
@@ -195,8 +195,12 @@ DisassemblerViewAgent::~DisassemblerViewAgent()
if (d->editor)
d->editor->deleteLater();
d->editor = 0;
delete d->locationMark;
d->locationMark = 0;
delete d;
d = 0;
delete d->locationMark;
d->locationMark = 0;
}
void DisassemblerViewAgent::cleanup()
+37 -18
View File
@@ -193,6 +193,11 @@ GdbEngine::GdbEngine(DebuggerManager *manager) :
m_trkOptions->fromSettings(Core::ICore::instance()->settings());
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()
m_busy = false;
@@ -606,6 +611,9 @@ void GdbEngine::readGdbStandardError()
void GdbEngine::readGdbStandardOutput()
{
if (m_commandTimer->isActive())
m_commandTimer->start(); // Retrigger
int newstart = 0;
int scan = m_inbuffer.size();
@@ -734,7 +742,7 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd)
}
if ((cmd.flags & NeedsStop) || !m_commandsToRunOnTemporaryBreak.isEmpty()) {
if (state() == InferiorStopped
if (state() == InferiorStopped || state() == InferiorUnrunnable
|| state() == InferiorStarting || state() == AdapterStarted) {
// Can be safely sent now.
flushCommand(cmd);
@@ -796,10 +804,27 @@ void GdbEngine::flushCommand(const GdbCommand &cmd0)
m_gdbAdapter->write(cmd.command.toLatin1() + "\r\n");
m_commandTimer->start();
if (cmd.flags & LosesChild)
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)
{
//qDebug() << "TOKEN:" << response.token
@@ -927,6 +952,9 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
} else {
PENDING_DEBUG("MISSING TOKENS: " << m_cookieForToken.keys());
}
if (m_cookieForToken.isEmpty())
m_commandTimer->stop();
}
void GdbEngine::executeDebuggerCommand(const QString &command)
@@ -1426,7 +1454,6 @@ void GdbEngine::shutdown()
m_gdbAdapter->shutdown();
// fall-through
case AdapterStartFailed: // Adapter "did something", but it did not help
// FIXME set some timeout?
if (m_gdbProc.state() == QProcess::Running) {
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
} else {
@@ -1437,7 +1464,6 @@ void GdbEngine::shutdown()
case InferiorRunning:
case InferiorStopping:
case InferiorStopped:
// FIXME set some timeout?
postCommand(_(m_gdbAdapter->inferiorShutdownCommand()),
NeedsStop | LosesChild, CB(handleInferiorShutdown));
break;
@@ -1446,7 +1472,6 @@ void GdbEngine::shutdown()
case InferiorShutDown:
case InferiorShutdownFailed: // Whatever
case InferiorUnrunnable:
// FIXME set some timeout?
postCommand(_("-gdb-exit"), GdbEngine::ExitRequest, CB(handleGdbExit));
setState(EngineShuttingDown); // Do it after posting the command!
break;
@@ -3246,23 +3271,13 @@ void GdbEngine::handleVarCreate(const GdbResponse &response)
if (response.resultClass == GdbResultDone) {
data.variable = data.iname;
setWatchDataType(data, response.data.findChild("type"));
if (hasDebuggingHelperForType(data.type)) {
// we do not trust gdb if we have a custom dumper
if (response.data.findChild("children").isValid())
data.setChildrenUnneeded();
else if (manager()->watchHandler()->isExpandedIName(data.iname))
if (manager()->watchHandler()->isExpandedIName(data.iname)
&& !response.data.findChild("children").isValid())
data.setChildrenNeeded();
insertData(data);
} else {
if (response.data.findChild("children").isValid())
else
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 {
data.setError(QString::fromLocal8Bit(response.data.findChild("msg").data()));
if (data.isWatcher()) {
@@ -3707,7 +3722,8 @@ void GdbEngine::insertData(const WatchData &data0)
void GdbEngine::handleVarListChildrenHelper(const GdbMi &item,
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 name = item.findChild("name").data();
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
QString location = gdb;
const QByteArray env = qgetenv("QTC_DEBUGGER_PATH");
if (!env.isEmpty())
location = QString::fromLatin1(env);
if (location.isEmpty())
location = theDebuggerStringSetting(GdbLocation);
QStringList gdbArgs;
+4
View File
@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE
class QAction;
class QAbstractItemModel;
class QTimer;
class QWidget;
class QMainWindow;
QT_END_NAMESPACE
@@ -228,9 +229,12 @@ private: ////////// Gdb Command Management //////////
const QVariant &cookie = QVariant());
void postCommandHelper(const GdbCommand &cmd);
void flushQueuedCommands();
Q_SLOT void commandTimeout();
void setTokenBarrier();
QHash<int, GdbCommand> m_cookieForToken;
QTimer *m_commandTimer;
enum { COMMAND_TIMEOUT = 20000 };
QByteArray m_pendingConsoleStreamOutput;
QByteArray m_pendingLogStreamOutput;
+6
View File
@@ -73,6 +73,12 @@ StackWindow::StackWindow(DebuggerManager *manager, QWidget *parent)
this, SLOT(showAddressColumn(bool)));
}
StackWindow::~StackWindow()
{
// FIXME: leak
//delete m_disassemblerAgent;
}
void StackWindow::showAddressColumn(bool on)
{
setColumnHidden(4, !on);
+1
View File
@@ -50,6 +50,7 @@ class StackWindow : public QTreeView
public:
StackWindow(DebuggerManager *manager, QWidget *parent = 0);
~StackWindow();
signals:
void frameActivated(int);
+11 -4
View File
@@ -41,6 +41,7 @@
#include <QtCore/QDebug>
#include <QtCore/QEvent>
#include <QtCore/QtAlgorithms>
#include <QtCore/QTextStream>
#include <QtCore/QTimer>
@@ -361,6 +362,11 @@ WatchModel::WatchModel(WatchHandler *handler, WatchType type)
}
}
WatchModel::~WatchModel()
{
delete m_root;
}
WatchItem *WatchModel::rootItem() const
{
return m_root;
@@ -420,7 +426,7 @@ void WatchModel::removeOutdated()
void WatchModel::removeOutdatedHelper(WatchItem *item)
{
if (item->generation < generationCounter) {
removeItem(item);
destroyItem(item);
} else {
foreach (WatchItem *child, item->children)
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;
QModelIndex index = watchIndex(parent);
@@ -437,6 +443,7 @@ void WatchModel::removeItem(WatchItem *item)
beginRemoveRows(index, n, n);
parent->children.removeAt(n);
endRemoveRows();
delete item;
}
static QString parentName(const QString &iname)
@@ -1187,7 +1194,7 @@ void WatchHandler::removeData(const QString &iname)
return;
WatchItem *item = model->findItem(iname, model->m_root);
if (item)
model->removeItem(item);
model->destroyItem(item);
}
void WatchHandler::watchExpression()
@@ -1302,7 +1309,7 @@ void WatchHandler::removeWatchExpression(const QString &exp)
m_watcherNames.remove(exp);
foreach (WatchItem *item, m_watchers->rootItem()->children) {
if (item->exp == exp) {
m_watchers->removeItem(item);
m_watchers->destroyItem(item);
saveWatchers();
break;
}
+2 -1
View File
@@ -180,6 +180,7 @@ class WatchModel : public QAbstractItemModel
private:
explicit WatchModel(WatchHandler *handler, WatchType type);
virtual ~WatchModel();
QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
@@ -209,7 +210,7 @@ private:
void removeOutdated();
void removeOutdatedHelper(WatchItem *item);
WatchItem *rootItem() const;
void removeItem(WatchItem *item);
void destroyItem(WatchItem *item);
void emitDataChanged(int column,
const QModelIndex &parentIndex = QModelIndex());
+24 -17
View File
@@ -53,7 +53,8 @@ static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults");
SearchResultWindow::SearchResultWindow()
: m_currentSearch(0),
m_isShowingReplaceUI(false)
m_isShowingReplaceUI(false),
m_focusReplaceEdit(false)
{
m_widget = new QStackedWidget;
m_widget->setWindowTitle(name());
@@ -124,14 +125,12 @@ void SearchResultWindow::setShowReplaceUI(bool show)
m_isShowingReplaceUI = show;
}
bool SearchResultWindow::isShowingReplaceUI() const
{
return m_isShowingReplaceUI;
}
void SearchResultWindow::handleReplaceButton()
{
QTC_ASSERT(m_currentSearch, return);
// 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());
}
@@ -177,9 +176,19 @@ SearchResult *SearchResultWindow::startNewSearch(SearchMode searchOrSearchAndRep
return m_currentSearch;
}
void SearchResultWindow::finishSearch()
{
if (m_items.count()) {
m_replaceButton->setEnabled(true);
} else {
showNoMatchesFound();
}
}
void SearchResultWindow::clearContents()
{
setReplaceUIEnabled(false);
m_replaceTextEdit->setEnabled(false);
m_replaceButton->setEnabled(false);
m_replaceTextEdit->clear();
m_searchResultTreeView->clear();
m_items.clear();
@@ -189,7 +198,8 @@ void SearchResultWindow::clearContents()
void SearchResultWindow::showNoMatchesFound()
{
setReplaceUIEnabled(false);
m_replaceTextEdit->setEnabled(false);
m_replaceButton->setEnabled(false);
m_widget->setCurrentWidget(m_noMatchesFoundDisplay);
}
@@ -220,7 +230,8 @@ void SearchResultWindow::setFocus()
m_searchResultTreeView->setFocus();
} else {
if (!m_widget->focusWidget()
|| m_widget->focusWidget() == m_replaceTextEdit) {
|| m_widget->focusWidget() == m_replaceTextEdit
|| m_focusReplaceEdit) {
m_replaceTextEdit->setFocus();
} else {
m_searchResultTreeView->setFocus();
@@ -257,20 +268,16 @@ void SearchResultWindow::addResult(const QString &fileName, int lineNumber, cons
m_items.append(item);
m_searchResultTreeView->appendResultLine(index, fileName, lineNumber, rowText, searchTermStart, searchTermLength);
if (index == 0) {
setReplaceUIEnabled(true);
// We didn't have an item before, set the focus to the m_searchResultTreeView
m_replaceTextEdit->setEnabled(true);
// We didn't have an item before, set the focus to the search widget
m_focusReplaceEdit = true;
setFocus();
m_focusReplaceEdit = false;
m_searchResultTreeView->selectionModel()->select(m_searchResultTreeView->model()->index(0, 0, QModelIndex()), QItemSelectionModel::Select);
emit navigateStateChanged();
}
}
void SearchResultWindow::setReplaceUIEnabled(bool enabled)
{
m_replaceTextEdit->setEnabled(enabled);
m_replaceButton->setEnabled(enabled);
}
void SearchResultWindow::handleExpandCollapseToolButton(bool checked)
{
m_searchResultTreeView->setAutoExpandResults(checked);
+4 -5
View File
@@ -103,9 +103,6 @@ public:
void setTextEditorFont(const QFont &font);
void setShowReplaceUI(bool show);
bool isShowingReplaceUI() const;
void setTextToReplace(const QString &textToReplace);
QString textToReplace() const;
@@ -114,17 +111,18 @@ public:
public slots:
void clearContents();
void showNoMatchesFound();
void addResult(const QString &fileName, int lineNumber, const QString &lineText,
int searchTermStart, int searchTermLength, const QVariant &userData = QVariant());
void finishSearch();
private slots:
void handleExpandCollapseToolButton(bool checked);
void handleJumpToSearchResult(int index, bool checked);
void handleReplaceButton();
void setReplaceUIEnabled(bool enabled);
void showNoMatchesFound();
private:
void setShowReplaceUI(bool show);
void readSettings();
void writeSettings();
QList<SearchResultItem> checkedItems() const;
@@ -140,6 +138,7 @@ private:
SearchResult *m_currentSearch;
QList<SearchResultItem> m_items;
bool m_isShowingReplaceUI;
bool m_focusReplaceEdit;
};
} // namespace Find
+3 -3
View File
@@ -220,7 +220,7 @@ void CentralWidget::setSource(const QUrl &url)
qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage));
if (!viewer && !lastViewer) {
viewer = new HelpViewer(helpEngine, this);
viewer = new HelpViewer(helpEngine, this, this);
viewer->installEventFilter(this);
lastTabPage = tabWidget->addTab(viewer, QString());
tabWidget->setCurrentIndex(lastTabPage);
@@ -428,7 +428,7 @@ void CentralWidget::setGlobalActions(const QList<QAction*> &actions)
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->setZoom(zoom);
viewer->setSource(url);
@@ -448,7 +448,7 @@ void CentralWidget::setSourceInNewTab(const QUrl &url, int zoom)
HelpViewer *CentralWidget::newEmptyTab()
{
HelpViewer* viewer = new HelpViewer(helpEngine, this);
HelpViewer* viewer = new HelpViewer(helpEngine, this, this);
viewer->installEventFilter(this);
viewer->setFocus(Qt::OtherFocusReason);
#if defined(QT_NO_WEBKIT)
+1 -1
View File
@@ -491,7 +491,7 @@ void HelpPlugin::createRightPaneSideBar()
addAutoReleasedObject(new Core::BaseRightPaneWidget(m_rightPaneSideBar));
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();
agg->add(m_helpViewerForSideBar);
agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar));
@@ -207,6 +207,7 @@ ProjectExplorerPlugin::ProjectExplorerPlugin()
ProjectExplorerPlugin::~ProjectExplorerPlugin()
{
removeObject(d->m_welcomePlugin);
delete d->m_welcomePlugin;
removeObject(this);
delete d;
}
@@ -1869,16 +1870,14 @@ void ProjectExplorerPlugin::showInGraphicalShell()
{
QTC_ASSERT(d->m_currentNode, return)
#if defined(Q_OS_WIN)
QString explorer = Environment::systemEnvironment().searchInPath("explorer.exe");
const QString explorer = Environment::systemEnvironment().searchInPath("explorer.exe");
if (explorer.isEmpty()) {
QMessageBox::warning(Core::ICore::instance()->mainWindow(),
tr("Launching Windows Explorer failed"),
tr("Could not find explorer.exe in path to launch Windows Explorer."));
return;
}
QProcess::execute(explorer,
QStringList() << QString("/select,%1")
.arg(QDir::toNativeSeparators(d->m_currentNode->path())));
QProcess::startDetached(explorer, QStringList(QLatin1String("/select,") + QDir::toNativeSeparators(d->m_currentNode->path())));
#elif defined(Q_OS_MAC)
QProcess::execute("/usr/bin/osascript", QStringList()
<< "-e"
@@ -1889,15 +1888,15 @@ void ProjectExplorerPlugin::showInGraphicalShell()
<< "tell application \"Finder\" to activate");
#else
// we cannot select a file here, because no file browser really supports it...
QFileInfo fileInfo(d->m_currentNode->path());
QString xdgopen = Environment::systemEnvironment().searchInPath("xdg-open");
const QFileInfo fileInfo(d->m_currentNode->path());
const QString xdgopen = Environment::systemEnvironment().searchInPath("xdg-open");
if (xdgopen.isEmpty()) {
QMessageBox::warning(Core::ICore::instance()->mainWindow(),
tr("Launching a file explorer failed"),
tr("Could not find xdg-open to launch the native file explorer."));
return;
}
QProcess::execute(xdgopen, QStringList() << fileInfo.path());
QProcess::startDetached(xdgopen, QStringList(fileInfo.path()));
#endif
}
@@ -35,18 +35,24 @@ namespace Internal {
struct ProjectExplorerSettings
{
ProjectExplorerSettings() : buildBeforeRun(true), saveBeforeBuild(false),
showCompilerOutput(false), useJom(true) {}
bool buildBeforeRun;
bool saveBeforeBuild;
bool showCompilerOutput;
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 Internal
@@ -39,6 +39,11 @@ ProjectWelcomePage::ProjectWelcomePage()
}
ProjectWelcomePage::~ProjectWelcomePage()
{
}
QWidget* ProjectWelcomePage::page()
{
return m_page;
@@ -42,6 +42,7 @@ class ProjectWelcomePage : public Utils::IWelcomePage
Q_OBJECT
public:
ProjectWelcomePage();
~ProjectWelcomePage();
QWidget *page();
QString title() const { return tr("Develop"); }
+18 -9
View File
@@ -101,16 +101,19 @@ void WinGuiProcess::run()
ZeroMemory(m_pid, sizeof(PROCESS_INFORMATION));
m_exitCode = 0;
bool started = false;
HANDLE bufferReadyEvent = NULL;
HANDLE dataReadyEvent = 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);
bool success = CreateProcessW(0, (WCHAR*)cmdLine.utf16(),
const bool dbgInterface = setupDebugInterface(bufferReadyEvent, dataReadyEvent, sharedFile, sharedMem);
const QString cmdLine = createWinCommandline(m_program, m_args);
started = CreateProcessW(0, (WCHAR*)cmdLine.utf16(),
0, 0, TRUE, CREATE_UNICODE_ENVIRONMENT,
environment().isEmpty() ? 0
: createWinEnvironment(fixWinEnvironment(environment())).data(),
@@ -118,11 +121,9 @@ void WinGuiProcess::run()
: (WCHAR*)QDir::convertSeparators(workingDirectory()).utf16(),
&si, m_pid);
if (!success) {
if (!started) {
emit processError(tr("The process could not be started!"));
delete m_pid;
m_pid = 0;
return;
break;
}
if (!dbgInterface) {
@@ -156,17 +157,25 @@ void WinGuiProcess::run()
}
}
}
} while (false);
if (started) {
GetExitCodeProcess(m_pid->hProcess, &m_exitCode);
emit processFinished(static_cast<int>(m_exitCode));
}
if (sharedMem)
UnmapViewOfFile(sharedMem);
if (sharedFile != NULL)
CloseHandle(sharedFile);
if (bufferReadyEvent != NULL)
CloseHandle(bufferReadyEvent);
if (dataReadyEvent != NULL)
CloseHandle(dataReadyEvent);
if (m_pid->hProcess != NULL)
CloseHandle(m_pid->hProcess);
if (m_pid->hThread != NULL)
CloseHandle(m_pid->hThread);
delete m_pid;
m_pid = 0;
}
@@ -42,6 +42,9 @@ using namespace Utils;
namespace ProjectExplorer {
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
{
Q_OBJECT
@@ -132,8 +132,10 @@ S60Manager::S60Manager(QObject *parent)
S60Manager::~S60Manager()
{
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));
delete m_pluginObjects.at(i);
}
}
void S60Manager::addAutoReleasedObject(QObject *o)
+9 -11
View File
@@ -535,8 +535,6 @@ void Qt4Project::updateCodeModel()
if (debug)
qDebug()<<"Qt4Project::updateCodeModel()";
// TODO figure out the correct ordering of #include directories
CppTools::CppModelManagerInterface *modelmanager =
ExtensionSystem::PluginManager::instance()
->getObject<CppTools::CppModelManagerInterface>();
@@ -570,7 +568,7 @@ void Qt4Project::updateCodeModel()
const QHash<QString, QString> versionInfo = qtVersion(activeBuildConfiguration())->versionInfo();
const QString newQtIncludePath = versionInfo.value(QLatin1String("QT_INSTALL_HEADERS"));
predefinedIncludePaths.prepend(newQtIncludePath);
predefinedIncludePaths.append(newQtIncludePath);
QDir dir(newQtIncludePath);
foreach (QFileInfo info, dir.entryInfoList(QDir::Dirs)) {
const QString path = info.fileName();
@@ -578,7 +576,7 @@ void Qt4Project::updateCodeModel()
if (path == QLatin1String("Qt"))
continue; // skip $QT_INSTALL_HEADERS/Qt. There's no need to include it.
else if (path.startsWith(QLatin1String("Qt")) || path == QLatin1String("phonon"))
predefinedIncludePaths.prepend(info.absoluteFilePath());
predefinedIncludePaths.append(info.absoluteFilePath());
}
FindQt4ProFiles findQt4ProFiles;
@@ -589,13 +587,13 @@ void Qt4Project::updateCodeModel()
#ifdef Q_OS_MAC
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
QDir frameworkDir(newQtLibsPath);
foreach (QFileInfo info, frameworkDir.entryInfoList(QDir::Dirs)) {
if (! info.fileName().startsWith(QLatin1String("Qt")))
continue;
allIncludePaths.prepend(info.absoluteFilePath()+"/Headers");
allIncludePaths.append(info.absoluteFilePath()+"/Headers");
}
#endif
@@ -632,9 +630,9 @@ void Qt4Project::updateCodeModel()
const QStringList proIncludePaths = pro->variableValue(IncludePathVar);
foreach (const QString &includePath, proIncludePaths) {
if (!allIncludePaths.contains(includePath))
allIncludePaths.prepend(includePath);
allIncludePaths.append(includePath);
if (!info.includes.contains(includePath))
info.includes.prepend(includePath);
info.includes.append(includePath);
}
{ // Pkg Config support
@@ -646,13 +644,13 @@ void Qt4Project::updateCodeModel()
process.waitForFinished();
QString result = process.readAllStandardOutput();
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
info.includes.prepend(qtVersion(activeBuildConfiguration())->mkspecPath());
info.includes.append(qtVersion(activeBuildConfiguration())->mkspecPath());
info.frameworkPaths = allFrameworkPaths;
@@ -666,7 +664,7 @@ void Qt4Project::updateCodeModel()
}
// Add mkspec directory
allIncludePaths.prepend(qtVersion(activeBuildConfiguration())->mkspecPath());
allIncludePaths.append(qtVersion(activeBuildConfiguration())->mkspecPath());
// Dump things out
// This is debugging output...
@@ -395,8 +395,7 @@ void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newD
}
qDeleteAll(m_versions);
m_versions.clear();
foreach(QtVersion *version, newVersions)
m_versions.append(new QtVersion(*version));
m_versions = newVersions;
if (versionPathsChanged)
updateDocumentation();
updateUniqueIdToIndexMap();
@@ -416,8 +415,6 @@ void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newD
writeVersionsIntoSettings();
}
///
/// QtVersion
///
+1
View File
@@ -121,6 +121,7 @@ void BaseFileFind::displayResult(int index) {
void BaseFileFind::searchFinished()
{
m_resultWindow->finishSearch();
m_isSearching = false;
m_resultLabel = 0;
emit changed();
@@ -1990,6 +1990,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
if (d->m_visibleWrapColumn > 0) {
lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4;
if (lineX < viewportRect.width())
painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()),
d->m_ifdefedOutFormat.background());
}
+3 -3
View File
@@ -603,7 +603,7 @@ void Lexer::scan_helper(Token *tok)
do {
yyinp();
if (! (isalnum(_yychar) || _yychar == '_'))
if (! (isalnum(_yychar) || _yychar == '_' || _yychar == '$'))
break;
} while (_yychar);
@@ -674,9 +674,9 @@ void Lexer::scan_helper(Token *tok)
if (control())
tok->string = control()->findOrInsertStringLiteral(yytext, yylen);
} else if (std::isalpha(ch) || ch == '_') {
} else if (std::isalpha(ch) || ch == '_' || ch == '$') {
const char *yytext = _currentChar - 1;
while (std::isalnum(_yychar) || _yychar == '_')
while (std::isalnum(_yychar) || _yychar == '_' || _yychar == '$')
yyinp();
int yylen = _currentChar - yytext;
if (f._scanKeywords)
+8
View File
@@ -1200,6 +1200,14 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, bool stopAtCppInitializer)
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;
while (LA() == T___ATTRIBUTE__) {
parseAttributeSpecifier(*spec_ptr);
+6 -6
View File
@@ -230,14 +230,14 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *,
return false;
}
HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *parent)
HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *central, QWidget *parent)
: QWebView(parent)
, helpEngine(engine)
, parentWidget(parent)
, parentWidget(central)
, multiTabsAllowed(true)
, loadFinished(false)
{
setPage(new HelpPage(parent, helpEngine, this));
setPage(new HelpPage(central, helpEngine, this));
settings()->setAttribute(QWebSettings::PluginsEnabled, false);
settings()->setAttribute(QWebSettings::JavaEnabled, false);
@@ -245,7 +245,7 @@ HelpViewer::HelpViewer(QHelpEngine *engine, Help::Internal::CentralWidget *paren
QAction* action = pageAction(QWebPage::OpenLinkInNewWindow);
action->setText(tr("Open Link in New Tab"));
if (!parent) {
if (!central) {
multiTabsAllowed = false;
action->setVisible(false);
}
@@ -378,13 +378,13 @@ void HelpViewer::setLoadFinished(bool ok)
#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)
, zoomCount(0)
, controlPressed(false)
, lastAnchor(QString())
, helpEngine(engine)
, parentWidget(parent)
, parentWidget(central)
{
document()->setDocumentMargin(8);
}
+2 -2
View File
@@ -64,7 +64,7 @@ class HelpViewer : public QWebView
Q_OBJECT
public:
HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *parent);
HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *central, QWidget *parent);
void setSource(const QUrl &url);
inline QUrl source() const
@@ -130,7 +130,7 @@ class HelpViewer : public QTextBrowser
Q_OBJECT
public:
HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *parent);
HelpViewer(QHelpEngine *helpEngine, Help::Internal::CentralWidget *central, QWidget *parent);
void setSource(const QUrl &url);
void zoomIn(int range = 1);
+260 -158
View File
@@ -170,6 +170,8 @@ private slots:
void dump_misc();
void dump_std_list();
void dump_std_vector();
void dump_std_string();
void dump_std_wstring();
void dump_Foo();
void dump_QByteArray();
void dump_QChar();
@@ -182,6 +184,7 @@ private slots:
void dump_QList_QString();
void dump_QList_QString3();
void dump_QList_Int3();
void dump_QMap_QString_QString();
void dump_QPoint();
void dump_QRect();
void dump_QSharedPointer();
@@ -748,9 +751,9 @@ void tst_Gdb::dump_Foo()
{
prepare("dump_Foo");
next();
run("B","{iname='local.f',addr='-',name='f',type='Foo',"
run("B","{iname='local.f',name='f',type='Foo',"
"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=["
"{iname='local.f.a',name='a',type='int',value='0',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");
next();
// 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'}", "");
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',"
"children=[{value='88 'X''},{value='89 'Y''},{value='90 'Z''},"
"{value='0 '\\\\000''}]}",
@@ -793,9 +796,9 @@ void tst_Gdb::dump_array()
prepare("dump_array_int");
next();
// 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'}", "");
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',"
"children=[{value='1'},{value='2'},{value='3'}]}",
"local.s");
@@ -815,9 +818,9 @@ void tst_Gdb::dump_misc()
{
prepare("dump_misc");
next();
run("B","{iname='local.s',addr='-',name='s',type='int *',"
run("B","{iname='local.s',name='s',type='int *',"
"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.*',"
"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)
{
QByteArray address = ptrToBa(&m);
QByteArray expected = QByteArray("tiname='iname',addr='%',"
QByteArray expected = QByteArray("tiname='iname',"
"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='%'}")
<< address
<< N(m.rowCount())
@@ -1025,7 +1028,7 @@ void tst_Gdb::dump_QAbstractItemModelHelper(QAbstractItemModel &m)
for (int column = 0; column < m.columnCount(); ++column) {
QModelIndex mi = m.index(row, column);
expected.append(QByteArray(",{name='[%,%]',value='%',"
"valueencoded='2',numchild='1',addr='$%,%,%,%',"
"valueencoded='2',numchild='1',%,%,%',"
"type='"NS"QAbstractItem'}")
<< N(row)
<< N(column)
@@ -1089,27 +1092,27 @@ void tst_Gdb::dump_QByteArray()
{
prepare("dump_QByteArray");
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'}");
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'}");
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'}");
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'}");
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"
"616161616161616161616161616161616161616161616161616161616161"
"616161616161616161616161616161616161616161616161616161616161"
"6161616161616161616161616161616161616161616161',numchild='101'}");
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'}");
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',"
"childtype='char',childnumchild='0',"
"children=[{value='97 'a''},{value='98 'b''},"
@@ -1135,27 +1138,27 @@ void tst_Gdb::dump_QChar()
next();
// 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'}");
next();
// 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'}");
next();
// 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'}");
next();
// 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'}");
next();
// 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'}");
}
@@ -2242,28 +2245,28 @@ void tst_Gdb::dump_std_list()
{
prepare("dump_std_list");
if (checkUninitialized)
run("A","{iname='local.list',addr='-',name='list',"
run("A","{iname='local.list',name='list',"
"numchild='0'}");
next();
run("B", "{iname='local.list',addr='-',name='list',"
run("B", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >',"
"value='<0 items>',numchild='0',children=[]}",
"local.list");
next();
run("C", "{iname='local.list',addr='-',name='list',"
run("C", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >',"
"value='<1 items>',numchild='1',"
"childtype='int',childnumchild='0',children=[{value='45'}]}",
"local.list");
next();
run("D", "{iname='local.list',addr='-',name='list',"
run("D", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >',"
"value='<2 items>',numchild='2',"
"childtype='int',childnumchild='0',children=["
"{value='45'},{value='46'}]}",
"local.list");
next();
run("E", "{iname='local.list',addr='-',name='list',"
run("E", "{iname='local.list',name='list',"
"type='std::list<int, std::allocator<int> >',"
"value='<3 items>',numchild='3',"
"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> //////////////////////////////
void dump_std_vector()
@@ -2291,19 +2346,19 @@ void tst_Gdb::dump_std_vector()
prepare("dump_std_vector");
if (checkUninitialized)
run("A","{iname='local.vector',addr='-',name='vector',"
run("A","{iname='local.vector',name='vector',"
"numchild='0'}");
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'},"
"{iname='local.list',addr='-',name='list',type='"LIST"',"
"{iname='local.list',name='list',type='"LIST"',"
"value='<0 items>',numchild='0'}");
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" *',"
"childnumchild='1',children=[{type='"LIST"',value='<2 items>',"
"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'}",
"local.vector,local.vector.0");
}
@@ -2354,13 +2409,13 @@ void tst_Gdb::dump_QHash_int_int()
prepare("dump_QHash_int_int");
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>',"
"numchild='0'}");
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',"
"childtype='int',childnumchild='0',children=["
"{name='43',value='44'},"
@@ -2382,29 +2437,29 @@ void tst_Gdb::dump_QHash_QString_QString()
{
prepare("dump_QHash_QString_QString");
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>',"
"numchild='0'}");
next();
//run("B","{iname='local.h',addr='-',name='h',"
// "type='"NS"QHash<"NS"QString, "NS"QString>',value='<0 items>',"
// "numchild='0'}");
run("B","{iname='local.h',name='h',"
"type='"NS"QHash<"NS"QString, "NS"QString>',value='<0 items>',"
"numchild='0'}");
next();
next();
//run("D","{iname='local.h',addr='-',name='h',"
// "type='"NS"QHash<"NS"QString, "NS"QString>',value='<2 items>',"
// "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>',"
"numchild='2'}");
run("D","{iname='local.h',name='h',"
"type='"NS"QHash<"NS"QString, "NS"QString>',value='<2 items>',"
"numchild='2',childtype='"NS"QHashNode<"NS"QString, "NS"QString>',"
"children=["
"{value=' ',numchild='2',children=[{name='key',valueencoded='7',"
"value='66006f006f00',numchild='0'},"
"{name='value',valueencoded='7',"
"value='620061007200',numchild='0'}]},"
"{value=' ',numchild='2',children=[{name='key',valueencoded='7',"
"value='680065006c006c006f00',numchild='0'},"
"{name='value',valueencoded='7',"
"{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");
@@ -2425,22 +2480,22 @@ void tst_Gdb::dump_QList_int()
{
prepare("dump_QList_int");
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'}");
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'}");
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'}");
run("C","{iname='local.list',addr='-',name='list',"
run("C","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<1 items>',numchild='1',"
"childtype='int',childnumchild='0',children=["
"{value='1'}]}", "local.list");
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'}");
run("D","{iname='local.list',addr='-',name='list',"
run("D","{iname='local.list',name='list',"
"type='"NS"QList<int>',value='<2 items>',numchild='2',"
"childtype='int',childnumchild='0',children=["
"{value='1'},{value='2'}]}", "local.list");
@@ -2462,13 +2517,13 @@ void tst_Gdb::dump_QList_int_star()
{
prepare("dump_QList_int_star");
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'}");
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',"
"childtype='int',childnumchild='0',children=["
"{value='1'},{value='<null>',type='int *'},{value='2'}]}", "local.list");
@@ -2488,15 +2543,15 @@ void tst_Gdb::dump_QList_char()
{
prepare("dump_QList_char");
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'}");
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'}");
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'}");
run("C","{iname='local.list',addr='-',name='list',"
run("C","{iname='local.list',name='list',"
"type='"NS"QList<char>',value='<1 items>',numchild='1',"
"childtype='char',childnumchild='0',children=["
"{value='97 'a''}]}", "local.list");
@@ -2518,21 +2573,21 @@ void tst_Gdb::dump_QList_char_star()
{
prepare("dump_QList_char_star");
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'}");
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'}");
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'}");
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',"
"childtype='const char *',childnumchild='1',children=["
"{valueencoded='6',value='61',numchild='0'}]}", "local.list");
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',"
"childtype='const char *',childnumchild='1',children=["
"{valueencoded='6',value='61',numchild='0'},"
@@ -2554,15 +2609,15 @@ void tst_Gdb::dump_QList_QString()
{
prepare("dump_QList_QString");
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'}");
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'}");
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'}");
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',"
"childtype='"NS"QString',childnumchild='0',children=["
"{valueencoded='7',value='480061006c006c006f00'}]}", "local.list");
@@ -2582,19 +2637,19 @@ void tst_Gdb::dump_QList_QString3()
{
prepare("dump_QList_QString3");
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'}");
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'}");
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'}");
run("C","{iname='local.list',addr='-',name='list',"
run("C","{iname='local.list',name='list',"
"type='"NS"QList<QString3>',value='<1 items>',numchild='1',"
"childtype='QString3',children=["
"{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',"
"childtype='QString3',children=[{value='{...}',numchild='3',children=["
"{iname='local.list.0.s1',name='s1',type='"NS"QString',"
@@ -2620,19 +2675,19 @@ void tst_Gdb::dump_QList_Int3()
{
prepare("dump_QList_Int3");
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'}");
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'}");
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'}");
run("C","{iname='local.list',addr='-',name='list',"
run("C","{iname='local.list',name='list',"
"type='"NS"QList<Int3>',value='<1 items>',numchild='1',"
"childtype='Int3',children=[{value='{...}',numchild='3'}]}",
"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',"
"childtype='Int3',children=[{value='{...}',numchild='3',children=["
"{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 /////////////////////////////////
void dump_QPoint()
@@ -2655,10 +2753,10 @@ void tst_Gdb::dump_QPoint()
prepare("dump_QPoint");
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',"
"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',"
"children=[{name='x',value='45'},{name='y',value='46'}]}",
"local.p,local.f");
@@ -2679,11 +2777,11 @@ void tst_Gdb::dump_QRect()
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',"
"children=[{name='x1',value='43'},{name='y1',value='44'},"
"{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',"
"children=[{name='x',value='45'},{name='y',value='46'},"
"{name='w',value='100'},{name='h',value='200'}]}",
@@ -2724,65 +2822,65 @@ void tst_Gdb::dump_QSharedPointer()
#if QT_VERSION >= 0x040500
prepare("dump_QSharedPointer");
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'},"
"{iname='local.simplePtr2',addr='-',name='simplePtr2',"
"{iname='local.simplePtr2',name='simplePtr2',"
"'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'},"
"{iname='local.simplePtr4',addr='-',name='simplePtr3',"
"{iname='local.simplePtr4',name='simplePtr3',"
"'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'},"
"{iname='local.compositePtr2',addr='-',name='compositePtr2',"
"{iname='local.compositePtr2',name='compositePtr2',"
"'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'},"
"{iname='local.compositePtr4',addr='-',name='compositePtr4',"
"{iname='local.compositePtr4',name='compositePtr4',"
"'type='"NS"QWeakPointer<int>',value='<not in scope>',numchild='0'}");
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'},"
"{iname='local.simplePtr2',addr='-',name='simplePtr2',"
"{iname='local.simplePtr2',name='simplePtr2',"
"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'},"
"{iname='local.simplePtr4',addr='-',name='simplePtr4',"
"{iname='local.simplePtr4',name='simplePtr4',"
"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'},"
"{iname='local.compositePtr2',addr='-',name='compositePtr2',"
"{iname='local.compositePtr2',name='compositePtr2',"
"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'},"
"{iname='local.compositePtr4',addr='-',name='compositePtr4',"
"{iname='local.compositePtr4',name='compositePtr4',"
"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'},"
"{iname='local.simplePtr2',addr='-',name='simplePtr2',"
"{iname='local.simplePtr2',name='simplePtr2',"
"type='"NS"QSharedPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',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=["
"{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',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=["
"{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',value='3',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'},"
"{iname='local.compositePtr2',addr='-',name='compositePtr2',"
"{iname='local.compositePtr2',name='compositePtr2',"
"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'},"
"{iname='local.compositePtr4',addr='-',name='compositePtr4',"
"{iname='local.compositePtr4',name='compositePtr4',"
"type='"NS"QWeakPointer<"NS"QString>',value='',numchild='3'}",
"local.simplePtr,local.simplePtr2,local.simplePtr3,local.simplePtr4,"
"local.compositePtr,local.compositePtr,local.compositePtr,"
@@ -2804,10 +2902,10 @@ void tst_Gdb::dump_QSize()
{
prepare("dump_QSize");
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',"
"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',"
"children=[{name='w',value='45'},{name='h',value='46'}]}",
"local.p,local.f");
@@ -2828,24 +2926,24 @@ void tst_Gdb::dump_QStack()
{
prepare("dump_QStack");
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'}");
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'}");
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");
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'}");
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',"
"childnumchild='0',children=[{value='3'}]}", // rounding...
"local.v");
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'}");
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',"
"childnumchild='0',children=[{value='3'},{value='2'}]}",
"local.v");
@@ -2866,19 +2964,19 @@ void tst_Gdb::dump_QString()
{
prepare("dump_QString");
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'}");
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");
// 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);
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=["
"{iname='local.s.d',name='d',type='"NS"QString::Data *',"
"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',"
"children=[{iname='local.s.d',name='d',"
"type='"NS"QString::Data *',value='-',numchild='1',"
@@ -2886,10 +2984,10 @@ void tst_Gdb::dump_QString()
"type='"NS"QString::Data',value='{...}',numchild='11'}]}]}",
"local.s,local.s.d", 0);
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'}");
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'}");
}
@@ -2908,25 +3006,25 @@ void tst_Gdb::dump_QStringList()
{
prepare("dump_QStringList");
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'}");
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'}");
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");
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'}");
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',"
"childnumchild='0',children=[{valueencoded='7',"
"value='680065006c006c006f00'}]}",
"local.s");
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'}");
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',"
"childnumchild='0',children=["
"{valueencoded='7',value='680065006c006c006f00'},"
@@ -2949,24 +3047,24 @@ void tst_Gdb::dump_QVector()
{
prepare("dump_QVector");
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'}");
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'}");
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");
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'}");
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',"
"childnumchild='0',children=[{value='-'}]}", // rounding...
"local.v");
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'}");
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',"
"childnumchild='0',children=[{value='-'},{value='-'}]}",
"local.v");
@@ -3034,7 +3132,7 @@ void 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");
if (checkUninitialized) /*<not in scope>*/
run("A","{"PRE"'value=<not in scope>',numchild='0'}");
@@ -3220,13 +3318,13 @@ void tst_Gdb::dump_QWeakPointer_11()
// Case 1.1: Null pointer.
prepare("dump_QWeakPointer_11");
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'}");
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'},"
"{iname='local.wp',addr='-',name='wp',"
"{iname='local.wp',name='wp',"
"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.
prepare("dump_QWeakPointer_12");
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'}");
next();
next();
run("B","{iname='local.sp',addr='-',name='sp',"
run("B","{iname='local.sp',name='sp',"
"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'}");
run("B","{iname='local.sp',addr='-',name='sp',"
run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',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=["
"{name='data',type='int',value='99',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.
prepare("dump_QWeakPointer_13");
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'}");
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'},"
"{iname='local.wp',addr='-',name='wp',"
"{iname='local.wp',name='wp',"
"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'}");
run("B","{iname='local.sp',addr='-',name='sp',"
run("B","{iname='local.sp',name='sp',"
"type='"NS"QSharedPointer<int>',value='',numchild='3',children=["
"{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',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=["
"{name='data',type='int',value='99',numchild='0'},"
"{name='weakref',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'}",
"local.sp,local.wp");
}
@@ -3320,17 +3418,17 @@ void tst_Gdb::dump_QWeakPointer_2()
// Case 2: Composite type.
prepare("dump_QWeakPointer_2");
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'}");
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=["
"{name='data',type='"NS"QString',"
"valueencoded='7',value='5400650073007400',numchild='0'},"
"{name='weakref',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=["
"{name='data',type='"NS"QString',"
"valueencoded='7',value='5400650073007400',numchild='0'},"
@@ -3368,11 +3466,14 @@ int main(int argc, char *argv[])
dump_array_int();
dump_std_list();
dump_std_vector();
dump_std_string();
dump_std_wstring();
dump_Foo();
dump_misc();
dump_QByteArray();
dump_QChar();
dump_QHash_int_int();
dump_QHash_QString_QString();
dump_QList_char();
dump_QList_char_star();
dump_QList_int();
@@ -3380,6 +3481,7 @@ int main(int argc, char *argv[])
dump_QList_Int3();
dump_QList_QString();
dump_QList_QString3();
dump_QMap_QString_QString();
dump_QPoint();
dump_QRect();
dump_QSharedPointer();
+6
View File
@@ -157,6 +157,12 @@ public:
void testArray()
{
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];
c[0] = 'a';
c[1] = 'b';