Commit 5ecb41af authored by hjk's avatar hjk

debugger: remove 'Attach to TCF' start option

And TcfEngine etc.

Reviewed-by: Friedemann Kleint
parent 3f747535
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AttachTcfDialog</class>
<widget class="QDialog" name="AttachTcfDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>310</width>
<height>224</height>
</rect>
</property>
<property name="windowTitle">
<string>Start Debugger</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="channelLabel">
<property name="text">
<string>Host and port:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="channelLineEdit">
<property name="text">
<string notr="true">localhost:5115</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="architectureLabel">
<property name="text">
<string>Architecture:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="architectureComboBox"/>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="useServerStartScriptCheckBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="useServerStartScriptLabel">
<property name="text">
<string>Use server start script:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="serverStartScript" native="true"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="serverStartScriptLabel">
<property name="text">
<string>Server start script:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
......@@ -110,7 +110,6 @@ SOURCES += breakhandler.cpp \
FORMS += attachexternaldialog.ui \
attachcoredialog.ui \
attachtcfdialog.ui \
breakcondition.ui \
breakpoint.ui \
dumperoptionpage.ui \
......@@ -140,5 +139,4 @@ include(pdb/pdb.pri)
include(lldb/lldbhost.pri)
include(qml/qml.pri)
include(tcf/tcf.pri)
include(shared/shared.pri)
......@@ -513,96 +513,6 @@ void AttachExternalDialog::accept()
}
///////////////////////////////////////////////////////////////////////
//
// AttachTcfDialog
//
///////////////////////////////////////////////////////////////////////
AttachTcfDialog::AttachTcfDialog(QWidget *parent)
: QDialog(parent),
m_ui(new Ui::AttachTcfDialog)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->setupUi(this);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
m_ui->serverStartScript->setExpectedKind(PathChooser::File);
m_ui->serverStartScript->setPromptDialogTitle(tr("Select Executable"));
connect(m_ui->useServerStartScriptCheckBox, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
updateState();
}
AttachTcfDialog::~AttachTcfDialog()
{
delete m_ui;
}
void AttachTcfDialog::setRemoteChannel(const QString &channel)
{
m_ui->channelLineEdit->setText(channel);
}
QString AttachTcfDialog::remoteChannel() const
{
return m_ui->channelLineEdit->text();
}
void AttachTcfDialog::setRemoteArchitectures(const QStringList &list)
{
m_ui->architectureComboBox->clear();
if (!list.isEmpty()) {
m_ui->architectureComboBox->insertItems(0, list);
m_ui->architectureComboBox->setCurrentIndex(0);
}
}
void AttachTcfDialog::setRemoteArchitecture(const QString &arch)
{
int index = m_ui->architectureComboBox->findText(arch);
if (index != -1)
m_ui->architectureComboBox->setCurrentIndex(index);
}
QString AttachTcfDialog::remoteArchitecture() const
{
int index = m_ui->architectureComboBox->currentIndex();
return m_ui->architectureComboBox->itemText(index);
}
void AttachTcfDialog::setServerStartScript(const QString &scriptName)
{
m_ui->serverStartScript->setPath(scriptName);
}
QString AttachTcfDialog::serverStartScript() const
{
return m_ui->serverStartScript->path();
}
void AttachTcfDialog::setUseServerStartScript(bool on)
{
m_ui->useServerStartScriptCheckBox->setChecked(on);
}
bool AttachTcfDialog::useServerStartScript() const
{
return m_ui->useServerStartScriptCheckBox->isChecked();
}
void AttachTcfDialog::updateState()
{
bool enabled = m_ui->useServerStartScriptCheckBox->isChecked();
m_ui->serverStartScriptLabel->setEnabled(enabled);
m_ui->serverStartScript->setEnabled(enabled);
}
///////////////////////////////////////////////////////////////////////
//
// StartExternalDialog
......
......@@ -46,7 +46,6 @@ class QDialogButtonBox;
namespace Ui {
class AttachCoreDialog;
class AttachExternalDialog;
class AttachTcfDialog;
class StartExternalDialog;
class StartRemoteDialog;
class StartRemoteEngineDialog;
......@@ -133,33 +132,6 @@ private:
ProcessListFilterModel *m_model;
};
class AttachTcfDialog : public QDialog
{
Q_OBJECT
public:
explicit AttachTcfDialog(QWidget *parent);
~AttachTcfDialog();
QString remoteChannel() const;
void setRemoteChannel(const QString &host);
QString remoteArchitecture() const;
void setRemoteArchitecture(const QString &arch);
void setRemoteArchitectures(const QStringList &arches);
QString serverStartScript() const;
bool useServerStartScript() const;
void setUseServerStartScript(bool on);
void setServerStartScript(const QString &scriptName);
private slots:
void updateState();
private:
Ui::AttachTcfDialog *m_ui;
};
class StartExternalDialog : public QDialog
{
Q_OBJECT
......
......@@ -371,7 +371,6 @@ const char * const M_DEBUG_START_DEBUGGING = "QtCreator.Menu.Debug.StartDebuggin
const char * const STARTEXTERNAL = "Debugger.StartExternal";
const char * const ATTACHEXTERNAL = "Debugger.AttachExternal";
const char * const ATTACHCORE = "Debugger.AttachCore";
const char * const ATTACHTCF = "Debugger.AttachTcf";
const char * const ATTACHREMOTE = "Debugger.AttachRemote";
const char * const ATTACHREMOTECDB = "Debugger.AttachRemoteCDB";
const char * const STARTREMOTELLDB = "Debugger.StartRemoteLLDB";
......@@ -700,7 +699,6 @@ public slots:
const ProjectExplorer::Abi &abi = ProjectExplorer::Abi(),
const QString &debuggerCommand = QString());
void attachRemote(const QString &spec);
void attachRemoteTcf();
void enableReverseDebuggingTriggered(const QVariant &value);
void languagesChanged();
......@@ -988,7 +986,6 @@ public:
QAction *m_startRemoteLldbAction;
QAction *m_attachExternalAction;
QAction *m_attachCoreAction;
QAction *m_attachTcfAction;
QAction *m_detachAction;
QAction *m_continueAction;
QAction *m_exitAction; // On application output button if "Stop" is possible
......@@ -1104,7 +1101,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_startRemoteLldbAction = 0;
m_attachExternalAction = 0;
m_attachCoreAction = 0;
m_attachTcfAction = 0;
m_detachAction = 0;
m_commonOptionsPage = 0;
......@@ -1582,37 +1578,6 @@ void DebuggerPluginPrivate::enableReverseDebuggingTriggered(const QVariant &valu
m_reverseDirectionAction->setEnabled(value.toBool());
}
void DebuggerPluginPrivate::attachRemoteTcf()
{
DebuggerStartParameters sp;
AttachTcfDialog dlg(mainWindow());
QStringList arches;
arches.append(_("i386:x86-64:intel"));
dlg.setRemoteArchitectures(arches);
dlg.setRemoteChannel(
configValue(_("LastTcfRemoteChannel")).toString());
dlg.setRemoteArchitecture(
configValue(_("LastTcfRemoteArchitecture")).toString());
dlg.setServerStartScript(
configValue(_("LastTcfServerStartScript")).toString());
dlg.setUseServerStartScript(
configValue(_("LastTcfUseServerStartScript")).toBool());
if (dlg.exec() != QDialog::Accepted)
return;
setConfigValue(_("LastTcfRemoteChannel"), dlg.remoteChannel());
setConfigValue(_("LastTcfRemoteArchitecture"), dlg.remoteArchitecture());
setConfigValue(_("LastTcfServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastTcfUseServerStartScript"), dlg.useServerStartScript());
sp.remoteChannel = dlg.remoteChannel();
sp.remoteArchitecture = dlg.remoteArchitecture();
sp.serverStartScript = dlg.serverStartScript();
sp.startMode = AttachTcf;
if (dlg.useServerStartScript())
sp.serverStartScript = dlg.serverStartScript();
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
void DebuggerPluginPrivate::runScheduled()
{
foreach (const DebuggerStartParameters &sp, m_scheduledStarts) {
......@@ -2755,12 +2720,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
act->setText(tr("Attach to Core..."));
connect(act, SIGNAL(triggered()), SLOT(attachCore()));
act = m_attachTcfAction = new QAction(this);
act->setText(tr("Attach to Running Tcf Agent..."));
act->setToolTip(tr("This attaches to a running "
"'Target Communication Framework' agent."));
connect(act, SIGNAL(triggered()), SLOT(attachRemoteTcf()));
act = m_startRemoteAction = new QAction(this);
act->setText(tr("Start and Attach to Remote Application..."));
connect(act, SIGNAL(triggered()), SLOT(startRemoteApplication()));
......@@ -2808,10 +2767,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
cmd = am->registerAction(m_attachTcfAction,
Constants::ATTACHTCF, globalcontext);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
cmd = am->registerAction(m_startRemoteAction,
Constants::ATTACHREMOTE, globalcontext);
cmd->setAttribute(Command::CA_Hide);
......
......@@ -89,7 +89,6 @@ DebuggerEngine *createGdbEngine(const DebuggerStartParameters &sp,
DebuggerEngine *createScriptEngine(const DebuggerStartParameters &sp);
DebuggerEngine *createPdbEngine(const DebuggerStartParameters &sp);
DebuggerEngine *createTcfEngine(const DebuggerStartParameters &sp);
QmlEngine *createQmlEngine(const DebuggerStartParameters &sp,
DebuggerEngine *masterEngine);
DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp,
......@@ -772,9 +771,6 @@ DebuggerEngine *
case PdbEngineType:
return createPdbEngine(sp);
break;
case TcfEngineType:
return createTcfEngine(sp);
break;
case QmlEngineType:
return createQmlEngine(sp, masterEngine);
break;
......
This diff is collapsed.
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGER_JSON_H
#define DEBUGGER_JSON_H
#include <QtCore/QByteArray>
#include <QtCore/QList>
namespace Debugger {
namespace Internal {
class JsonValue
{
public:
JsonValue() : m_type(Invalid) {}
explicit JsonValue(const QByteArray &str) { fromString(str); }
QByteArray m_name;
QByteArray m_data;
QList<JsonValue> m_children;
enum Type {
Invalid,
String,
Number,
Object,
Array
};
Type m_type;
inline Type type() const { return m_type; }
inline QByteArray name() const { return m_name; }
inline bool hasName(const char *name) const { return m_name == name; }
inline bool isValid() const { return m_type != Invalid; }
inline bool isNumber() const { return m_type == Number; }
inline bool isString() const { return m_type == String; }
inline bool isObject() const { return m_type == Object; }
inline bool isArray() const { return m_type == Array; }
inline QByteArray data() const { return m_data; }
inline const QList<JsonValue> &children() const { return m_children; }
inline int childCount() const { return m_children.size(); }
const JsonValue &childAt(int index) const { return m_children[index]; }
JsonValue &childAt(int index) { return m_children[index]; }
JsonValue findChild(const char *name) const;
QByteArray toString(bool multiline = false, int indent = 0) const;
void fromString(const QByteArray &str);
void setStreamOutput(const QByteArray &name, const QByteArray &content);
private:
static QByteArray parseCString(const char *&from, const char *to);
static QByteArray parseNumber(const char *&from, const char *to);
static QByteArray escapeCString(const QByteArray &ba);
static QString escapeCString(const QString &ba);
void parsePair(const char *&from, const char *to);
void parseValue(const char *&from, const char *to);
void parseObject(const char *&from, const char *to);
void parseArray(const char *&from, const char *to);
void dumpChildren(QByteArray *str, bool multiline, int indent) const;
};
} // namespace Internal
} // namespace Debugger
//Q_DECLARE_METATYPE(GdbDebugger::Internal::JsonValue)
#endif // DEBUGGER_JSON_H
HEADERS += \
$$PWD/json.h \
$$PWD/tcfengine.h \
SOURCES += \
$$PWD/json.cpp \
$$PWD/tcfengine.cpp \
FORMS +=
RESOURCES +=
This diff is collapsed.
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef DEBUGGER_TCFENGINE_H
#define DEBUGGER_TCFENGINE_H
#include <QtCore/QByteArray>
#include <QtCore/QHash>
#include <QtCore/QMap>
#include <QtCore/QObject>
#include <QtCore/QPoint>
#include <QtCore/QProcess>
#include <QtCore/QQueue>
#include <QtCore/QSet>
#include <QtCore/QTimer>
#include <QtCore/QVariant>
#include <QtNetwork/QAbstractSocket>
QT_BEGIN_NAMESPACE
class QTcpSocket;
QT_END_NAMESPACE
#include "debuggerengine.h"
#include "json.h"
namespace Debugger {
namespace Internal {
class ScriptAgent;
class WatchData;
class TcfEngine : public Debugger::DebuggerEngine
{
Q_OBJECT
public:
explicit TcfEngine(const DebuggerStartParameters &startParameters);
~TcfEngine();
private:
// DebuggerEngine implementation
void executeStep();
void executeStepOut();
void executeNext();
void executeStepI();
void executeNextI();
void setupEngine();
void setupInferior();
void runEngine();
void shutdownInferior();
void shutdownEngine();
bool setToolTipExpression(const QPoint &mousePos,
TextEditor::ITextEditor *editor, const DebuggerToolTipContext &);
void continueInferior();
void interruptInferior();
void executeRunToLine(const ContextData &data);
void executeRunToFunction(const QString &functionName);
void executeJumpToLine(const ContextData &data);
void activateFrame(int index);
void selectThread(int index);
void attemptBreakpointSynchronization();
bool acceptsBreakpoint(BreakpointId) const { return false; }
void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value);
void executeDebuggerCommand(const QString &command);
void loadSymbols(const QString &moduleName);
void loadAllSymbols();
void requestModuleSymbols(const QString &moduleName);
void reloadModules();
void reloadRegisters() {}
void reloadSourceFiles() {}
void reloadFullStack() {}
bool supportsThreads() const { return true; }
void maybeBreakNow(bool byFunction);
void updateWatchData(const WatchData &data, const WatchUpdateFlags &flags);
void updateLocals();
void updateSubItem(const WatchData &data);
Q_SLOT void socketConnected();
Q_SLOT void socketDisconnected();
Q_SLOT void socketError(QAbstractSocket::SocketError);
Q_SLOT void socketReadyRead();
void handleResponse(const QByteArray &ba);
void handleRunControlSuspend(const JsonValue &response, const QVariant &);
void handleRunControlGetChildren(const JsonValue &response, const QVariant &);
void handleSysMonitorGetChildren(const JsonValue &response, const QVariant &);
private:
Q_SLOT void startDebugging();
typedef void (TcfEngine::*TcfCommandCallback)
(const JsonValue &record, const QVariant &cookie);
struct TcfCommand
{
TcfCommand() : flags(0), token(-1), callback(0), callbackName(0) {}
QString toString() const;
int flags;
int token;
TcfCommandCallback callback;
const char *callbackName;
QByteArray command;
QVariant cookie;
};
void postCommand(const QByteArray &cmd,
TcfCommandCallback callback = 0, const char *callbackName = 0);
void sendCommandNow(const TcfCommand &command);
QHash<int, TcfCommand> m_cookieForToken;
QQueue<TcfCommand> m_sendQueue;
// timer based congestion control. does not seem to work well.
void enqueueCommand(const TcfCommand &command);
Q_SLOT void handleSendTimer();
int m_congestion;
QTimer m_sendTimer;
// synchrounous communication
void acknowledgeResult();
int m_inAir;
QTcpSocket *m_socket;
QByteArray m_inbuffer;
QList<QByteArray> m_services;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_TCFENGINE_H
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