pdbengine.cpp 17.4 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
hjk's avatar
hjk committed
2
**
3 4
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
hjk's avatar
hjk committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
hjk's avatar
hjk committed
7
**
hjk's avatar
hjk committed
8 9 10 11
** 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
12 13 14
** 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.
hjk's avatar
hjk committed
15
**
16 17 18 19 20 21 22
** 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.
con's avatar
con committed
23
**
hjk's avatar
hjk committed
24
****************************************************************************/
hjk's avatar
hjk committed
25 26 27

#include "pdbengine.h"

28 29 30 31 32 33
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerdialogs.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerprotocol.h>
#include <debugger/debuggertooltipmanager.h>
34
#include <debugger/threaddata.h>
35

36 37
#include <debugger/breakhandler.h>
#include <debugger/moduleshandler.h>
38
#include <debugger/procinterrupt.h>
39 40 41 42 43
#include <debugger/registerhandler.h>
#include <debugger/stackhandler.h>
#include <debugger/sourceutils.h>
#include <debugger/watchhandler.h>
#include <debugger/watchutils.h>
44

hjk's avatar
hjk committed
45
#include <utils/qtcassert.h>
hjk's avatar
hjk committed
46
#include <utils/qtcprocess.h>
hjk's avatar
hjk committed
47

48
#include <coreplugin/idocument.h>
hjk's avatar
hjk committed
49
#include <coreplugin/icore.h>
50
#include <coreplugin/messagebox.h>
hjk's avatar
hjk committed
51

52 53 54 55 56 57
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QTimer>
#include <QVariant>
58
#include <QJsonArray>
hjk's avatar
hjk committed
59

hjk's avatar
hjk committed
60
using namespace Core;
hjk's avatar
hjk committed
61 62 63 64

namespace Debugger {
namespace Internal {

65
PdbEngine::PdbEngine()
66
{
67
    setObjectName("PdbEngine");
68
}
hjk's avatar
hjk committed
69

70
void PdbEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages languages)
hjk's avatar
hjk committed
71
{
72 73
    if (!(languages & CppLanguage))
        return;
74
    QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
hjk's avatar
hjk committed
75
    if (state() == DebuggerNotReady) {
76
        showMessage("PDB PROCESS NOT RUNNING, PLAIN CMD IGNORED: " + command);
hjk's avatar
hjk committed
77 78
        return;
    }
79
    QTC_ASSERT(m_proc.state() == QProcess::Running, notifyEngineIll());
80
    postDirectCommand(command);
81 82
}

83
void PdbEngine::postDirectCommand(const QString &command)
84
{
85
    QTC_ASSERT(m_proc.state() == QProcess::Running, notifyEngineIll());
86 87
    showMessage(command, LogInput);
    m_proc.write(command.toUtf8() + '\n');
hjk's avatar
hjk committed
88 89
}

90 91
void PdbEngine::runCommand(const DebuggerCommand &cmd)
{
92 93 94 95
    if (state() == EngineSetupRequested) { // cmd has been triggered too early
        showMessage("IGNORED COMMAND: " + cmd.function);
        return;
    }
96
    QTC_ASSERT(m_proc.state() == QProcess::Running, notifyEngineIll());
97 98 99
    QString command = "qdebug('" + cmd.function + "'," + cmd.argsToPython() + ")";
    showMessage(command, LogInput);
    m_proc.write(command.toUtf8() + '\n');
100 101
}

hjk's avatar
hjk committed
102
void PdbEngine::shutdownInferior()
hjk's avatar
hjk committed
103
{
hjk's avatar
hjk committed
104
    QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
105
    notifyInferiorShutdownFinished();
hjk's avatar
hjk committed
106 107
}

hjk's avatar
hjk committed
108
void PdbEngine::shutdownEngine()
hjk's avatar
hjk committed
109
{
hjk's avatar
hjk committed
110
    QTC_ASSERT(state() == EngineShutdownRequested, qDebug() << state());
111
    m_proc.kill();
hjk's avatar
hjk committed
112 113
}

hjk's avatar
hjk committed
114
void PdbEngine::setupEngine()
hjk's avatar
hjk committed
115
{
hjk's avatar
hjk committed
116
    QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
hjk's avatar
hjk committed
117

hjk's avatar
hjk committed
118 119
    m_interpreter = runParameters().interpreter;
    QString bridge = ICore::resourcePath() + QLatin1String("/debugger/pdbbridge.py");
hjk's avatar
hjk committed
120

121
    connect(&m_proc, &QProcess::errorOccurred, this, &PdbEngine::handlePdbError);
122
    connect(&m_proc, static_cast<void(QProcess::*)(int,QProcess::ExitStatus)>(&QProcess::finished),
123
        this, &PdbEngine::handlePdbFinished);
124
    connect(&m_proc, &QProcess::readyReadStandardOutput,
125
        this, &PdbEngine::readPdbStandardOutput);
126
    connect(&m_proc, &QProcess::readyReadStandardError,
127 128
        this, &PdbEngine::readPdbStandardError);

hjk's avatar
hjk committed
129 130 131
    QFile scriptFile(runParameters().mainScript);
    if (!scriptFile.open(QIODevice::ReadOnly|QIODevice::Text)) {
        AsynchronousMessageBox::critical(tr("Python Error"),
132
            QString("Cannot open script file %1:\n%2").
hjk's avatar
hjk committed
133 134 135 136
               arg(scriptFile.fileName(), scriptFile.errorString()));
        notifyEngineSetupFailed();
    }

137
    QStringList args = {bridge, scriptFile.fileName()};
138
    args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory));
139
    showMessage("STARTING " + m_interpreter + QLatin1Char(' ') + args.join(QLatin1Char(' ')));
140
    m_proc.setEnvironment(runParameters().debugger.environment.toStringList());
hjk's avatar
hjk committed
141
    m_proc.start(m_interpreter, args);
hjk's avatar
hjk committed
142

143
    if (!m_proc.waitForStarted()) {
144
        const QString msg = tr("Unable to start pdb \"%1\": %2")
hjk's avatar
hjk committed
145
            .arg(m_interpreter, m_proc.errorString());
146
        notifyEngineSetupFailed();
147
        showMessage("ADAPTER START FAILED");
hjk's avatar
hjk committed
148 149
        if (!msg.isEmpty())
            ICore::showWarningWithOptions(tr("Adapter start failed"), msg);
150
        notifyEngineSetupFailed();
hjk's avatar
hjk committed
151 152
        return;
    }
153
    notifyEngineSetupOk();
hjk's avatar
hjk committed
154 155 156
}

void PdbEngine::runEngine()
hjk's avatar
hjk committed
157
{
158
    QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
hjk's avatar
hjk committed
159
    showStatusMessage(tr("Running requested..."), 5000);
160 161
    attemptBreakpointSynchronization();
    notifyEngineRunAndInferiorStopOk();
162
    updateAll();
hjk's avatar
hjk committed
163 164 165 166
}

void PdbEngine::interruptInferior()
{
167 168
    QString error;
    interruptProcess(m_proc.processId(), GdbEngineType, &error);
hjk's avatar
hjk committed
169 170 171 172
}

void PdbEngine::executeStep()
{
173 174
    notifyInferiorRunRequested();
    notifyInferiorRunOk();
hjk's avatar
hjk committed
175
    postDirectCommand("step");
hjk's avatar
hjk committed
176 177 178 179
}

void PdbEngine::executeStepI()
{
180 181
    notifyInferiorRunRequested();
    notifyInferiorRunOk();
hjk's avatar
hjk committed
182
    postDirectCommand("step");
hjk's avatar
hjk committed
183 184 185 186
}

void PdbEngine::executeStepOut()
{
187 188
    notifyInferiorRunRequested();
    notifyInferiorRunOk();
hjk's avatar
hjk committed
189
    postDirectCommand("return");
hjk's avatar
hjk committed
190 191 192 193
}

void PdbEngine::executeNext()
{
194 195
    notifyInferiorRunRequested();
    notifyInferiorRunOk();
hjk's avatar
hjk committed
196
    postDirectCommand("next");
hjk's avatar
hjk committed
197 198 199 200
}

void PdbEngine::executeNextI()
{
201 202
    notifyInferiorRunRequested();
    notifyInferiorRunOk();
hjk's avatar
hjk committed
203
    postDirectCommand("next");
hjk's avatar
hjk committed
204 205 206 207
}

void PdbEngine::continueInferior()
{
208 209
    notifyInferiorRunRequested();
    notifyInferiorRunOk();
hjk's avatar
hjk committed
210
    // Callback will be triggered e.g. when breakpoint is hit.
hjk's avatar
hjk committed
211
    postDirectCommand("continue");
hjk's avatar
hjk committed
212 213
}

214
void PdbEngine::executeRunToLine(const ContextData &data)
hjk's avatar
hjk committed
215
{
216
    Q_UNUSED(data)
hjk's avatar
hjk committed
217
    QTC_CHECK("FIXME:  PdbEngine::runToLineExec()" && false);
hjk's avatar
hjk committed
218 219 220 221 222
}

void PdbEngine::executeRunToFunction(const QString &functionName)
{
    Q_UNUSED(functionName)
hjk's avatar
hjk committed
223
    QTC_CHECK("FIXME:  PdbEngine::runToFunctionExec()" && false);
hjk's avatar
hjk committed
224 225
}

226
void PdbEngine::executeJumpToLine(const ContextData &data)
hjk's avatar
hjk committed
227
{
228
    Q_UNUSED(data)
hjk's avatar
hjk committed
229
    QTC_CHECK("FIXME:  PdbEngine::jumpToLineExec()" && false);
hjk's avatar
hjk committed
230 231 232 233
}

void PdbEngine::activateFrame(int frameIndex)
{
hjk's avatar
hjk committed
234
    if (state() != InferiorStopOk && state() != InferiorUnrunnable)
hjk's avatar
hjk committed
235 236
        return;

237 238
    StackHandler *handler = stackHandler();
    QTC_ASSERT(frameIndex < handler->stackSize(), return);
hjk's avatar
hjk committed
239
    handler->setCurrentIndex(frameIndex);
240
    gotoLocation(handler->currentFrame());
hjk's avatar
hjk committed
241
    updateLocals();
hjk's avatar
hjk committed
242 243
}

244
void PdbEngine::selectThread(ThreadId threadId)
hjk's avatar
hjk committed
245
{
246
    Q_UNUSED(threadId)
hjk's avatar
hjk committed
247 248
}

249
bool PdbEngine::acceptsBreakpoint(Breakpoint bp) const
hjk's avatar
hjk committed
250
{
251
    const QString fileName = bp.fileName();
252
    return fileName.endsWith(".py");
hjk's avatar
hjk committed
253 254
}

255
void PdbEngine::insertBreakpoint(Breakpoint bp)
hjk's avatar
hjk committed
256
{
257 258
    QTC_CHECK(bp.state() == BreakpointInsertRequested);
    bp.notifyBreakpointInsertProceeding();
hjk's avatar
hjk committed
259

260
    QString loc;
261
    if (bp.type() == BreakpointByFunction)
262
        loc = bp.functionName();
hjk's avatar
hjk committed
263
    else
264
        loc = bp.fileName() + ':' + QString::number(bp.lineNumber());
hjk's avatar
hjk committed
265

hjk's avatar
hjk committed
266
    postDirectCommand("break " + loc);
hjk's avatar
hjk committed
267 268
}

269
void PdbEngine::removeBreakpoint(Breakpoint bp)
hjk's avatar
hjk committed
270
{
271 272 273
    QTC_CHECK(bp.state() == BreakpointRemoveRequested);
    bp.notifyBreakpointRemoveProceeding();
    BreakpointResponse br = bp.response();
274 275
    showMessage(QString("DELETING BP %1 IN %2").arg(br.id.toString()).arg(bp.fileName()));
    postDirectCommand("clear " + br.id.toString());
hjk's avatar
hjk committed
276
    // Pretend it succeeds without waiting for response.
277
    bp.notifyBreakpointRemoveOk();
hjk's avatar
hjk committed
278 279
}

hjk's avatar
hjk committed
280 281 282 283 284 285 286 287 288 289 290
void PdbEngine::loadSymbols(const QString &moduleName)
{
    Q_UNUSED(moduleName)
}

void PdbEngine::loadAllSymbols()
{
}

void PdbEngine::reloadModules()
{
291
    runCommand({"listModules"});
292 293
}

hjk's avatar
hjk committed
294
void PdbEngine::refreshModules(const GdbMi &modules)
295
{
296 297
    ModulesHandler *handler = modulesHandler();
    handler->beginUpdateAll();
hjk's avatar
hjk committed
298
    foreach (const GdbMi &item, modules.children()) {
299
        Module module;
300 301 302
        module.moduleName = item["name"].data();
        QString path = item["value"].data();
        int pos = path.indexOf("' from '");
303 304 305 306
        if (pos != -1) {
            path = path.mid(pos + 8);
            if (path.size() >= 2)
                path.chop(2);
307 308 309
        } else if (path.startsWith("<module '")
                && path.endsWith("' (built-in)>")) {
            path = "(builtin)";
310 311
        }
        module.modulePath = path;
312
        handler->updateModule(module);
313
    }
314
    handler->endUpdateAll();
hjk's avatar
hjk committed
315 316
}

317
void PdbEngine::requestModuleSymbols(const QString &moduleName)
hjk's avatar
hjk committed
318
{
hjk's avatar
hjk committed
319 320 321
    DebuggerCommand cmd("listSymbols");
    cmd.arg("module", moduleName);
    runCommand(cmd);
hjk's avatar
hjk committed
322 323
}

324 325
void PdbEngine::refreshState(const GdbMi &reportedState)
{
326
    QString newState = reportedState.data();
327 328 329 330 331 332 333 334
    if (newState == "stopped") {
        notifyInferiorSpontaneousStop();
        updateAll();
    } else if (newState == "inferiorexited") {
        notifyInferiorExited();
    }
}

335 336 337
void PdbEngine::refreshLocation(const GdbMi &reportedLocation)
{
    StackFrame frame;
338
    frame.file = reportedLocation["file"].data();
339
    frame.line = reportedLocation["line"].toInt();
340
    frame.usable = QFileInfo(frame.file).isReadable();
341
    if (state() == InferiorRunOk) {
342
        showMessage(QString("STOPPED AT: %1:%2").arg(frame.file).arg(frame.line));
343 344 345 346 347 348
        gotoLocation(frame);
        notifyInferiorSpontaneousStop();
        updateAll();
    }
}

hjk's avatar
hjk committed
349
void PdbEngine::refreshSymbols(const GdbMi &symbols)
350
{
351
    QString moduleName = symbols["module"].data();
hjk's avatar
hjk committed
352 353
    Symbols syms;
    foreach (const GdbMi &item, symbols["symbols"].children()) {
354
        Symbol symbol;
355
        symbol.name = item["name"].data();
hjk's avatar
hjk committed
356
        syms.append(symbol);
357
    }
hjk's avatar
hjk committed
358
    Internal::showModuleSymbols(moduleName, syms);
359
}
hjk's avatar
hjk committed
360

361
bool PdbEngine::canHandleToolTip(const DebuggerToolTipContext &) const
hjk's avatar
hjk committed
362
{
363
    return state() == InferiorStopOk;
hjk's avatar
hjk committed
364 365
}

366
void PdbEngine::assignValueInDebugger(WatchItem *, const QString &expression, const QVariant &value)
367 368 369 370 371
{
    //DebuggerCommand cmd("assignValue");
    //cmd.arg("expression", expression);
    //cmd.arg("value", value.toString());
    //runCommand(cmd);
372
    postDirectCommand("global " + expression + ';' + expression + "=" + value.toString());
hjk's avatar
hjk committed
373 374 375
    updateLocals();
}

376
void PdbEngine::updateItem(const QString &iname)
hjk's avatar
hjk committed
377
{
378
    Q_UNUSED(iname);
hjk's avatar
hjk committed
379 380 381 382 383
    updateAll();
}

void PdbEngine::handlePdbError(QProcess::ProcessError error)
{
384
    showMessage("HANDLE PDB ERROR");
hjk's avatar
hjk committed
385 386 387 388 389 390 391 392
    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:
393
        //setState(EngineShutdownRequested, true);
394
        m_proc.kill();
hjk's avatar
hjk committed
395
        AsynchronousMessageBox::critical(tr("Pdb I/O Error"), errorMessage(error));
hjk's avatar
hjk committed
396 397 398 399 400 401 402 403 404
        break;
    }
}

QString PdbEngine::errorMessage(QProcess::ProcessError error) const
{
    switch (error) {
        case QProcess::FailedToStart:
            return tr("The Pdb process failed to start. Either the "
405
                "invoked program \"%1\" is missing, or you may have insufficient "
hjk's avatar
hjk committed
406
                "permissions to invoke the program.")
hjk's avatar
hjk committed
407
                .arg(m_interpreter);
hjk's avatar
hjk committed
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
        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:
423
            return tr("An unknown error in the Pdb process occurred.") + QLatin1Char(' ');
hjk's avatar
hjk committed
424 425 426 427 428
    }
}

void PdbEngine::handlePdbFinished(int code, QProcess::ExitStatus type)
{
429
    showMessage(QString("PDB PROCESS FINISHED, status %1, code %2").arg(type).arg(code));
430
    notifyEngineSpontaneousShutdown();
hjk's avatar
hjk committed
431 432 433 434
}

void PdbEngine::readPdbStandardError()
{
435
    QString err = QString::fromUtf8(m_proc.readAllStandardError());
436
    //qWarning() << "Unexpected pdb stderr:" << err;
437
    showMessage("Unexpected pdb stderr: " + err);
438
    //handleOutput(err);
hjk's avatar
hjk committed
439 440 441 442
}

void PdbEngine::readPdbStandardOutput()
{
443
    QString out = QString::fromUtf8(m_proc.readAllStandardOutput());
444 445 446
    handleOutput(out);
}

447
void PdbEngine::handleOutput(const QString &data)
448 449 450
{
    m_inbuffer.append(data);
    while (true) {
451
        int pos = m_inbuffer.indexOf('\n');
452 453
        if (pos == -1)
            break;
454
        QString response = m_inbuffer.left(pos).trimmed();
455
        m_inbuffer = m_inbuffer.mid(pos + 1);
hjk's avatar
hjk committed
456
        handleOutput2(response);
457 458 459
    }
}

460
void PdbEngine::handleOutput2(const QString &data)
461
{
462
    foreach (QString line, data.split('\n')) {
463

hjk's avatar
hjk committed
464 465
        GdbMi item;
        item.fromString(line);
hjk's avatar
hjk committed
466

467
        showMessage(line, LogOutput);
468 469

        if (line.startsWith("stack={")) {
hjk's avatar
hjk committed
470
            refreshStack(item);
hjk's avatar
hjk committed
471
        } else if (line.startsWith("data={")) {
hjk's avatar
hjk committed
472
            refreshLocals(item);
hjk's avatar
hjk committed
473
        } else if (line.startsWith("modules=[")) {
hjk's avatar
hjk committed
474
            refreshModules(item);
hjk's avatar
hjk committed
475
        } else if (line.startsWith("symbols={")) {
hjk's avatar
hjk committed
476
            refreshSymbols(item);
477 478
        } else if (line.startsWith("location={")) {
            refreshLocation(item);
479 480
        } else if (line.startsWith("state=")) {
            refreshState(item);
hjk's avatar
hjk committed
481
        } else if (line.startsWith("Breakpoint")) {
hjk's avatar
hjk committed
482 483
            int pos1 = line.indexOf(" at ");
            QTC_ASSERT(pos1 != -1, continue);
484
            QString bpnr = line.mid(11, pos1 - 11);
hjk's avatar
hjk committed
485 486 487 488
            int pos2 = line.lastIndexOf(':');
            QTC_ASSERT(pos2 != -1, continue);
            BreakpointResponse br;
            br.id = BreakpointResponseId(bpnr);
489 490
            br.fileName = line.mid(pos1 + 4, pos2 - pos1 - 4);
            br.lineNumber = line.mid(pos2 + 1).toInt();
hjk's avatar
hjk committed
491 492 493 494 495 496
            Breakpoint bp = breakHandler()->findBreakpointByFileAndLine(br.fileName, br.lineNumber, false);
            if (bp.isValid()) {
                bp.setResponse(br);
                QTC_CHECK(!bp.needsChange());
                bp.notifyBreakpointInsertOk();
            }
497
        }
hjk's avatar
hjk committed
498 499
    }
}
hjk's avatar
hjk committed
500

501 502 503 504
void PdbEngine::refreshLocals(const GdbMi &vars)
{
    WatchHandler *handler = watchHandler();
    handler->resetValueCache();
505
    handler->insertItems(vars);
506
    handler->notifyUpdateFinished();
507 508 509 510 511 512 513 514 515 516

    DebuggerToolTipManager::updateEngine(this);
}

void PdbEngine::refreshStack(const GdbMi &stack)
{
    StackHandler *handler = stackHandler();
    StackFrames frames;
    foreach (const GdbMi &item, stack["frames"].children()) {
        StackFrame frame;
517
        frame.level = item["level"].data();
518 519 520
        frame.file = item["file"].data();
        frame.function = item["function"].data();
        frame.module = item["function"].data();
521
        frame.line = item["line"].toInt();
522
        frame.address = item["address"].toAddress();
523 524 525 526 527 528
        GdbMi usable = item["usable"];
        if (usable.isValid())
            frame.usable = usable.data().toInt();
        else
            frame.usable = QFileInfo(frame.file).isReadable();
        frames.append(frame);
hjk's avatar
hjk committed
529
    }
530 531 532 533 534 535 536 537
    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));
hjk's avatar
hjk committed
538 539 540
}

void PdbEngine::updateAll()
541
{
542
    runCommand({"stackListFrames"});
543
    updateLocals();
544 545 546
}

void PdbEngine::updateLocals()
hjk's avatar
hjk committed
547
{
548 549 550
    DebuggerCommand cmd("updateData");
    cmd.arg("nativeMixed", isNativeMixedActive());
    watchHandler()->appendFormatRequests(&cmd);
551
    watchHandler()->appendWatchersAndTooltipRequests(&cmd);
hjk's avatar
hjk committed
552

553
    const static bool alwaysVerbose = qEnvironmentVariableIsSet("QTC_DEBUGGER_PYTHON_VERBOSE");
554 555 556 557 558 559
    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");
hjk's avatar
hjk committed
560
    cmd.arg("frame", stackHandler()->currentIndex());
561

562
    watchHandler()->notifyUpdateStarted();
563
    runCommand(cmd);
hjk's avatar
hjk committed
564 565
}

566
bool PdbEngine::hasCapability(unsigned cap) const
567
{
hjk's avatar
hjk committed
568 569 570
    return cap & (ReloadModuleCapability
              | BreakConditionCapability
              | ShowModuleSymbolsCapability);
571 572
}

573
DebuggerEngine *createPdbEngine()
hjk's avatar
hjk committed
574
{
575
    return new PdbEngine;
hjk's avatar
hjk committed
576 577 578 579
}

} // namespace Internal
} // namespace Debugger