2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-04-23 12:12:22 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-04-23 12:12:22 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-04-23 12:12:22 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-04-23 12:12:22 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-04-23 12:12:22 +02:00
|
|
|
|
|
|
|
|
#include "pdbengine.h"
|
|
|
|
|
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/debuggeractions.h>
|
|
|
|
|
#include <debugger/debuggercore.h>
|
|
|
|
|
#include <debugger/debuggerdialogs.h>
|
|
|
|
|
#include <debugger/debuggerplugin.h>
|
|
|
|
|
#include <debugger/debuggerprotocol.h>
|
|
|
|
|
#include <debugger/debuggertooltipmanager.h>
|
2015-02-26 17:19:57 +01:00
|
|
|
#include <debugger/threaddata.h>
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/breakhandler.h>
|
|
|
|
|
#include <debugger/moduleshandler.h>
|
2015-09-01 15:24:20 +02:00
|
|
|
#include <debugger/procinterrupt.h>
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/registerhandler.h>
|
|
|
|
|
#include <debugger/stackhandler.h>
|
|
|
|
|
#include <debugger/sourceutils.h>
|
|
|
|
|
#include <debugger/watchhandler.h>
|
|
|
|
|
#include <debugger/watchutils.h>
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2010-04-23 12:12:22 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2015-07-23 11:23:52 +02:00
|
|
|
#include <utils/qtcprocess.h>
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2012-02-14 16:43:51 +01:00
|
|
|
#include <coreplugin/idocument.h>
|
2010-04-23 12:12:22 +02:00
|
|
|
#include <coreplugin/icore.h>
|
2014-11-25 13:08:18 +01:00
|
|
|
#include <coreplugin/messagebox.h>
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDateTime>
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
#include <QVariant>
|
2015-09-14 13:40:35 +02:00
|
|
|
#include <QJsonArray>
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2015-02-13 18:37:45 +01:00
|
|
|
using namespace Core;
|
2010-04-23 12:12:22 +02:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2017-05-05 14:45:36 +02:00
|
|
|
PdbEngine::PdbEngine()
|
2010-08-24 15:35:46 +02:00
|
|
|
{
|
2017-05-05 14:45:36 +02:00
|
|
|
setObjectName("PdbEngine");
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
setDebuggerName("PDB");
|
2010-08-24 15:35:46 +02:00
|
|
|
}
|
2010-04-23 12:12:22 +02:00
|
|
|
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
void PdbEngine::executeDebuggerCommand(const QString &command)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2010-07-23 16:05:56 +02:00
|
|
|
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
|
2010-04-23 12:12:22 +02:00
|
|
|
if (state() == DebuggerNotReady) {
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage("PDB PROCESS NOT RUNNING, PLAIN CMD IGNORED: " + command);
|
2010-04-23 12:12:22 +02:00
|
|
|
return;
|
|
|
|
|
}
|
2015-02-13 23:15:28 +01:00
|
|
|
QTC_ASSERT(m_proc.state() == QProcess::Running, notifyEngineIll());
|
2016-06-07 17:04:53 +02:00
|
|
|
postDirectCommand(command);
|
2010-07-23 16:05:56 +02:00
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void PdbEngine::postDirectCommand(const QString &command)
|
2010-07-23 16:05:56 +02:00
|
|
|
{
|
2015-02-13 23:15:28 +01:00
|
|
|
QTC_ASSERT(m_proc.state() == QProcess::Running, notifyEngineIll());
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage(command, LogInput);
|
|
|
|
|
m_proc.write(command.toUtf8() + '\n');
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2015-02-13 14:46:35 +01:00
|
|
|
void PdbEngine::runCommand(const DebuggerCommand &cmd)
|
|
|
|
|
{
|
2016-08-02 15:35:32 +02:00
|
|
|
if (state() == EngineSetupRequested) { // cmd has been triggered too early
|
|
|
|
|
showMessage("IGNORED COMMAND: " + cmd.function);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2015-02-13 23:15:28 +01:00
|
|
|
QTC_ASSERT(m_proc.state() == QProcess::Running, notifyEngineIll());
|
2016-06-07 17:04:53 +02:00
|
|
|
QString command = "qdebug('" + cmd.function + "'," + cmd.argsToPython() + ")";
|
|
|
|
|
showMessage(command, LogInput);
|
|
|
|
|
m_proc.write(command.toUtf8() + '\n');
|
2015-02-13 14:46:35 +01:00
|
|
|
}
|
|
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
void PdbEngine::shutdownInferior()
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2010-07-09 17:07:59 +02:00
|
|
|
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
2017-12-14 09:36:41 +01:00
|
|
|
notifyInferiorShutdownFinished();
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
void PdbEngine::shutdownEngine()
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2010-07-09 17:07:59 +02:00
|
|
|
QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << state());
|
2015-02-13 23:15:28 +01:00
|
|
|
m_proc.kill();
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-08 18:10:50 +02:00
|
|
|
void PdbEngine::setupEngine()
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2010-07-09 17:07:59 +02:00
|
|
|
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2015-07-23 11:23:52 +02:00
|
|
|
m_interpreter = runParameters().interpreter;
|
2018-10-07 22:38:47 +03:00
|
|
|
QString bridge = ICore::resourcePath() + "/debugger/pdbbridge.py";
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2016-08-03 19:43:54 +03:00
|
|
|
connect(&m_proc, &QProcess::errorOccurred, this, &PdbEngine::handlePdbError);
|
2019-05-27 23:28:48 +02:00
|
|
|
connect(&m_proc, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
2015-02-05 12:26:16 +01:00
|
|
|
this, &PdbEngine::handlePdbFinished);
|
2015-02-13 23:15:28 +01:00
|
|
|
connect(&m_proc, &QProcess::readyReadStandardOutput,
|
2015-02-05 12:26:16 +01:00
|
|
|
this, &PdbEngine::readPdbStandardOutput);
|
2015-02-13 23:15:28 +01:00
|
|
|
connect(&m_proc, &QProcess::readyReadStandardError,
|
2015-02-05 12:26:16 +01:00
|
|
|
this, &PdbEngine::readPdbStandardError);
|
|
|
|
|
|
2015-07-23 11:23:52 +02:00
|
|
|
QFile scriptFile(runParameters().mainScript);
|
|
|
|
|
if (!scriptFile.open(QIODevice::ReadOnly|QIODevice::Text)) {
|
|
|
|
|
AsynchronousMessageBox::critical(tr("Python Error"),
|
2016-06-07 17:04:53 +02:00
|
|
|
QString("Cannot open script file %1:\n%2").
|
2015-07-23 11:23:52 +02:00
|
|
|
arg(scriptFile.fileName(), scriptFile.errorString()));
|
|
|
|
|
notifyEngineSetupFailed();
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-22 15:09:35 +01:00
|
|
|
QStringList args = {bridge, scriptFile.fileName()};
|
2016-01-28 10:31:24 +01:00
|
|
|
args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory));
|
2018-10-07 22:38:47 +03:00
|
|
|
showMessage("STARTING " + m_interpreter + ' ' + args.join(' '));
|
2016-07-29 15:55:15 +02:00
|
|
|
m_proc.setEnvironment(runParameters().debugger.environment.toStringList());
|
2015-07-23 11:23:52 +02:00
|
|
|
m_proc.start(m_interpreter, args);
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2015-02-13 23:15:28 +01:00
|
|
|
if (!m_proc.waitForStarted()) {
|
2014-04-17 14:09:47 +02:00
|
|
|
const QString msg = tr("Unable to start pdb \"%1\": %2")
|
2015-07-23 11:23:52 +02:00
|
|
|
.arg(m_interpreter, m_proc.errorString());
|
2010-07-12 15:34:05 +02:00
|
|
|
notifyEngineSetupFailed();
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage("ADAPTER START FAILED");
|
2015-02-13 18:37:45 +01:00
|
|
|
if (!msg.isEmpty())
|
|
|
|
|
ICore::showWarningWithOptions(tr("Adapter start failed"), msg);
|
2010-07-09 08:48:33 +02:00
|
|
|
notifyEngineSetupFailed();
|
2010-04-23 12:12:22 +02:00
|
|
|
return;
|
|
|
|
|
}
|
2010-07-09 08:48:33 +02:00
|
|
|
notifyEngineSetupOk();
|
2010-07-08 18:10:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::runEngine()
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2010-07-23 16:05:56 +02:00
|
|
|
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
|
2010-07-08 18:10:50 +02:00
|
|
|
showStatusMessage(tr("Running requested..."), 5000);
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
BreakpointManager::claimBreakpointsForEngine(this);
|
2010-07-23 16:05:56 +02:00
|
|
|
notifyEngineRunAndInferiorStopOk();
|
2015-09-02 15:42:43 +02:00
|
|
|
updateAll();
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::interruptInferior()
|
|
|
|
|
{
|
2015-09-01 15:24:20 +02:00
|
|
|
QString error;
|
|
|
|
|
interruptProcess(m_proc.processId(), GdbEngineType, &error);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2018-10-02 12:53:07 +02:00
|
|
|
void PdbEngine::executeStepIn(bool)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2010-07-12 15:34:05 +02:00
|
|
|
notifyInferiorRunRequested();
|
|
|
|
|
notifyInferiorRunOk();
|
2015-02-13 18:37:45 +01:00
|
|
|
postDirectCommand("step");
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::executeStepOut()
|
|
|
|
|
{
|
2010-07-12 15:34:05 +02:00
|
|
|
notifyInferiorRunRequested();
|
|
|
|
|
notifyInferiorRunOk();
|
2015-02-13 19:14:00 +01:00
|
|
|
postDirectCommand("return");
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2018-10-02 12:53:07 +02:00
|
|
|
void PdbEngine::executeStepOver(bool)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2010-07-12 15:34:05 +02:00
|
|
|
notifyInferiorRunRequested();
|
|
|
|
|
notifyInferiorRunOk();
|
2015-02-13 18:37:45 +01:00
|
|
|
postDirectCommand("next");
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::continueInferior()
|
|
|
|
|
{
|
2010-07-12 15:34:05 +02:00
|
|
|
notifyInferiorRunRequested();
|
|
|
|
|
notifyInferiorRunOk();
|
2010-04-23 12:12:22 +02:00
|
|
|
// Callback will be triggered e.g. when breakpoint is hit.
|
2015-02-13 18:37:45 +01:00
|
|
|
postDirectCommand("continue");
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2011-02-23 10:16:11 +01:00
|
|
|
void PdbEngine::executeRunToLine(const ContextData &data)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2011-02-23 10:16:11 +01:00
|
|
|
Q_UNUSED(data)
|
2015-02-13 18:37:45 +01:00
|
|
|
QTC_CHECK("FIXME: PdbEngine::runToLineExec()" && false);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::executeRunToFunction(const QString &functionName)
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(functionName)
|
2015-02-13 18:37:45 +01:00
|
|
|
QTC_CHECK("FIXME: PdbEngine::runToFunctionExec()" && false);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2011-02-23 10:16:11 +01:00
|
|
|
void PdbEngine::executeJumpToLine(const ContextData &data)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2011-02-23 10:16:11 +01:00
|
|
|
Q_UNUSED(data)
|
2015-02-13 18:37:45 +01:00
|
|
|
QTC_CHECK("FIXME: PdbEngine::jumpToLineExec()" && false);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::activateFrame(int frameIndex)
|
|
|
|
|
{
|
2010-07-09 17:07:59 +02:00
|
|
|
if (state() != InferiorStopOk && state() != InferiorUnrunnable)
|
2010-04-23 12:12:22 +02:00
|
|
|
return;
|
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
StackHandler *handler = stackHandler();
|
|
|
|
|
QTC_ASSERT(frameIndex < handler->stackSize(), return);
|
2015-07-23 11:23:52 +02:00
|
|
|
handler->setCurrentIndex(frameIndex);
|
2010-12-16 19:06:33 +01:00
|
|
|
gotoLocation(handler->currentFrame());
|
2015-07-23 11:23:52 +02:00
|
|
|
updateLocals();
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2018-08-15 17:28:00 +02:00
|
|
|
void PdbEngine::selectThread(const Thread &thread)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2018-08-15 17:28:00 +02:00
|
|
|
Q_UNUSED(thread)
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
bool PdbEngine::acceptsBreakpoint(const BreakpointParameters &bp) const
|
2010-11-25 14:33:13 +01:00
|
|
|
{
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const QString fileName = bp.fileName;
|
2016-06-07 17:04:53 +02:00
|
|
|
return fileName.endsWith(".py");
|
2010-11-25 14:33:13 +01:00
|
|
|
}
|
|
|
|
|
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
void PdbEngine::insertBreakpoint(const Breakpoint &bp)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
QTC_ASSERT(bp, return);
|
|
|
|
|
QTC_CHECK(bp->state() == BreakpointInsertionRequested);
|
|
|
|
|
notifyBreakpointInsertProceeding(bp);
|
2010-11-25 14:33:13 +01:00
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
QString loc;
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const BreakpointParameters ¶ms = bp->requestedParameters();
|
|
|
|
|
if (params.type == BreakpointByFunction)
|
|
|
|
|
loc = params.functionName;
|
2010-11-25 14:33:13 +01:00
|
|
|
else
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
loc = params.fileName + ':' + QString::number(params.lineNumber);
|
2010-11-25 14:33:13 +01:00
|
|
|
|
2015-02-13 18:37:45 +01:00
|
|
|
postDirectCommand("break " + loc);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
void PdbEngine::updateBreakpoint(const Breakpoint &bp)
|
2010-11-25 14:33:13 +01:00
|
|
|
{
|
2018-10-16 15:25:55 +02:00
|
|
|
QTC_ASSERT(bp, return);
|
|
|
|
|
const BreakpointState state = bp->state();
|
|
|
|
|
if (QTC_GUARD(state == BreakpointUpdateRequested))
|
|
|
|
|
notifyBreakpointChangeProceeding(bp);
|
|
|
|
|
if (bp->responseId().isEmpty()) // FIXME postpone update somehow (QTimer::singleShot?)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// FIXME figure out what needs to be changed (there might be more than enabled state)
|
|
|
|
|
const BreakpointParameters &requested = bp->requestedParameters();
|
|
|
|
|
if (requested.enabled != bp->isEnabled()) {
|
|
|
|
|
if (bp->isEnabled())
|
|
|
|
|
postDirectCommand("disable " + bp->responseId());
|
|
|
|
|
else
|
|
|
|
|
postDirectCommand("enable " + bp->responseId());
|
|
|
|
|
bp->setEnabled(!bp->isEnabled());
|
|
|
|
|
}
|
|
|
|
|
// Pretend it succeeds without waiting for response.
|
|
|
|
|
notifyBreakpointChangeOk(bp);
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::removeBreakpoint(const Breakpoint &bp)
|
|
|
|
|
{
|
|
|
|
|
QTC_ASSERT(bp, return);
|
|
|
|
|
QTC_CHECK(bp->state() == BreakpointRemoveRequested);
|
|
|
|
|
notifyBreakpointRemoveProceeding(bp);
|
2018-10-19 14:45:50 +02:00
|
|
|
if (bp->responseId().isEmpty()) {
|
|
|
|
|
notifyBreakpointRemoveFailed(bp);
|
|
|
|
|
return;
|
|
|
|
|
}
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
showMessage(QString("DELETING BP %1 IN %2")
|
|
|
|
|
.arg(bp->responseId()).arg(bp->fileName()));
|
|
|
|
|
postDirectCommand("clear " + bp->responseId());
|
2010-11-25 14:33:13 +01:00
|
|
|
// Pretend it succeeds without waiting for response.
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
notifyBreakpointRemoveOk(bp);
|
2010-11-25 14:33:13 +01:00
|
|
|
}
|
|
|
|
|
|
2010-04-23 12:12:22 +02:00
|
|
|
void PdbEngine::loadSymbols(const QString &moduleName)
|
|
|
|
|
{
|
|
|
|
|
Q_UNUSED(moduleName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::loadAllSymbols()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::reloadModules()
|
|
|
|
|
{
|
2015-11-03 12:01:57 +01:00
|
|
|
runCommand({"listModules"});
|
2010-05-03 19:12:52 +02:00
|
|
|
}
|
|
|
|
|
|
2015-02-13 16:46:27 +01:00
|
|
|
void PdbEngine::refreshModules(const GdbMi &modules)
|
2010-05-03 19:12:52 +02:00
|
|
|
{
|
2015-01-13 22:42:30 +01:00
|
|
|
ModulesHandler *handler = modulesHandler();
|
|
|
|
|
handler->beginUpdateAll();
|
2018-09-25 18:48:29 +02:00
|
|
|
for (const GdbMi &item : modules) {
|
2010-05-03 19:12:52 +02:00
|
|
|
Module module;
|
2016-06-07 17:04:53 +02:00
|
|
|
module.moduleName = item["name"].data();
|
|
|
|
|
QString path = item["value"].data();
|
|
|
|
|
int pos = path.indexOf("' from '");
|
2010-05-03 19:12:52 +02:00
|
|
|
if (pos != -1) {
|
|
|
|
|
path = path.mid(pos + 8);
|
|
|
|
|
if (path.size() >= 2)
|
|
|
|
|
path.chop(2);
|
2016-06-07 17:04:53 +02:00
|
|
|
} else if (path.startsWith("<module '")
|
|
|
|
|
&& path.endsWith("' (built-in)>")) {
|
|
|
|
|
path = "(builtin)";
|
2010-05-03 19:12:52 +02:00
|
|
|
}
|
|
|
|
|
module.modulePath = path;
|
2015-01-13 22:42:30 +01:00
|
|
|
handler->updateModule(module);
|
2010-05-03 19:12:52 +02:00
|
|
|
}
|
2015-01-13 22:42:30 +01:00
|
|
|
handler->endUpdateAll();
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2010-05-03 19:12:52 +02:00
|
|
|
void PdbEngine::requestModuleSymbols(const QString &moduleName)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2015-02-13 18:37:45 +01:00
|
|
|
DebuggerCommand cmd("listSymbols");
|
|
|
|
|
cmd.arg("module", moduleName);
|
|
|
|
|
runCommand(cmd);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2015-09-02 12:47:47 +02:00
|
|
|
void PdbEngine::refreshState(const GdbMi &reportedState)
|
|
|
|
|
{
|
2016-06-07 17:04:53 +02:00
|
|
|
QString newState = reportedState.data();
|
2015-09-02 12:47:47 +02:00
|
|
|
if (newState == "stopped") {
|
|
|
|
|
notifyInferiorSpontaneousStop();
|
|
|
|
|
updateAll();
|
|
|
|
|
} else if (newState == "inferiorexited") {
|
|
|
|
|
notifyInferiorExited();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-24 12:40:52 +02:00
|
|
|
void PdbEngine::refreshLocation(const GdbMi &reportedLocation)
|
|
|
|
|
{
|
|
|
|
|
StackFrame frame;
|
2016-06-07 17:04:53 +02:00
|
|
|
frame.file = reportedLocation["file"].data();
|
2015-08-24 12:40:52 +02:00
|
|
|
frame.line = reportedLocation["line"].toInt();
|
2015-09-02 14:11:43 +02:00
|
|
|
frame.usable = QFileInfo(frame.file).isReadable();
|
2015-08-24 12:40:52 +02:00
|
|
|
if (state() == InferiorRunOk) {
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage(QString("STOPPED AT: %1:%2").arg(frame.file).arg(frame.line));
|
2015-08-24 12:40:52 +02:00
|
|
|
gotoLocation(frame);
|
|
|
|
|
notifyInferiorSpontaneousStop();
|
|
|
|
|
updateAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-13 16:46:27 +01:00
|
|
|
void PdbEngine::refreshSymbols(const GdbMi &symbols)
|
2010-05-03 19:12:52 +02:00
|
|
|
{
|
2016-06-07 17:04:53 +02:00
|
|
|
QString moduleName = symbols["module"].data();
|
2015-02-13 16:46:27 +01:00
|
|
|
Symbols syms;
|
2018-09-25 18:48:29 +02:00
|
|
|
for (const GdbMi &item : symbols["symbols"]) {
|
2010-05-03 19:12:52 +02:00
|
|
|
Symbol symbol;
|
2016-06-07 17:04:53 +02:00
|
|
|
symbol.name = item["name"].data();
|
2015-02-13 16:46:27 +01:00
|
|
|
syms.append(symbol);
|
2010-05-03 19:12:52 +02:00
|
|
|
}
|
2015-02-13 16:46:27 +01:00
|
|
|
Internal::showModuleSymbols(moduleName, syms);
|
2010-05-03 19:12:52 +02:00
|
|
|
}
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
bool PdbEngine::canHandleToolTip(const DebuggerToolTipContext &) const
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2015-06-08 18:07:11 +02:00
|
|
|
return state() == InferiorStopOk;
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2015-03-19 12:42:53 +01:00
|
|
|
void PdbEngine::assignValueInDebugger(WatchItem *, const QString &expression, const QVariant &value)
|
2015-02-13 17:18:16 +01:00
|
|
|
{
|
|
|
|
|
//DebuggerCommand cmd("assignValue");
|
|
|
|
|
//cmd.arg("expression", expression);
|
|
|
|
|
//cmd.arg("value", value.toString());
|
|
|
|
|
//runCommand(cmd);
|
2016-06-07 17:04:53 +02:00
|
|
|
postDirectCommand("global " + expression + ';' + expression + "=" + value.toString());
|
2010-04-23 12:12:22 +02:00
|
|
|
updateLocals();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void PdbEngine::updateItem(const QString &iname)
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2019-07-23 10:58:00 +02:00
|
|
|
Q_UNUSED(iname)
|
2010-04-23 12:12:22 +02:00
|
|
|
updateAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::handlePdbError(QProcess::ProcessError error)
|
|
|
|
|
{
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage("HANDLE PDB ERROR");
|
2010-04-23 12:12:22 +02:00
|
|
|
switch (error) {
|
|
|
|
|
case QProcess::Crashed:
|
|
|
|
|
break; // will get a processExited() as well
|
|
|
|
|
// impossible case QProcess::FailedToStart:
|
|
|
|
|
case QProcess::ReadError:
|
|
|
|
|
case QProcess::WriteError:
|
|
|
|
|
case QProcess::Timedout:
|
|
|
|
|
default:
|
2010-07-12 15:34:05 +02:00
|
|
|
//setState(EngineShutdownRequested, true);
|
2015-02-13 23:15:28 +01:00
|
|
|
m_proc.kill();
|
2015-02-13 18:37:45 +01:00
|
|
|
AsynchronousMessageBox::critical(tr("Pdb I/O Error"), errorMessage(error));
|
2010-04-23 12:12:22 +02:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString PdbEngine::errorMessage(QProcess::ProcessError error) const
|
|
|
|
|
{
|
|
|
|
|
switch (error) {
|
|
|
|
|
case QProcess::FailedToStart:
|
|
|
|
|
return tr("The Pdb process failed to start. Either the "
|
2014-04-17 14:09:47 +02:00
|
|
|
"invoked program \"%1\" is missing, or you may have insufficient "
|
2010-04-23 12:12:22 +02:00
|
|
|
"permissions to invoke the program.")
|
2015-07-23 11:23:52 +02:00
|
|
|
.arg(m_interpreter);
|
2010-04-23 12:12:22 +02:00
|
|
|
case QProcess::Crashed:
|
|
|
|
|
return tr("The Pdb process crashed some time after starting "
|
|
|
|
|
"successfully.");
|
|
|
|
|
case QProcess::Timedout:
|
|
|
|
|
return tr("The last waitFor...() function timed out. "
|
|
|
|
|
"The state of QProcess is unchanged, and you can try calling "
|
|
|
|
|
"waitFor...() again.");
|
|
|
|
|
case QProcess::WriteError:
|
|
|
|
|
return tr("An error occurred when attempting to write "
|
|
|
|
|
"to the Pdb process. For example, the process may not be running, "
|
|
|
|
|
"or it may have closed its input channel.");
|
|
|
|
|
case QProcess::ReadError:
|
|
|
|
|
return tr("An error occurred when attempting to read from "
|
|
|
|
|
"the Pdb process. For example, the process may not be running.");
|
|
|
|
|
default:
|
2018-10-07 22:38:47 +03:00
|
|
|
return tr("An unknown error in the Pdb process occurred.") + ' ';
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::handlePdbFinished(int code, QProcess::ExitStatus type)
|
|
|
|
|
{
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage(QString("PDB PROCESS FINISHED, status %1, code %2").arg(type).arg(code));
|
2010-07-12 15:34:05 +02:00
|
|
|
notifyEngineSpontaneousShutdown();
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::readPdbStandardError()
|
|
|
|
|
{
|
2016-06-07 17:04:53 +02:00
|
|
|
QString err = QString::fromUtf8(m_proc.readAllStandardError());
|
2010-07-23 16:05:56 +02:00
|
|
|
//qWarning() << "Unexpected pdb stderr:" << err;
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage("Unexpected pdb stderr: " + err);
|
2010-07-23 16:05:56 +02:00
|
|
|
//handleOutput(err);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::readPdbStandardOutput()
|
|
|
|
|
{
|
2016-06-07 17:04:53 +02:00
|
|
|
QString out = QString::fromUtf8(m_proc.readAllStandardOutput());
|
2010-07-23 16:05:56 +02:00
|
|
|
handleOutput(out);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void PdbEngine::handleOutput(const QString &data)
|
2010-07-23 16:05:56 +02:00
|
|
|
{
|
|
|
|
|
m_inbuffer.append(data);
|
|
|
|
|
while (true) {
|
2015-08-24 12:40:52 +02:00
|
|
|
int pos = m_inbuffer.indexOf('\n');
|
2010-07-23 16:05:56 +02:00
|
|
|
if (pos == -1)
|
|
|
|
|
break;
|
2016-06-07 17:04:53 +02:00
|
|
|
QString response = m_inbuffer.left(pos).trimmed();
|
2015-08-24 12:40:52 +02:00
|
|
|
m_inbuffer = m_inbuffer.mid(pos + 1);
|
2015-02-13 18:37:45 +01:00
|
|
|
handleOutput2(response);
|
2010-07-23 16:05:56 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
void PdbEngine::handleOutput2(const QString &data)
|
2010-07-23 16:05:56 +02:00
|
|
|
{
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const QStringList lines = data.split('\n');
|
|
|
|
|
for (const QString &line : lines) {
|
2015-02-13 18:37:45 +01:00
|
|
|
GdbMi item;
|
|
|
|
|
item.fromString(line);
|
2015-02-13 16:46:27 +01:00
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
showMessage(line, LogOutput);
|
2015-02-13 14:46:35 +01:00
|
|
|
|
|
|
|
|
if (line.startsWith("stack={")) {
|
2015-02-13 18:37:45 +01:00
|
|
|
refreshStack(item);
|
2015-02-13 16:46:27 +01:00
|
|
|
} else if (line.startsWith("data={")) {
|
2015-02-13 18:37:45 +01:00
|
|
|
refreshLocals(item);
|
2015-02-13 16:46:27 +01:00
|
|
|
} else if (line.startsWith("modules=[")) {
|
2015-02-13 18:37:45 +01:00
|
|
|
refreshModules(item);
|
2015-02-13 16:46:27 +01:00
|
|
|
} else if (line.startsWith("symbols={")) {
|
2015-02-13 18:37:45 +01:00
|
|
|
refreshSymbols(item);
|
2015-08-24 12:40:52 +02:00
|
|
|
} else if (line.startsWith("location={")) {
|
|
|
|
|
refreshLocation(item);
|
2015-09-02 12:47:47 +02:00
|
|
|
} else if (line.startsWith("state=")) {
|
|
|
|
|
refreshState(item);
|
2015-02-13 16:46:27 +01:00
|
|
|
} else if (line.startsWith("Breakpoint")) {
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const int pos1 = line.indexOf(" at ");
|
2015-02-13 18:37:45 +01:00
|
|
|
QTC_ASSERT(pos1 != -1, continue);
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const QString bpnr = line.mid(11, pos1 - 11);
|
|
|
|
|
const int pos2 = line.lastIndexOf(':');
|
2015-02-13 18:37:45 +01:00
|
|
|
QTC_ASSERT(pos2 != -1, continue);
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const QString fileName = line.mid(pos1 + 4, pos2 - pos1 - 4);
|
2019-01-17 01:38:54 +01:00
|
|
|
const int lineNumber = line.midRef(pos2 + 1).toInt();
|
Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.
The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.
Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.
Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.
The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.
There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.
The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.
There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.
Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-31 12:30:48 +02:00
|
|
|
const Breakpoint bp = Utils::findOrDefault(breakHandler()->breakpoints(), [&](const Breakpoint &bp) {
|
|
|
|
|
return bp->parameters().isLocatedAt(fileName, lineNumber, bp->markerFileName())
|
|
|
|
|
|| bp->requestedParameters().isLocatedAt(fileName, lineNumber, bp->markerFileName());
|
|
|
|
|
});
|
|
|
|
|
QTC_ASSERT(bp, continue);
|
|
|
|
|
bp->setResponseId(bpnr);
|
|
|
|
|
bp->setFileName(fileName);
|
|
|
|
|
bp->setLineNumber(lineNumber);
|
|
|
|
|
bp->adjustMarker();
|
|
|
|
|
bp->setPending(false);
|
|
|
|
|
notifyBreakpointInsertOk(bp);
|
2018-10-16 15:25:55 +02:00
|
|
|
if (bp->needsChange()) {
|
|
|
|
|
bp->gotoState(BreakpointUpdateRequested, BreakpointInserted);
|
|
|
|
|
updateBreakpoint(bp);
|
|
|
|
|
// QTC_CHECK(!bp->needsChange());
|
|
|
|
|
}
|
2015-02-13 14:46:35 +01:00
|
|
|
}
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
2015-02-13 16:46:27 +01:00
|
|
|
|
2015-02-13 14:46:35 +01:00
|
|
|
void PdbEngine::refreshLocals(const GdbMi &vars)
|
|
|
|
|
{
|
|
|
|
|
WatchHandler *handler = watchHandler();
|
|
|
|
|
handler->resetValueCache();
|
2016-04-05 13:27:24 +02:00
|
|
|
handler->insertItems(vars);
|
2015-07-06 09:46:08 +02:00
|
|
|
handler->notifyUpdateFinished();
|
2015-02-13 14:46:35 +01:00
|
|
|
|
2018-08-23 15:21:43 +02:00
|
|
|
updateToolTips();
|
2015-02-13 14:46:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::refreshStack(const GdbMi &stack)
|
|
|
|
|
{
|
|
|
|
|
StackHandler *handler = stackHandler();
|
|
|
|
|
StackFrames frames;
|
2018-09-25 18:48:29 +02:00
|
|
|
for (const GdbMi &item : stack["frames"]) {
|
2015-02-13 14:46:35 +01:00
|
|
|
StackFrame frame;
|
2015-10-08 16:19:57 +02:00
|
|
|
frame.level = item["level"].data();
|
2016-06-07 17:04:53 +02:00
|
|
|
frame.file = item["file"].data();
|
|
|
|
|
frame.function = item["function"].data();
|
|
|
|
|
frame.module = item["function"].data();
|
2015-02-13 14:46:35 +01:00
|
|
|
frame.line = item["line"].toInt();
|
2015-10-08 16:19:57 +02:00
|
|
|
frame.address = item["address"].toAddress();
|
2015-02-13 14:46:35 +01:00
|
|
|
GdbMi usable = item["usable"];
|
|
|
|
|
if (usable.isValid())
|
|
|
|
|
frame.usable = usable.data().toInt();
|
|
|
|
|
else
|
|
|
|
|
frame.usable = QFileInfo(frame.file).isReadable();
|
|
|
|
|
frames.append(frame);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
2015-02-13 14:46:35 +01:00
|
|
|
bool canExpand = stack["hasmore"].toInt();
|
|
|
|
|
//action(ExpandStack)->setEnabled(canExpand);
|
|
|
|
|
handler->setFrames(frames, canExpand);
|
|
|
|
|
|
|
|
|
|
int index = stackHandler()->firstUsableIndex();
|
|
|
|
|
handler->setCurrentIndex(index);
|
|
|
|
|
if (index >= 0 && index < handler->stackSize())
|
|
|
|
|
gotoLocation(handler->frameAt(index));
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::updateAll()
|
2010-07-23 16:05:56 +02:00
|
|
|
{
|
2015-11-03 12:01:57 +01:00
|
|
|
runCommand({"stackListFrames"});
|
2015-02-13 14:46:35 +01:00
|
|
|
updateLocals();
|
2010-07-23 16:05:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PdbEngine::updateLocals()
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2015-02-13 14:46:35 +01:00
|
|
|
DebuggerCommand cmd("updateData");
|
|
|
|
|
cmd.arg("nativeMixed", isNativeMixedActive());
|
|
|
|
|
watchHandler()->appendFormatRequests(&cmd);
|
2015-09-14 12:53:35 +02:00
|
|
|
watchHandler()->appendWatchersAndTooltipRequests(&cmd);
|
2010-04-23 12:12:22 +02:00
|
|
|
|
2017-04-14 09:48:25 +02:00
|
|
|
const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
|
2015-02-13 14:46:35 +01:00
|
|
|
cmd.arg("passexceptions", alwaysVerbose);
|
|
|
|
|
cmd.arg("fancy", boolSetting(UseDebuggingHelpers));
|
|
|
|
|
|
|
|
|
|
//cmd.arg("resultvarname", m_resultVarName);
|
|
|
|
|
//m_lastDebuggableCommand = cmd;
|
|
|
|
|
//m_lastDebuggableCommand.args.replace("\"passexceptions\":0", "\"passexceptions\":1");
|
2015-07-23 11:23:52 +02:00
|
|
|
cmd.arg("frame", stackHandler()->currentIndex());
|
2015-02-13 14:46:35 +01:00
|
|
|
|
2015-03-17 13:26:20 +01:00
|
|
|
watchHandler()->notifyUpdateStarted();
|
2015-02-13 14:46:35 +01:00
|
|
|
runCommand(cmd);
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
2012-01-12 20:28:17 +01:00
|
|
|
bool PdbEngine::hasCapability(unsigned cap) const
|
2010-05-03 19:12:52 +02:00
|
|
|
{
|
2015-02-13 16:46:27 +01:00
|
|
|
return cap & (ReloadModuleCapability
|
|
|
|
|
| BreakConditionCapability
|
|
|
|
|
| ShowModuleSymbolsCapability);
|
2010-05-03 19:12:52 +02:00
|
|
|
}
|
|
|
|
|
|
2017-05-05 14:45:36 +02:00
|
|
|
DebuggerEngine *createPdbEngine()
|
2010-04-23 12:12:22 +02:00
|
|
|
{
|
2017-05-05 14:45:36 +02:00
|
|
|
return new PdbEngine;
|
2010-04-23 12:12:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|