Commit 3b2d2eae authored by hjk's avatar hjk

Debugger: Re-work breakpoint storage handling

The actual data is now in a TreeModel. As interface to
individual breakpoints there's a new Breakpoint class
essentially providing a checked handle.

On the user code side breakHandler()->foo(bpId) is
replaced by bp.foo().

Change-Id: I82f435bad6301fce85a1d82bf6bf39e9ddba511e
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent b88cdef0
This diff is collapsed.
This diff is collapsed.
......@@ -199,7 +199,6 @@ inline void operator|=(BreakpointParts &p, BreakpointParts r)
p = BreakpointParts(int(p) | int(r));
}
class BreakpointParameters
{
public:
......@@ -257,8 +256,6 @@ public:
int correctedLineNumber; //!< Line number as seen by gdb.
};
typedef QList<BreakpointModelId> BreakpointModelIds;
inline uint qHash(const Debugger::Internal::BreakpointModelId &id)
{
return id.toInternalId();
......
This diff is collapsed.
......@@ -31,7 +31,7 @@
#ifndef DEBUGGER_BREAKWINDOW_H
#define DEBUGGER_BREAKWINDOW_H
#include "breakpoint.h"
#include "breakhandler.h"
#include <utils/basetreeview.h>
namespace Debugger {
......@@ -44,7 +44,7 @@ class BreakTreeView : public Utils::BaseTreeView
public:
BreakTreeView();
static void editBreakpoint(BreakpointModelId id, QWidget *parent);
static void editBreakpoint(Breakpoint bp, QWidget *parent);
private slots:
void showAddressColumn(bool on);
......@@ -55,12 +55,12 @@ private:
void keyPressEvent(QKeyEvent *ev);
void mouseDoubleClickEvent(QMouseEvent *ev);
void deleteBreakpoints(const BreakpointModelIds &ids);
void deleteBreakpoints(const Breakpoints &bps);
void deleteAllBreakpoints();
void addBreakpoint();
void editBreakpoints(const BreakpointModelIds &ids);
void associateBreakpoint(const BreakpointModelIds &ids, int thread);
void setBreakpointsEnabled(const BreakpointModelIds &ids, bool enabled);
void editBreakpoints(const Breakpoints &bps);
void associateBreakpoint(const Breakpoints &bps, int thread);
void setBreakpointsEnabled(const Breakpoints &bps, bool enabled);
};
} // namespace Internal
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
#define DEBUGGER_CDBENGINE_H
#include <debugger/debuggerengine.h>
#include <debugger/breakhandler.h>
#include <projectexplorer/devicesupport/idevice.h>
......@@ -111,7 +112,7 @@ public:
virtual void selectThread(ThreadId threadId);
virtual bool stateAcceptsBreakpointChanges() const;
virtual bool acceptsBreakpoint(BreakpointModelId id) const;
virtual bool acceptsBreakpoint(Breakpoint bp) const;
virtual void attemptBreakpointSynchronization();
virtual void fetchDisassembler(DisassemblerAgent *agent);
......
......@@ -1206,9 +1206,8 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
if (state == DebuggerFinished) {
// Give up ownership on claimed breakpoints.
BreakHandler *handler = breakHandler();
foreach (BreakpointModelId id, handler->engineBreakpointIds(this))
handler->notifyBreakpointReleased(id);
foreach (Breakpoint bp, breakHandler()->engineBreakpoints(this))
bp.notifyBreakpointReleased();
DebuggerToolTipManager::deregisterEngine(this);
}
......@@ -1499,36 +1498,36 @@ void DebuggerEngine::attemptBreakpointSynchronization()
BreakHandler *handler = breakHandler();
foreach (BreakpointModelId id, handler->unclaimedBreakpointIds()) {
foreach (Breakpoint bp, handler->unclaimedBreakpoints()) {
// Take ownership of the breakpoint. Requests insertion.
if (acceptsBreakpoint(id)) {
if (acceptsBreakpoint(bp)) {
showMessage(_("TAKING OWNERSHIP OF BREAKPOINT %1 IN STATE %2")
.arg(id.toString()).arg(handler->state(id)));
handler->setEngine(id, this);
.arg(bp.id().toString()).arg(bp.state()));
bp.setEngine(this);
} else {
showMessage(_("BREAKPOINT %1 IN STATE %2 IS NOT ACCEPTABLE")
.arg(id.toString()).arg(handler->state(id)));
.arg(bp.id().toString()).arg(bp.state()));
}
}
bool done = true;
foreach (BreakpointModelId id, handler->engineBreakpointIds(this)) {
switch (handler->state(id)) {
foreach (Breakpoint bp, handler->engineBreakpoints(this)) {
switch (bp.state()) {
case BreakpointNew:
// Should not happen once claimed.
QTC_CHECK(false);
continue;
case BreakpointInsertRequested:
done = false;
insertBreakpoint(id);
insertBreakpoint(bp);
continue;
case BreakpointChangeRequested:
done = false;
changeBreakpoint(id);
changeBreakpoint(bp);
continue;
case BreakpointRemoveRequested:
done = false;
removeBreakpoint(id);
removeBreakpoint(bp);
continue;
case BreakpointChangeProceeding:
case BreakpointInsertProceeding:
......@@ -1545,7 +1544,7 @@ void DebuggerEngine::attemptBreakpointSynchronization()
QTC_CHECK(false);
continue;
}
QTC_ASSERT(false, qDebug() << "UNKNOWN STATE" << id << state());
QTC_ASSERT(false, qDebug() << "UNKNOWN STATE" << bp.id() << state());
}
if (done) {
......@@ -1556,24 +1555,33 @@ void DebuggerEngine::attemptBreakpointSynchronization()
}
}
void DebuggerEngine::insertBreakpoint(BreakpointModelId id)
bool DebuggerEngine::acceptsBreakpoint(Breakpoint bp) const
{
BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointInsertRequested, qDebug() << id << this << state);
Q_UNUSED(bp);
return false;
}
void DebuggerEngine::insertBreakpoint(Breakpoint bp)
{
BreakpointState state = bp.state();
QTC_ASSERT(state == BreakpointInsertRequested,
qDebug() << bp.id() << this << state);
QTC_CHECK(false);
}
void DebuggerEngine::removeBreakpoint(BreakpointModelId id)
void DebuggerEngine::removeBreakpoint(Breakpoint bp)
{
BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointRemoveRequested, qDebug() << id << this << state);
BreakpointState state = bp.state();
QTC_ASSERT(state == BreakpointRemoveRequested,
qDebug() << bp.id() << this << state);
QTC_CHECK(false);
}
void DebuggerEngine::changeBreakpoint(BreakpointModelId id)
void DebuggerEngine::changeBreakpoint(Breakpoint bp)
{
BreakpointState state = breakHandler()->state(id);
QTC_ASSERT(state == BreakpointChangeRequested, qDebug() << id << this << state);
BreakpointState state = bp.state();
QTC_ASSERT(state == BreakpointChangeRequested,
qDebug() << bp.id() << this << state);
QTC_CHECK(false);
}
......@@ -1652,56 +1660,6 @@ bool DebuggerEngine::isDying() const
return targetState() == DebuggerFinished;
}
QString DebuggerEngine::msgWatchpointByExpressionTriggered(BreakpointModelId id,
const int number, const QString &expr)
{
return id
? tr("Data breakpoint %1 (%2) at %3 triggered.")
.arg(id.toString()).arg(number).arg(expr)
: tr("Internal data breakpoint %1 at %2 triggered.")
.arg(number).arg(expr);
}
QString DebuggerEngine::msgWatchpointByExpressionTriggered(BreakpointModelId id,
const int number, const QString &expr, const QString &threadId)
{
return id
? tr("Data breakpoint %1 (%2) at %3 in thread %4 triggered.")
.arg(id.toString()).arg(number).arg(expr).arg(threadId)
: tr("Internal data breakpoint %1 at %2 in thread %3 triggered.")
.arg(number).arg(expr).arg(threadId);
}
QString DebuggerEngine::msgWatchpointByAddressTriggered(BreakpointModelId id,
const int number, quint64 address)
{
return id
? tr("Data breakpoint %1 (%2) at 0x%3 triggered.")
.arg(id.toString()).arg(number).arg(address, 0, 16)
: tr("Internal data breakpoint %1 at 0x%2 triggered.")
.arg(number).arg(address, 0, 16);
}
QString DebuggerEngine::msgWatchpointByAddressTriggered(BreakpointModelId id,
const int number, quint64 address, const QString &threadId)
{
return id
? tr("Data breakpoint %1 (%2) at 0x%3 in thread %4 triggered.")
.arg(id.toString()).arg(number).arg(address, 0, 16).arg(threadId)
: tr("Internal data breakpoint %1 at 0x%2 in thread %3 triggered.")
.arg(id.toString()).arg(number).arg(address, 0, 16).arg(threadId);
}
QString DebuggerEngine::msgBreakpointTriggered(BreakpointModelId id,
const int number, const QString &threadId)
{
return id
? tr("Stopped at breakpoint %1 (%2) in thread %3.")
.arg(id.toString()).arg(number).arg(threadId)
: tr("Stopped at internal breakpoint %1 in thread %2.")
.arg(number).arg(threadId);
}
QString DebuggerEngine::msgStopped(const QString &reason)
{
return reason.isEmpty() ? tr("Stopped.") : tr("Stopped: \"%1\"").arg(reason);
......
......@@ -34,7 +34,6 @@
#include "debugger_global.h"
#include "debuggerconstants.h"
#include "debuggerstartparameters.h"
#include "breakpoint.h" // For BreakpointModelId.
#include "threaddata.h" // For ThreadId.
#include <QObject>
......@@ -71,7 +70,7 @@ class StackFrame;
class SourceFilesHandler;
class ThreadsHandler;
class WatchHandler;
class BreakpointParameters;
class Breakpoint;
class QmlAdapter;
class QmlCppEngine;
class DebuggerToolTipContext;
......@@ -193,13 +192,12 @@ public:
virtual void createSnapshot();
virtual void updateAll();
typedef Internal::BreakpointModelId BreakpointModelId;
virtual bool stateAcceptsBreakpointChanges() const { return true; }
virtual void attemptBreakpointSynchronization();
virtual bool acceptsBreakpoint(BreakpointModelId id) const = 0;
virtual void insertBreakpoint(BreakpointModelId id); // FIXME: make pure
virtual void removeBreakpoint(BreakpointModelId id); // FIXME: make pure
virtual void changeBreakpoint(BreakpointModelId id); // FIXME: make pure
virtual bool acceptsBreakpoint(Breakpoint bp) const = 0;
virtual void insertBreakpoint(Breakpoint bp); // FIXME: make pure
virtual void removeBreakpoint(Breakpoint bp); // FIXME: make pure
virtual void changeBreakpoint(Breakpoint bp); // FIXME: make pure
virtual bool acceptsDebuggerCommands() const { return true; }
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
......@@ -355,16 +353,6 @@ protected:
DebuggerRunControl *runControl() const;
static QString msgWatchpointByAddressTriggered(BreakpointModelId id,
int number, quint64 address);
static QString msgWatchpointByAddressTriggered(BreakpointModelId id,
int number, quint64 address, const QString &threadId);
static QString msgWatchpointByExpressionTriggered(BreakpointModelId id,
int number, const QString &expr);
static QString msgWatchpointByExpressionTriggered(BreakpointModelId id,
int number, const QString &expr, const QString &threadId);
static QString msgBreakpointTriggered(BreakpointModelId id,
int number, const QString &threadId);
static QString msgStopped(const QString &reason = QString());
static QString msgStoppedBySignal(const QString &meaning, const QString &name);
static QString msgStoppedByException(const QString &description,
......
This diff is collapsed.
......@@ -148,10 +148,9 @@ void DebuggerRunControl::start()
if (m_engine->startParameters().startMode == StartInternal) {
QStringList unhandledIds;
foreach (const BreakpointModelId &id, breakHandler()->allBreakpointIds()) {
if (m_engine->breakHandler()->breakpointData(id).enabled
&& !m_engine->acceptsBreakpoint(id))
unhandledIds.append(id.toString());
foreach (Breakpoint bp, breakHandler()->allBreakpoints()) {
if (bp.isEnabled() && !m_engine->acceptsBreakpoint(bp))
unhandledIds.append(bp.id().toString());
}
if (!unhandledIds.isEmpty()) {
QString warningMessage =
......
......@@ -332,9 +332,8 @@ void DisassemblerAgent::updateBreakpointMarkers()
if (!d->document)
return;
BreakHandler *handler = breakHandler();
BreakpointModelIds ids = handler->engineBreakpointIds(d->engine);
if (ids.isEmpty())
Breakpoints bps = breakHandler()->engineBreakpoints(d->engine);
if (bps.isEmpty())
return;
const DisassemblerLines contents = d->contentsAtCurrentLocation();
......@@ -342,15 +341,15 @@ void DisassemblerAgent::updateBreakpointMarkers()
d->document->removeMark(marker);
qDeleteAll(d->breakpointMarks);
d->breakpointMarks.clear();
foreach (BreakpointModelId id, ids) {
const quint64 address = handler->response(id).address;
foreach (Breakpoint bp, bps) {
const quint64 address = bp.response().address;
if (!address)
continue;
const int lineNumber = contents.lineForAddress(address);
if (!lineNumber)
continue;
TextMark *marker = new TextMark(QString(), lineNumber);
marker->setIcon(handler->icon(id));
marker->setIcon(bp.icon());
marker->setPriority(TextMark::NormalPriority);
d->breakpointMarks.append(marker);
d->document->addMark(marker);
......
This diff is collapsed.
......@@ -33,6 +33,7 @@
#include <debugger/debuggerengine.h>
#include <debugger/breakhandler.h>
#include <debugger/watchhandler.h>
#include <debugger/watchutils.h>
#include <debugger/debuggertooltipmanager.h>
......@@ -55,6 +56,8 @@ class DebugInfoTaskHandler;
class GdbResponse;
class GdbMi;
class MemoryAgentCookie;
class BreakpointParameters;
class BreakpointResponse;
class WatchData;
class DisassemblerAgentCookie;
......@@ -259,10 +262,10 @@ private: ////////// Inferior Management //////////
// This should be always the last call in a function.
bool stateAcceptsBreakpointChanges() const;
bool acceptsBreakpoint(BreakpointModelId id) const;
void insertBreakpoint(BreakpointModelId id);
void removeBreakpoint(BreakpointModelId id);
void changeBreakpoint(BreakpointModelId id);
bool acceptsBreakpoint(Breakpoint bp) const;
void insertBreakpoint(Breakpoint bp);
void removeBreakpoint(Breakpoint bp);
void changeBreakpoint(Breakpoint bp);
void executeStep();
void executeStepOut();
......@@ -314,10 +317,10 @@ private: ////////// View & Data Stuff //////////
void handleBreakLineNumber(const GdbResponse &response);
void handleWatchInsert(const GdbResponse &response);
void handleCatchInsert(const GdbResponse &response);
void handleBkpt(const GdbMi &bkpt, const BreakpointModelId &id);
void handleBkpt(const GdbMi &bkpt, Breakpoint bp);
void updateResponse(BreakpointResponse &response, const GdbMi &bkpt);
QByteArray breakpointLocation(BreakpointModelId id); // For gdb/MI.
QByteArray breakpointLocation2(BreakpointModelId id); // For gdb/CLI fallback.
QByteArray breakpointLocation(const BreakpointParameters &data); // For gdb/MI.
QByteArray breakpointLocation2(const BreakpointParameters &data); // For gdb/CLI fallback.
QString breakLocation(const QString &file) const;
//
......
......@@ -528,33 +528,32 @@ void LldbEngine::selectThread(ThreadId threadId)
runCommand(Command("selectThread").arg("id", threadId.raw()));
}
bool LldbEngine::acceptsBreakpoint(BreakpointModelId id) const
bool LldbEngine::acceptsBreakpoint(Breakpoint bp) const
{
return breakHandler()->breakpointData(id).isCppBreakpoint()
&& startParameters().startMode != AttachCore;
return bp.parameters().isCppBreakpoint() && startParameters().startMode != AttachCore;
}
bool LldbEngine::attemptBreakpointSynchronizationHelper(Command *cmd)
{
BreakHandler *handler = breakHandler();
foreach (BreakpointModelId id, handler->unclaimedBreakpointIds()) {
foreach (Breakpoint bp, handler->unclaimedBreakpoints()) {
// Take ownership of the breakpoint. Requests insertion.
if (acceptsBreakpoint(id)) {
if (acceptsBreakpoint(bp)) {
showMessage(_("TAKING OWNERSHIP OF BREAKPOINT %1 IN STATE %2")
.arg(id.toString()).arg(handler->state(id)));
handler->setEngine(id, this);
.arg(bp.id().toString()).arg(bp.state()));
bp.setEngine(this);
} else {
showMessage(_("BREAKPOINT %1 IN STATE %2 IS NOT ACCEPTABLE")
.arg(id.toString()).arg(handler->state(id)));
.arg(bp.id().toString()).arg(bp.state()));
}
}
bool done = true;
cmd->beginList("bkpts");
foreach (BreakpointModelId id, handler->engineBreakpointIds(this)) {
const BreakpointResponse &response = handler->response(id);
const BreakpointState bpState = handler->state(id);
foreach (Breakpoint bp, handler->engineBreakpoints(this)) {
const BreakpointResponse &response = bp.response();
const BreakpointState bpState = bp.state();
switch (bpState) {
case BreakpointNew:
// Should not happen once claimed.
......@@ -564,57 +563,57 @@ bool LldbEngine::attemptBreakpointSynchronizationHelper(Command *cmd)
done = false;
cmd->beginGroup()
.arg("operation", "add")
.arg("modelid", id.toByteArray())
.arg("type", handler->type(id))
.arg("ignorecount", handler->ignoreCount(id))
.arg("condition", handler->condition(id).toHex())
.arg("function", handler->functionName(id).toUtf8())
.arg("oneshot", handler->isOneShot(id))
.arg("enabled", handler->isEnabled(id))
.arg("file", handler->fileName(id).toUtf8())
.arg("line", handler->lineNumber(id))
.arg("address", handler->address(id))
.arg("expression", handler->expression(id))
.arg("modelid", bp.id().toByteArray())
.arg("type", bp.type())
.arg("ignorecount", bp.ignoreCount())
.arg("condition", bp.condition().toHex())
.arg("function", bp.functionName().toUtf8())
.arg("oneshot", bp.isOneShot())
.arg("enabled", bp.isEnabled())
.arg("file", bp.fileName().toUtf8())
.arg("line", bp.lineNumber())
.arg("address", bp.address())
.arg("expression", bp.expression())
.endGroup();
handler->notifyBreakpointInsertProceeding(id);
bp.notifyBreakpointInsertProceeding();
break;
case BreakpointChangeRequested:
done = false;
cmd->beginGroup()
.arg("operation", "change")
.arg("modelid", id.toByteArray())
.arg("modelid", bp.id().toByteArray())
.arg("lldbid", response.id.toByteArray())
.arg("type", handler->type(id))
.arg("ignorecount", handler->ignoreCount(id))
.arg("condition", handler->condition(id).toHex())
.arg("function", handler->functionName(id).toUtf8())
.arg("oneshot", handler->isOneShot(id))
.arg("enabled", handler->isEnabled(id))
.arg("file", handler->fileName(id).toUtf8())
.arg("line", handler->lineNumber(id))
.arg("address", handler->address(id))
.arg("expression", handler->expression(id))
.arg("type", bp.type())
.arg("ignorecount", bp.ignoreCount())
.arg("condition", bp.condition().toHex())
.arg("function", bp.functionName().toUtf8())
.arg("oneshot", bp.isOneShot())
.arg("enabled", bp.isEnabled())
.arg("file", bp.fileName().toUtf8())
.arg("line", bp.lineNumber())
.arg("address", bp.address())
.arg("expression", bp.expression())
.endGroup();
handler->notifyBreakpointChangeProceeding(id);
bp.notifyBreakpointChangeProceeding();
break;
case BreakpointRemoveRequested:
done = false;
cmd->beginGroup()
.arg("operation", "remove")
.arg("modelid", id.toByteArray())
.arg("modelid", bp.id().toByteArray())
.arg("lldbid", response.id.toByteArray())
.endGroup();
handler->notifyBreakpointRemoveProceeding(id);
bp.notifyBreakpointRemoveProceeding();
break;
case BreakpointChangeProceeding:
case BreakpointInsertProceeding:
case BreakpointRemoveProceeding:
case BreakpointInserted:
case BreakpointDead:
QTC_ASSERT(false, qDebug() << "UNEXPECTED STATE" << bpState << "FOR BP " << id);
QTC_ASSERT(false, qDebug() << "UNEXPECTED STATE" << bpState << "FOR BP " << bp.id());
break;
default:
QTC_ASSERT(false, qDebug() << "UNKNOWN STATE" << bpState << "FOR BP" << id);
QTC_ASSERT(false, qDebug() << "UNKNOWN STATE" << bpState << "FOR BP" << bp.id());
}
}
cmd->endList();
......@@ -643,9 +642,10 @@ void LldbEngine::updateBreakpointData(const GdbMi &bkpt, bool added)
BreakHandler *handler = breakHandler();
BreakpointResponseId rid = BreakpointResponseId(bkpt["lldbid"].data());
BreakpointModelId id = BreakpointModelId(bkpt["modelid"].data());
if (!id.isValid())
id = handler->findBreakpointByResponseId(rid);
BreakpointResponse response = handler->response(id);
Breakpoint bp = handler->breakpointById(id);
if (!bp.isValid())
bp = handler->findBreakpointByResponseId(rid);
BreakpointResponse response = bp.response();
if (added)
response.id = rid;
QTC_CHECK(response.id == rid);
......@@ -669,7 +669,7 @@ void LldbEngine::updateBreakpointData(const GdbMi &bkpt, bool added)
sub.functionName = location["func"].toUtf8();
sub.fileName = location["file"].toUtf8();
sub.lineNumber = location["line"].toInt();
handler->insertSubBreakpoint(id, sub);
bp.insertSubBreakpoint(sub);
}
} else if (numChild == 1) {
const GdbMi location = locations.childAt(0);
......@@ -679,11 +679,11 @@ void LldbEngine::updateBreakpointData(const GdbMi &bkpt, bool added)
// This can happen for pending breakpoints.
showMessage(_("NO LOCATIONS (YET) FOR BP %1").arg(response.toString()));
}
handler->setResponse(id, response);
bp.setResponse(response);
if (added)
handler->notifyBreakpointInsertOk(id);
bp.notifyBreakpointInsertOk();
else
handler->notifyBreakpointChangeOk(id);
bp.notifyBreakpointChangeOk();
}
void LldbEngine::refreshDisassembly(const GdbMi &data)
......@@ -736,23 +736,25 @@ void LldbEngine::refreshOutput(const GdbMi &output)
void LldbEngine::refreshAddedBreakpoint(const GdbMi &bkpt)
{
BreakpointModelId id = BreakpointModelId(bkpt["modelid"].data());
QTC_CHECK(breakHandler()->state(id) == BreakpointInsertProceeding);
Breakpoint bp = breakHandler()->breakpointById(id);
QTC_CHECK(bp.state() == BreakpointInsertProceeding);
updateBreakpointData(bkpt, true);
}
void LldbEngine::refreshChangedBreakpoint(const GdbMi &bkpt)
{
BreakpointModelId id = BreakpointModelId(bkpt["modelid"].data());
QTC_CHECK(!id.isValid() || breakHandler()->state(id) == BreakpointChangeProceeding);
Breakpoint bp = breakHandler()->breakpointById(id);
QTC_CHECK(!bp.isValid() || bp.state() == BreakpointChangeProceeding);
updateBreakpointData(bkpt, false);
}
void LldbEngine::refreshRemovedBreakpoint(const GdbMi &bkpt)
{
BreakHandler *handler = breakHandler();
BreakpointModelId id = BreakpointModelId(bkpt["modelid"].data());
QTC_CHECK(handler->state(id) == BreakpointRemoveProceeding);
handler->notifyBreakpointRemoveOk(id);
Breakpoint bp = breakHandler()->breakpointById(id);
QTC_CHECK(bp.state() == BreakpointRemoveProceeding);
bp.notifyBreakpointRemoveOk();
}
void LldbEngine::loadSymbols(const QString &moduleName)
......
......@@ -122,7 +122,7 @@ private:
void activateFrame(int index);
void selectThread(ThreadId threadId);
bool acceptsBreakpoint(BreakpointModelId id) const;
bool acceptsBreakpoint(Breakpoint bp) const;
void attemptBreakpointSynchronization();
bool attemptBreakpointSynchronizationHelper(Command *command);
......
......@@ -327,34 +327,31 @@ void PdbEngine::selectThread(ThreadId threadId)
Q_UNUSED(threadId)
}
bool PdbEngine::acceptsBreakpoint(BreakpointModelId id) const
bool PdbEngine::acceptsBreakpoint(Breakpoint bp) const
{
const QString fileName = breakHandler()->fileName(id);
const QString fileName = bp.fileName();
return fileName.endsWith(QLatin1String(".py"));
}
void PdbEngine::insertBreakpoint(BreakpointModelId id)
void PdbEngine::insertBreakpoint(Breakpoint bp)
{
BreakHandler *handler = breakHandler();
QTC_CHECK(handler->state(id) == BreakpointInsertRequested);
handler->notifyBreakpointInsertProceeding(id);
QTC_CHECK(bp.state() == BreakpointInsertRequested);
bp.notifyBreakpointInsertProceeding();
QByteArray loc;
if (handler->type(id) == BreakpointByFunction)
loc = handler->functionName(id).toLatin1();
if (bp.type() == BreakpointByFunction)
loc = bp.functionName().toLatin1();
else
loc = handler->fileName(id).toLocal8Bit() + ':'
+ QByteArray::number(handler->lineNumber(id));
loc = bp.fileName().toLocal8Bit() + ':'
+ QByteArray::number(bp.lineNumber());
postCommand("break " + loc, CB(handleBreakInsert), QVariant(id));
postCommand("break " + loc, CB(handleBreakInsert), QVariant::fromValue(bp));
}
void PdbEngine::handleBreakInsert(const PdbResponse &response)