Commit b3e465c9 authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/2.6'

parents 20231b76 fd78ec9f
......@@ -1397,7 +1397,8 @@ def qdump__QStringList(d, value):
d.putNumChild(size)
if d.isExpanded():
innerType = lookupType(d.ns + "QString")
d.putArrayData(innerType, d_ptr["array"], size, 0)
innerTypePP = innerType.pointer().pointer()
d.putArrayData(innerType, d_ptr["array"].cast(innerTypePP) + begin, size, 0)
def qdump__QTemporaryFile(d, value):
......
INCLUDEPATH *= $$PWD/..
LIBS *= -l$$qtLibraryName(Botan)
LIBS += -lBotan # Don't use qtLibraryName. Botan is always built in release mode.
......@@ -35,9 +35,6 @@
#include <Literals.h>
#include <Symbols.h>
#include <QFile>
#include <QDebug>
using namespace CPlusPlus;
OverviewModel::OverviewModel(QObject *parent)
......
......@@ -339,6 +339,16 @@ QWidget *DetailsWidget::widget() const
return d->m_widget;
}
QWidget *DetailsWidget::takeWidget()
{
QWidget *widget = d->m_widget;
d->m_widget = 0;
d->m_grid->removeWidget(widget);
if (widget)
widget->setParent(0);
return widget;
}
void DetailsWidget::setWidget(QWidget *widget)
{
if (d->m_widget == widget)
......
......@@ -72,6 +72,7 @@ public:
void setWidget(QWidget *widget);
QWidget *widget() const;
QWidget *takeWidget();
void setToolWidget(Utils::FadingPanel *widget);
QWidget *toolWidget() const;
......
......@@ -327,6 +327,15 @@ QByteArray ElfReader::readSection(const QByteArray &name)
return QByteArray(mapper.start + section.offset, section.size);
}
static QByteArray cutout(const char *s)
{
QByteArray res(s, 80);
const int pos = res.indexOf('\0');
if (pos != -1)
res.resize(pos - 1);
return res;
}
QByteArray ElfReader::readCoreName(bool *isCore)
{
*isCore = false;
......@@ -345,15 +354,13 @@ QByteArray ElfReader::readCoreName(bool *isCore)
for (int i = 0, n = m_elfData.sectionHeaders.size(); i != n; ++i)
if (m_elfData.sectionHeaders.at(i).type == Elf_SHT_NOTE) {
const ElfSectionHeader &header = m_elfData.sectionHeaders.at(i);
const char *s = mapper.start + header.offset + 0x40;
return QByteArray(s);
return cutout(mapper.start + header.offset + 0x40);
}
for (int i = 0, n = m_elfData.programHeaders.size(); i != n; ++i)
if (m_elfData.programHeaders.at(i).type == Elf_PT_NOTE) {
const ElfProgramHeader &header = m_elfData.programHeaders.at(i);
const char *s = mapper.start + header.offset + 0xec;
return QByteArray(s);
return cutout(mapper.start + header.offset + 0xec);
}
return QByteArray();
......
......@@ -31,6 +31,11 @@
#include "savefile.h"
#include "qtcassert.h"
#include "fileutils.h"
#ifdef Q_OS_WIN
# include <windows.h>
#else
# include <unistd.h>
#endif
namespace Utils {
......@@ -78,6 +83,15 @@ bool SaveFile::commit()
QTC_ASSERT(!m_finalized, return false);
m_finalized = true;
if (!flush()) {
remove();
return false;
}
#ifdef Q_OS_WIN
FlushFileBuffers(handle());
#else
fdatasync(handle());
#endif
close();
if (error() != NoError) {
remove();
......
......@@ -44,6 +44,7 @@
#include <utils/environment.h>
#include <QDir>
#include <QFormLayout>
#include <QLabel>
#include <QVBoxLayout>
......@@ -204,25 +205,8 @@ QList<Abi> AndroidToolChain::detectSupportedAbis() const
AndroidToolChainConfigWidget::AndroidToolChainConfigWidget(AndroidToolChain *tc) :
ToolChainConfigWidget(tc)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QLabel *label = new QLabel;
label->setText(tr("NDK Root: %1").arg(AndroidConfigurations::instance().config().ndkLocation.toUserOutput()));
layout->addWidget(label);
}
void AndroidToolChainConfigWidget::apply()
{
// nothing to do!
}
void AndroidToolChainConfigWidget::discard()
{
// nothing to do!
}
bool AndroidToolChainConfigWidget::isDirty() const
{
return false;
QLabel *label = new QLabel(AndroidConfigurations::instance().config().ndkLocation.toUserOutput());
m_mainLayout->addRow(tr("NDK Root:"), label);
}
// --------------------------------------------------------------------------
......
......@@ -80,9 +80,11 @@ class AndroidToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidg
public:
AndroidToolChainConfigWidget(AndroidToolChain *);
void apply();
void discard();
bool isDirty() const;
private:
void applyImpl() {}
void discardImpl() {}
bool isDirtyImpl() const { return false; }
void makeReadOnlyImpl() {}
};
......
......@@ -327,8 +327,7 @@ static inline bool validMode(DebuggerStartMode sm)
}
// Accessed by RunControlFactory
DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp,
DebuggerEngine *masterEngine, QString *errorMessage)
DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp, QString *errorMessage)
{
#ifdef Q_OS_WIN
CdbOptionsPage *op = CdbOptionsPage::instance();
......@@ -336,80 +335,14 @@ DebuggerEngine *createCdbEngine(const DebuggerStartParameters &sp,
*errorMessage = QLatin1String("Internal error: Invalid start parameters passed for thre CDB engine.");
return 0;
}
return new CdbEngine(sp, masterEngine, op->options());
return new CdbEngine(sp, op->options());
#else
Q_UNUSED(masterEngine)
Q_UNUSED(sp)
#endif
*errorMessage = QString::fromLatin1("Unsupported debug mode");
return 0;
}
bool isCdbEngineEnabled()
{
#ifdef Q_OS_WIN
return CdbOptionsPage::instance() && CdbOptionsPage::instance()->options()->isValid();
#else
return false;
#endif
}
static inline QString msgNoCdbBinaryForToolChain(const Abi &tc)
{
return CdbEngine::tr("There is no CDB binary available for binaries in format '%1'").arg(tc.toString());
}
static inline bool isMsvcFlavor(Abi::OSFlavor osf)
{
return osf == Abi::WindowsMsvc2005Flavor
|| osf == Abi::WindowsMsvc2008Flavor
|| osf == Abi::WindowsMsvc2010Flavor
|| osf == Abi::WindowsMsvc2012Flavor;
}
bool checkCdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck *check)
{
#ifdef Q_OS_WIN
const Abi abi = sp.toolChainAbi;
if (!isCdbEngineEnabled()) {
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine required for %1 is currently disabled.").
arg(abi.toString()));
check->settingsCategory = QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
check->settingsPage = CdbOptionsPage::settingsId();
return false;
}
if (!validMode(sp.startMode)) {
check->errorDetails.push_back(CdbEngine::tr("The CDB engine does not support start mode %1.").arg(sp.startMode));
return false;
}
if (abi.binaryFormat() != Abi::PEFormat || abi.os() != Abi::WindowsOS) {
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine does not support the %1 ABI.").
arg(abi.toString()));
return false;
}
if (sp.startMode == AttachCore && !isMsvcFlavor(abi.osFlavor())) {
check->errorDetails.push_back(CdbEngine::tr("The CDB debug engine cannot debug gdb core files."));
return false;
}
if (sp.debuggerCommand.isEmpty()) {
check->errorDetails.push_back(msgNoCdbBinaryForToolChain(abi));
check->settingsCategory = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
check->settingsPage = QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
return false;
}
return true;
#else
Q_UNUSED(sp);
check->errorDetails.push_back(QString::fromLatin1("Unsupported debug mode"));
return false;
#endif
}
void addCdbOptionPages(QList<Core::IOptionsPage *> *opts)
{
#ifdef Q_OS_WIN
......@@ -426,9 +359,8 @@ static inline Utils::SavedAction *theAssemblerAction()
return debuggerCore()->action(OperateByInstruction);
}
CdbEngine::CdbEngine(const DebuggerStartParameters &sp,
DebuggerEngine *masterEngine, const OptionsPtr &options) :
DebuggerEngine(sp, CppLanguage, masterEngine),
CdbEngine::CdbEngine(const DebuggerStartParameters &sp, const OptionsPtr &options) :
DebuggerEngine(sp),
m_creatorExtPrefix("<qtcreatorcdbext>|"),
m_tokenPrefix("<token>"),
m_options(options),
......
......@@ -79,11 +79,9 @@ public:
typedef void (CdbEngine::*BuiltinCommandHandler)(const CdbBuiltinCommandPtr &);
typedef void (CdbEngine::*ExtensionCommandHandler)(const CdbExtensionCommandPtr &);
explicit CdbEngine(const DebuggerStartParameters &sp,
DebuggerEngine *masterEngine,
const OptionsPtr &options);
CdbEngine(const DebuggerStartParameters &sp, const OptionsPtr &options);
~CdbEngine();
virtual ~CdbEngine();
// Factory function that returns 0 if the debug engine library cannot be found.
virtual bool setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor,
......
......@@ -45,9 +45,8 @@ const char C_CPPDEBUGGER[] = "Gdb Debugger";
const char C_QMLDEBUGGER[] = "Qml/JavaScript Debugger";
// Menu Groups
const char G_START_LOCAL[] = "Debugger.Group.Start.Local";
const char G_MANUAL_REMOTE[] = "Debugger.Group.Manual.Remote";
const char G_AUTOMATIC_REMOTE[] = "Debugger.Group.Automatic.Remote";
const char G_GENERAL[] = "Debugger.Group.General";
const char G_SPECIAL[] = "Debugger.Group.Special";
const char G_START_QML[] = "Debugger.Group.Start.Qml";
// Common actions
......
......@@ -378,7 +378,7 @@ bool StartApplicationDialog::run(QWidget *parent, QSettings *settings, DebuggerS
}
Profile *profile = dialog.d->profileChooser->currentProfile();
fillParameters(sp, profile->id());
fillParameters(sp, profile);
sp->executable = newParameters.localExecutable;
sp->displayName = newParameters.displayName();
......@@ -432,7 +432,6 @@ void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
class AttachToQmlPortDialogPrivate
{
public:
QLineEdit *hostLineEdit;
QSpinBox *portSpinBox;
ProfileChooser *profileChooser;
};
......@@ -444,10 +443,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Debugger"));
d->profileChooser = new ProfileChooser(this, ProfileChooser::RemoteDebugging);
d->hostLineEdit = new QLineEdit(this);
d->hostLineEdit->setText(QString::fromUtf8("localhost"));
d->profileChooser = new ProfileChooser(this);
d->portSpinBox = new QSpinBox(this);
d->portSpinBox->setMaximum(65535);
......@@ -459,7 +455,6 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
QFormLayout *formLayout = new QFormLayout();
formLayout->addRow(tr("Target:"), d->profileChooser);
formLayout->addRow(tr("&Host:"), d->hostLineEdit);
formLayout->addRow(tr("&Port:"), d->portSpinBox);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
......@@ -475,16 +470,6 @@ AttachToQmlPortDialog::~AttachToQmlPortDialog()
delete d;
}
void AttachToQmlPortDialog::setHost(const QString &host)
{
d->hostLineEdit->setText(host);
}
QString AttachToQmlPortDialog::host() const
{
return d->hostLineEdit->text();
}
void AttachToQmlPortDialog::setPort(const int port)
{
d->portSpinBox->setValue(port);
......@@ -495,9 +480,9 @@ int AttachToQmlPortDialog::port() const
return d->portSpinBox->value();
}
Id AttachToQmlPortDialog::profileId() const
Profile *AttachToQmlPortDialog::profile() const
{
return d->profileChooser->currentProfileId();
return d->profileChooser->currentProfile();
}
void AttachToQmlPortDialog::setProfileId(const Id &id)
......
......@@ -44,6 +44,7 @@ class QSettings;
QT_END_NAMESPACE
namespace Core { class Id; }
namespace ProjectExplorer { class Profile; }
namespace Debugger {
class DebuggerStartParameters;
......@@ -90,13 +91,10 @@ public:
explicit AttachToQmlPortDialog(QWidget *parent);
~AttachToQmlPortDialog();
QString host() const;
void setHost(const QString &host);
int port() const;
void setPort(const int port);
Core::Id profileId() const;
ProjectExplorer::Profile *profile() const;
void setProfileId(const Core::Id &id);
private:
......
......@@ -153,15 +153,11 @@ class DebuggerEnginePrivate : public QObject
Q_OBJECT
public:
DebuggerEnginePrivate(DebuggerEngine *engine,
DebuggerEngine *masterEngine,
DebuggerLanguages languages,
const DebuggerStartParameters &sp)
DebuggerEnginePrivate(DebuggerEngine *engine, const DebuggerStartParameters &sp)
: m_engine(engine),
m_masterEngine(masterEngine),
m_masterEngine(0),
m_runControl(0),
m_startParameters(sp),
m_languages(languages),
m_state(DebuggerNotReady),
m_lastGoodState(DebuggerNotReady),
m_targetState(DebuggerNotReady),
......@@ -183,8 +179,6 @@ public:
connect(&m_locationTimer, SIGNAL(timeout()), SLOT(resetLocation()));
}
~DebuggerEnginePrivate() {}
public slots:
void doSetupEngine();
void doSetupInferior();
......@@ -282,7 +276,6 @@ public:
DebuggerRunControl *m_runControl; // Not owned.
DebuggerStartParameters m_startParameters;
DebuggerLanguages m_languages;
// The current state.
DebuggerState m_state;
......@@ -335,13 +328,9 @@ public:
//
//////////////////////////////////////////////////////////////////////
DebuggerEngine::DebuggerEngine(const DebuggerStartParameters &startParameters,
DebuggerLanguages languages,
DebuggerEngine *parentEngine)
: d(new DebuggerEnginePrivate(this, parentEngine, languages, startParameters))
{
d->m_inferiorPid = 0;
}
DebuggerEngine::DebuggerEngine(const DebuggerStartParameters &startParameters)
: d(new DebuggerEnginePrivate(this, startParameters))
{}
DebuggerEngine::~DebuggerEngine()
{
......@@ -1272,14 +1261,14 @@ bool DebuggerEngine::isMasterEngine() const
return d->m_masterEngine == 0;
}
DebuggerEngine *DebuggerEngine::masterEngine() const
void DebuggerEngine::setMasterEngine(DebuggerEngine *masterEngine)
{
return d->m_masterEngine;
d->m_masterEngine = masterEngine;
}
DebuggerLanguages DebuggerEngine::languages() const
DebuggerEngine *DebuggerEngine::masterEngine() const
{
return d->m_languages;
return d->m_masterEngine;
}
QString DebuggerEngine::toFileInProject(const QUrl &fileUrl)
......
......@@ -139,9 +139,7 @@ class DEBUGGER_EXPORT DebuggerEngine : public QObject
Q_OBJECT
public:
explicit DebuggerEngine(const DebuggerStartParameters &sp,
DebuggerLanguages languages,
DebuggerEngine *parentEngine = 0);
explicit DebuggerEngine(const DebuggerStartParameters &sp);
virtual ~DebuggerEngine();
const DebuggerStartParameters &startParameters() const;
......@@ -266,8 +264,6 @@ public:
bool isMasterEngine() const;
DebuggerEngine *masterEngine() const;
DebuggerLanguages languages() const;
virtual bool setupQmlStep(bool /*on*/) { return false; }
virtual void readyToExecuteQmlStep() {}
......@@ -363,6 +359,7 @@ protected:
virtual void frameDown();
void setTargetState(DebuggerState state);
void setMasterEngine(DebuggerEngine *masterEngine);
DebuggerRunControl *runControl() const;
......
......@@ -247,7 +247,6 @@ void DebuggerMainWindowPrivate::updateActiveLanguages()
if (newLanguages != m_activeDebugLanguages) {
m_activeDebugLanguages = newLanguages;
debuggerCore()->languagesChanged();
emit q->activeDebugLanguagesChanged(m_activeDebugLanguages);
}
if (m_changingUI || !m_inDebugMode)
......
......@@ -86,9 +86,6 @@ public:
private slots:
void raiseDebuggerWindow();
signals:
void activeDebugLanguagesChanged(Debugger::DebuggerLanguages);
private:
friend class Internal::DebuggerMainWindowPrivate;
Internal::DebuggerMainWindowPrivate *d;
......
This diff is collapsed.
......@@ -58,15 +58,16 @@ public:
~DebuggerPlugin();
// Used by Maemo debugging support.
static DebuggerRunControl *createDebugger(const DebuggerStartParameters &sp,
ProjectExplorer::RunConfiguration *rc = 0);
static void startDebugger(ProjectExplorer::RunControl *runControl);
//static void startDebugger(ProjectExplorer::RunControl *runControl);
// Used by QmlJSInspector.
static bool isActiveDebugLanguage(int language);
static DebuggerMainWindow *mainWindow();
static QAction *visibleDebugAction();
static DebuggerRunControl *createDebugger(const DebuggerStartParameters &sp,
ProjectExplorer::RunConfiguration *rc);
private:
// IPlugin implementation.
bool initialize(const QStringList &arguments, QString *errorMessage);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment