Commit bcdad219 authored by dt's avatar dt

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents 00951b6b d4de7d47
......@@ -988,13 +988,16 @@ void CppModelManager::parse(QFutureInterface<void> &future,
Core::MimeType cSourceTy = db->findByType(QLatin1String("text/x-csrc"));
Core::MimeType cppSourceTy = db->findByType(QLatin1String("text/x-c++src"));
Core::MimeType cHeaderTy = db->findByType(QLatin1String("text/x-hdr"));
Core::MimeType cppHeaderTy = db->findByType(QLatin1String("text/x-c++hdr"));
foreach (const QString &file, files) {
const QFileInfo fileInfo(file);
if (cSourceTy.matchesFile(fileInfo) || cppSourceTy.matchesFile(fileInfo))
sources.append(file);
else
else if (cHeaderTy.matchesFile(fileInfo) || cppHeaderTy.matchesFile(fileInfo))
headers.append(file);
}
......
......@@ -296,6 +296,8 @@ void DebuggerManager::init()
this, SLOT(watchExpression(QString)));
connect(localsView, SIGNAL(settingsDialogRequested()),
this, SIGNAL(settingsDialogRequested()));
connect(localsView, SIGNAL(requestRecheckCustomDumperAvailability()),
this, SLOT(recheckCustomDumperAvailability()));
// Watchers
QTreeView *watchersView = qobject_cast<QTreeView *>(m_watchersWindow);
......@@ -316,6 +318,8 @@ void DebuggerManager::init()
this, SIGNAL(setSessionValueRequested(QString,QVariant)));
connect(watchersView, SIGNAL(settingsDialogRequested()),
this, SIGNAL(settingsDialogRequested()));
connect(watchersView, SIGNAL(requestRecheckCustomDumperAvailability()),
this, SLOT(recheckCustomDumperAvailability()));
// Tooltip
QTreeView *tooltipView = qobject_cast<QTreeView *>(m_tooltipWindow);
......@@ -791,18 +795,6 @@ QVariant DebuggerManager::sessionValue(const QString &name)
return value;
}
void DebuggerManager::querySessionValue(const QString &name, QVariant *value)
{
// this is answered by the plugin
emit sessionValueRequested(name, value);
}
void DebuggerManager::setSessionValue(const QString &name, const QVariant &value)
{
// this is answered by the plugin
emit setSessionValueRequested(name, value);
}
QVariant DebuggerManager::configValue(const QString &name)
{
// this is answered by the plugin
......@@ -993,13 +985,13 @@ bool DebuggerManager::startNewDebugger(DebuggerStartMode mode)
qDebug() << m_executable << type;
setDebuggerType(type);
setBusyCursor(false);
setStatus(DebuggerProcessStartingUp);
if (!m_engine->startDebugger()) {
setStatus(DebuggerProcessNotReady);
return false;
}
m_busy = false;
return true;
}
......@@ -1199,6 +1191,18 @@ void DebuggerManager::breakAtMain()
#endif
}
static bool isAllowedTransition(int from, int to)
{
return (from == -1)
|| (from == DebuggerProcessNotReady && to == DebuggerProcessStartingUp)
|| (from == DebuggerProcessStartingUp && to == DebuggerInferiorStopped)
|| (from == DebuggerInferiorStopped && to == DebuggerInferiorRunningRequested)
|| (from == DebuggerInferiorRunningRequested && to == DebuggerInferiorRunning)
|| (from == DebuggerInferiorRunning && to == DebuggerInferiorStopRequested)
|| (from == DebuggerInferiorStopRequested && to == DebuggerInferiorStopped)
|| (to == DebuggerProcessNotReady);
}
void DebuggerManager::setStatus(int status)
{
if (Debugger::Constants::Internal::debug)
......@@ -1207,6 +1211,10 @@ void DebuggerManager::setStatus(int status)
if (status == m_status)
return;
if (!isAllowedTransition(m_status, status))
qDebug() << "UNEXPECTED TRANSITION: " << m_status << status;
m_status = status;
const bool started = status == DebuggerInferiorRunning
......@@ -1255,9 +1263,9 @@ void DebuggerManager::setStatus(int status)
void DebuggerManager::setBusyCursor(bool busy)
{
//qDebug() << "BUSY FROM: " << m_busy << " TO: " << m_busy;
if (busy == m_busy)
return;
//qDebug() << "BUSY: " << busy;
m_busy = busy;
QCursor cursor(busy ? Qt::BusyCursor : Qt::ArrowCursor);
......@@ -1413,6 +1421,16 @@ void DebuggerManager::fileOpen(const QString &fileName)
}
//////////////////////////////////////////////////////////////////////
//
// Watch specific stuff
//
//////////////////////////////////////////////////////////////////////
void DebuggerManager::recheckCustomDumperAvailability()
{
m_engine->recheckCustomDumperAvailability();
}
//////////////////////////////////////////////////////////////////////
//
......
......@@ -237,8 +237,6 @@ public slots:
void setBusyCursor(bool on);
void queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **ed);
void querySessionValue(const QString &name, QVariant *value);
void setSessionValue(const QString &name, const QVariant &value);
QVariant configValue(const QString &name);
void queryConfigValue(const QString &name, QVariant *value);
void setConfigValue(const QString &name, const QVariant &value);
......@@ -311,6 +309,7 @@ private slots:
void setStatus(int status);
void clearStatusMessage();
void attemptBreakpointSynchronization();
void recheckCustomDumperAvailability();
private:
//
......
......@@ -395,10 +395,10 @@ void DebuggerPlugin::shutdown()
m_manager = 0;
}
bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_message)
bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments);
Q_UNUSED(error_message);
Q_UNUSED(errorMessage);
m_manager = new DebuggerManager;
......
......@@ -112,8 +112,7 @@ enum GdbCommandType
GdbInfoShared,
GdbInfoProc,
GdbInfoThreads,
GdbQueryDataDumper1,
GdbQueryDataDumper2,
GdbQueryDataDumper,
GdbTemporaryContinue,
GdbTargetCore,
......@@ -799,11 +798,8 @@ void GdbEngine::handleResult(const GdbResultRecord & record, int type,
case GdbInfoShared:
handleInfoShared(record);
break;
case GdbQueryDataDumper1:
handleQueryDataDumper1(record);
break;
case GdbQueryDataDumper2:
handleQueryDataDumper2(record);
case GdbQueryDataDumper:
handleQueryDataDumper(record);
break;
case GdbTemporaryContinue:
continueInferior();
......@@ -1570,7 +1566,7 @@ bool GdbEngine::startDebugger()
gdbArgs.prepend(QLatin1String("mi"));
gdbArgs.prepend(QLatin1String("-i"));
if (q->startMode() == AttachCore) {
if (q->startMode() == AttachCore || q->startMode() == AttachExternal) {
// nothing to do
} else if (q->m_useTerminal) {
m_stubProc.stop(); // We leave the console open, so recycle it now.
......@@ -1778,6 +1774,7 @@ void GdbEngine::handleAttach()
handleAqcuiredInferior();
q->resetLocation();
recheckCustomDumperAvailability();
//
// Stack
......@@ -3520,14 +3517,9 @@ void GdbEngine::updateWatchModel2()
}
}
void GdbEngine::handleQueryDataDumper1(const GdbResultRecord &record)
{
Q_UNUSED(record);
}
void GdbEngine::handleQueryDataDumper2(const GdbResultRecord &record)
void GdbEngine::handleQueryDataDumper(const GdbResultRecord &record)
{
//qDebug() << "DATA DUMPER TRIAL:" << record.toString();
qDebug() << "DATA DUMPER TRIAL:" << record.toString();
GdbMi output = record.data.findChild("consolestreamoutput");
QByteArray out = output.data();
out = out.mid(out.indexOf('"') + 2); // + 1 is success marker
......@@ -3568,6 +3560,8 @@ void GdbEngine::handleQueryDataDumper2(const GdbResultRecord &record)
);
} else {
m_dataDumperState = DataDumperAvailable;
q->showStatusMessage(tr("%1 custom dumpers found")
.arg(m_availableSimpleDumpers.size()));
}
//qDebug() << "DATA DUMPERS AVAILABLE" << m_availableSimpleDumpers;
}
......@@ -4274,9 +4268,8 @@ void GdbEngine::tryLoadCustomDumpers()
if (m_dataDumperState == DataDumperLoadTried) {
// retreive list of dumpable classes
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)",
GdbQueryDataDumper1);
sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper2);
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)");
sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper);
} else {
debugMessage(QString("DEBUG HELPER LIBRARY IS NOT USABLE: "
" %1 EXISTS: %2, EXECUTABLE: %3").arg(lib)
......@@ -4285,6 +4278,12 @@ void GdbEngine::tryLoadCustomDumpers()
}
}
void GdbEngine::recheckCustomDumperAvailability()
{
// retreive list of dumpable classes
sendCommand("call qDumpObjectData440(1,%1+1,0,0,0,0,0,0)");
sendCommand("p (char*)qDumpOutBuffer", GdbQueryDataDumper);
}
IDebuggerEngine *createGdbEngine(DebuggerManager *parent)
{
......
......@@ -304,6 +304,7 @@ private:
void maybeHandleInferiorPidChanged(const QString &pid);
void tryLoadCustomDumpers();
Q_SLOT void recheckCustomDumperAvailability();
void runCustomDumper(const WatchData &data, bool dumpChildren);
void runDirectDumper(const WatchData &data, bool dumpChildren);
bool isCustomValueDumperAvailable(const QString &type) const;
......@@ -317,8 +318,7 @@ private:
const WatchData &cookie);
void handleToolTip(const GdbResultRecord &record,
const QString &cookie);
void handleQueryDataDumper1(const GdbResultRecord &record);
void handleQueryDataDumper2(const GdbResultRecord &record);
void handleQueryDataDumper(const GdbResultRecord &record);
void handleDumpCustomValue1(const GdbResultRecord &record,
const WatchData &cookie);
void handleDumpCustomValue2(const GdbResultRecord &record,
......
......@@ -83,6 +83,7 @@ public:
virtual void reloadRegisters() = 0;
virtual void setDebugDumpers(bool on) = 0;
virtual void setUseCustomDumpers(bool on) = 0;
virtual void recheckCustomDumperAvailability() = 0;
virtual void reloadSourceFiles() = 0;
};
......
......@@ -99,6 +99,7 @@ private:
void setDebugDumpers(bool) {}
void setUseCustomDumpers(bool) {}
void recheckCustomDumperAvailability() {}
void assignValueInDebugger(const QString &expr, const QString &value);
void executeDebuggerCommand(const QString & command);
......
......@@ -105,6 +105,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *act3 = 0;
QAction *act4 = 0;
QAction *act5 = new QAction("Debugger properties...", &menu);
QAction *act6 = new QAction("Re-check availability of custom dumpers", &menu);
menu.addAction(act1);
menu.addAction(act2);
......@@ -130,6 +131,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
// FIXME: menu.addAction(act4);
}
menu.addSeparator();
menu.addAction(act6);
menu.addAction(act5);
QAction *act = menu.exec(ev->globalPos());
......@@ -149,6 +151,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
model()->setData(mi0, !visual, VisualRole);
else if (act == act5)
emit settingsDialogRequested();
else if (act == act6)
emit requestRecheckCustomDumperAvailability();
}
void WatchWindow::resizeColumnsToContents()
......
......@@ -63,6 +63,7 @@ signals:
void requestAssignValue(const QString &exp, const QString &value);
void requestExpandChildren(const QModelIndex &idx);
void requestCollapseChildren(const QModelIndex &idx);
void requestRecheckCustomDumperAvailability();
void settingsDialogRequested();
private slots:
......
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="text/x-generic-project">
<sub-class-of type="text/plain"/>
<comment>Generic Qt Creator Project file</comment>
<glob pattern="*.creator"/>
</mime-type>
<mime-type type="application/vnd.nokia.qt.generic.files">
<sub-class-of type="text/plain"/>
<comment>Generic Project Files</comment>
<glob pattern="*.files"/>
</mime-type>
<mime-type type="application/vnd.nokia.qt.generic.includes">
<sub-class-of type="text/plain"/>
<comment>Generic Project Include Paths</comment>
<glob pattern="*.includes"/>
</mime-type>
<mime-type type="application/vnd.nokia.qt.generic.config">
<sub-class-of type="text/plain"/>
<comment>Generic Project Configuration File</comment>
<glob pattern="*.config"/>
</mime-type>
</mime-info>
<plugin name="GenericProjectManager" version="1.0.80" compatVersion="1.0.80">
<vendor>Nokia Corporation</vendor>
<copyright>(C) 2008-2009 Nokia Corporation</copyright>
<license>
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this plugin in
accordance with the Qt Commercial License Agreement provided with the
Software or, alternatively, in accordance with the terms contained in
a written agreement between you and Nokia.
GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser
General Public License version 2.1 as published by the Free Software
Foundation. Please review the following information to
ensure the GNU Lesser General Public License version 2.1 requirements
will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
<description>Generic support</description>
<url>http://www.qtsoftware.com</url>
<dependencyList>
<dependency name="TextEditor" version="1.0.80"/>
<dependency name="ProjectExplorer" version="1.0.80"/>
<dependency name="CppTools" version="1.0.80"/>
<dependency name="CppEditor" version="1.0.80"/>
<dependency name="Help" version="1.0.80"/>
</dependencyList>
</plugin>
This diff is collapsed.
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef GENERICPROJECT_H
#define GENERICPROJECT_H
#include "genericprojectmanager.h"
#include "genericprojectnodes.h"
#include "makestep.h"
#include <projectexplorer/project.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/toolchain.h>
#include <coreplugin/ifile.h>
#include <utils/pathchooser.h>
QT_BEGIN_NAMESPACE
class QPushButton;
class QStringListModel;
QT_END_NAMESPACE
namespace GenericProjectManager {
namespace Internal{
class GenericProjectFile;
class GenericProject : public ProjectExplorer::Project
{
Q_OBJECT
public:
GenericProject(Manager *manager, const QString &filename);
virtual ~GenericProject();
QString filesFileName() const;
QString includesFileName() const;
QString configFileName() const;
virtual QString name() const;
virtual Core::IFile *file() const;
virtual ProjectExplorer::IProjectManager *projectManager() const;
virtual QList<ProjectExplorer::Project *> dependsOn();
virtual bool isApplication() const;
virtual ProjectExplorer::Environment environment(const QString &buildConfiguration) const;
virtual QString buildDirectory(const QString &buildConfiguration) const;
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual QList<ProjectExplorer::BuildStepConfigWidget*> subConfigWidgets();
virtual void newBuildConfiguration(const QString &buildConfiguration);
virtual GenericProjectNode *rootProjectNode() const;
virtual QStringList files(FilesMode fileMode) const;
QStringList targets() const;
MakeStep *makeStep() const;
QString buildParser(const QString &buildConfiguration) const;
QStringList convertToAbsoluteFiles(const QStringList &paths) const;
QStringList includePaths() const;
void setIncludePaths(const QStringList &includePaths);
QByteArray defines() const;
QStringList allIncludePaths() const;
QStringList projectIncludePaths() const;
QStringList files() const;
QStringList generated() const;
QString toolChainId() const;
public Q_SLOTS:
void setToolChainId(const QString &toolChainId);
void refresh();
protected:
virtual void saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer);
virtual void restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader);
private:
void parseProject();
QStringList readLines(const QString &absoluteFileName) const;
Manager *_manager;
QString _fileName;
QString _filesFileName;
QString _includesFileName;
QString _configFileName;
GenericProjectFile *_file;
QString _projectName;
QStringList _files;
QStringList _generated;
QStringList _includePaths;
QStringList _projectIncludePaths;
QByteArray _defines;
GenericProjectNode* _rootNode;
ProjectExplorer::ToolChain *_toolChain;
QString _toolChainId;
};
class GenericProjectFile : public Core::IFile
{
Q_OBJECT
public:
GenericProjectFile(GenericProject *parent, QString fileName);
virtual ~GenericProjectFile();
virtual bool save(const QString &fileName = QString());
virtual QString fileName() const;
virtual QString defaultPath() const;
virtual QString suggestedFileName() const;
virtual QString mimeType() const;
virtual bool isModified() const;
virtual bool isReadOnly() const;
virtual bool isSaveAsAllowed() const;
virtual void modified(ReloadBehavior *behavior);
private:
GenericProject *_project;
QString _fileName;
};
class GenericBuildSettingsWidget : public ProjectExplorer::BuildStepConfigWidget
{
Q_OBJECT
public:
GenericBuildSettingsWidget(GenericProject *project);
virtual ~GenericBuildSettingsWidget();
virtual QString displayName() const;
virtual void init(const QString &buildConfiguration);
private Q_SLOTS:
void buildDirectoryChanged();
private:
GenericProject *_project;
Core::Utils::PathChooser *_pathChooser;
QString _buildConfiguration;
};
} // namespace Internal
} // namespace GenericProjectManager
#endif // GENERICPROJECT_H
<RCC>
<qresource prefix="/genericproject" >
<file>GenericProject.mimetypes.xml</file>
</qresource>
</RCC>
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
**************************************************************************/
#ifndef GENERICPROJECTCONSTANTS_H
#define GENERICPROJECTCONSTANTS_H
namespace GenericProjectManager {
namespace Constants {
const char *const PROJECTCONTEXT = "GenericProject.ProjectContext";
const char *const GENERICMIMETYPE = "text/x-generic-project"; // ### FIXME
const char *const MAKESTEP = "GenericProjectManager.MakeStep";
// contexts
const char *const C_FILESEDITOR = ".files Editor";
// kinds
const char *const PROJECT_KIND = "Generic";
const char *const FILES_EDITOR = ".files Editor";
const char *const FILES_MIMETYPE = "application/vnd.nokia.qt.generic.files";
const char *const INCLUDES_EDITOR = ".includes Editor";
const char *const INCLUDES_MIMETYPE = "application/vnd.nokia.qt.generic.includes";
const char *const CONFIG_EDITOR = ".includes Editor";
const char *const CONFIG_MIMETYPE = "application/vnd.nokia.qt.generic.config";
} // namespace Constants
} // namespace GenericProjectManager
#endif // GENERICPROJECTCONSTANTS_H
#include "genericprojectfileseditor.h"
#include "genericprojectmanager.h"
#include "genericprojectconstants.h"
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/fontsettings.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorsettings.h>
using namespace GenericProjectManager;
using namespace GenericProjectManager::Internal;
////////////////////////////////////////////////////////////////////////////////////////
// ProjectFilesFactory
////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesFactory::ProjectFilesFactory(Manager *manager,
TextEditor::TextEditorActionHandler *handler)
: Core::IEditorFactory(manager),
_manager(manager),
_actionHandler(handler)
{
_mimeTypes.append(QLatin1String(Constants::FILES_MIMETYPE));
_mimeTypes.append(QLatin1String(Constants::INCLUDES_MIMETYPE));
_mimeTypes.append(QLatin1String(Constants::CONFIG_MIMETYPE));
}
ProjectFilesFactory::~ProjectFilesFactory()
{
}
Manager *ProjectFilesFactory::manager() const
{
return _manager;