Commit 02136034 authored by Héctor Mesa Jiménez's avatar Héctor Mesa Jiménez Committed by Christoph Cullmann
Browse files

gdbplugin: remove commented out code

parent a53efb44
......@@ -51,14 +51,12 @@ std::optional<QJsonDocument> loadJSON(const QString &path)
{
QFile file(path);
if (!file.open(QIODevice::ReadOnly)) {
// qCritical() << "file error: " << file.errorString();
return std::nullopt;
}
QJsonParseError error;
const auto json = QJsonDocument::fromJson(file.readAll(), &error);
file.close();
if (error.error != QJsonParseError::NoError) {
// qCritical() << "JSON parse error: " << error.errorString();
return std::nullopt;
}
return json;
......
......@@ -72,7 +72,6 @@ void Client::detach()
disconnect(m_bus);
if (m_managedBus) {
// m_bus->blockSignals(true);
m_bus->close();
m_bus->deleteLater();
m_bus = nullptr;
......@@ -101,12 +100,6 @@ bool Client::supportsTerminate() const
*/
void Client::processProtocolMessage(const QJsonObject &msg)
{
// const int seq = msg[DAP_SEQ].toInt(-1);
// if(seq < 0){
// qCWarning(DAPCLIENT) << "unknown or invalid ProtocolMessage::" << DAP_SEQ;
// return;
// }
const auto type = msg[DAP_TYPE].toString();
if (DAP_RESPONSE == type) {
......@@ -177,9 +170,6 @@ void Client::processResponseInitialize(const Response &response, const QJsonValu
m_adapterCapabilities = Capabilities(response.body.toObject());
Q_EMIT capabilitiesReceived(m_adapterCapabilities);
// if(!m_protocol.waitForInitializationEvents){
// setState(State::Initialized);
// }
requestLaunchCommand();
}
......
......@@ -423,7 +423,6 @@ struct Variable {
QString name;
QString value;
std::optional<QString> type;
// TODO std::optional<VariablePresentationHint> presentationHint;
/**
* @brief evaluateName Optional evaluatable name of tihs variable which can be
* passed to the EvaluateRequest to fetch the variable's value
......@@ -458,7 +457,6 @@ struct Variable {
struct EvaluateInfo {
QString result;
std::optional<QString> type;
// std::optional<VariablePresentationHint> presentationHint;
int variablesReference;
std::optional<int> namedVariables;
std::optional<int> indexedVariables;
......
......@@ -429,7 +429,6 @@ void DebugView::processLine(QString line)
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
} else {
m_variableParser.addLocal(line);
// Q_EMIT infoLocal(line);
}
break;
case printThis:
......@@ -438,18 +437,15 @@ void DebugView::processLine(QString line)
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
} else {
m_variableParser.addLocal(line);
// Q_EMIT infoLocal(line);
}
break;
case infoLocals:
if (PromptStr == line) {
m_state = ready;
m_variableParser.addLocal(QString());
// Q_EMIT infoLocal(QString());
QTimer::singleShot(0, this, &DebugView::issueNextCommand);
} else {
m_variableParser.addLocal(line);
// Q_EMIT infoLocal(line);
}
break;
case infoStack:
......
......@@ -191,8 +191,6 @@ void DapDebugView::start()
connect(m_client, &dap::Client::scopes, this, &DapDebugView::onScopes);
connect(m_client, &dap::Client::variables, this, &DapDebugView::onVariables);
connect(m_client, &dap::Client::modules, this, &DapDebugView::onModules);
// TODO
// connect(m_client.get(), &dap::Client::sourceContent, this, &CLI::onSourceContent);
connect(m_client, &dap::Client::sourceBreakpoints, this, &DapDebugView::onSourceBreakpoints);
connect(m_client, &dap::Client::breakpointChanged, this, &DapDebugView::onBreakpointEvent);
connect(m_client, &dap::Client::expressionEvaluated, this, &DapDebugView::onExpressionEvaluated);
......@@ -785,7 +783,6 @@ bool DapDebugView::canMove() const
bool DapDebugView::debuggerRunning() const
{
// return m_client && m_client->isServerConnected() && (m_state != None);
return m_client && (m_state != None);
}
......@@ -1459,7 +1456,6 @@ void DapDebugView::slotStepInto()
if (!m_currentThread)
return;
// resetState();
m_client->requestStepIn(*m_currentThread);
}
......@@ -1474,7 +1470,6 @@ void DapDebugView::slotStepOut()
if (!m_currentThread)
return;
// resetState();
m_client->requestStepOut(*m_currentThread);
}
......@@ -1489,7 +1484,6 @@ void DapDebugView::slotStepOver()
if (!m_currentThread)
return;
// resetState();
m_client->requestNext(*m_currentThread);
}
......@@ -1501,7 +1495,6 @@ void DapDebugView::slotContinue()
if (m_state == State::Initializing) {
m_client->requestConfigurationDone();
} else if (m_currentThread) {
// resetState();
m_client->requestContinue(*m_currentThread);
}
}
......@@ -1526,7 +1519,6 @@ void DapDebugView::slotKill()
{
if (!isConnectedState()) {
setState(None);
// Q_EMIT outputError(newLine(QStringLiteral("GDB ENDED")));
Q_EMIT readyForInput(false);
Q_EMIT gdbEnded();
return;
......
......@@ -63,7 +63,6 @@ public:
*/
virtual void runToCursor(QUrl const &url, int line) = 0;
// TODO
virtual void issueCommand(QString const &cmd) = 0;
virtual QString targetName() const = 0;
......@@ -130,7 +129,6 @@ Q_SIGNALS:
void variableScopeOpened();
void variableScopeClosed();
void scopesInfo(const QList<dap::Scope> &scopes, std::optional<int> activeId);
// void infoLocal(QString const &line);
void outputText(const QString &text);
void outputError(const QString &text);
......
......@@ -179,7 +179,6 @@ void GDBVariableParser::addStruct(int parentId, const QString &vString)
break;
}
symbolAndValue << vString.mid(start, end - start);
// qDebug() << symbolAndValue;
// Value
start = end + 3;
end = start;
......
......@@ -65,7 +65,6 @@ QTreeWidgetItem *LocalsView::createWrappedItem(QTreeWidgetItem *parent, const da
item->setData(1, Qt::UserRole, variable.value);
item->setToolTip(0, nameTip(variable));
item->setToolTip(1, valueTip(variable));
// parent->setToolTip(0, QStringLiteral("<qt>%1<qt>").arg(parent->text(0)));
return item;
}
......@@ -90,7 +89,6 @@ void LocalsView::openVariableScope()
void LocalsView::closeVariableScope()
{
// this->resizeColumnToContents(0);
}
void LocalsView::addVariableLevel(int parentId, const dap::Variable &variable)
......
......@@ -190,7 +190,6 @@ KatePluginGDBView::KatePluginGDBView(KTextEditor::Plugin *plugin, KTextEditor::M
connect(m_debugView, &DebugViewInterface::variableScopeOpened, m_localsView, &LocalsView::openVariableScope);
connect(m_debugView, &DebugViewInterface::variableScopeClosed, m_localsView, &LocalsView::closeVariableScope);
connect(m_debugView, &DebugViewInterface::variableInfo, m_localsView, &LocalsView::addVariableLevel);
// connect(m_debugView, &DebugView::infoLocal, m_localsView, &LocalsView::addLocal);
connect(m_debugView, &DebugViewInterface::threadInfo, this, &KatePluginGDBView::insertThread);
......
Supports Markdown
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