if (!address)
continue;
const int lineNumber = contents.lineForAddress(address);
+ if (!lineNumber)
+ continue;
BreakpointMarker2 *marker = new BreakpointMarker2(handler->icon(id));
d->breakpointMarks.append(marker);
d->editor->markableInterface()->addMark(marker, lineNumber);
return "__cxa_begin_catch";
if (data.type == BreakpointAtMain)
#ifdef Q_OS_WIN
+ // FIXME: Should be target specific.
return "qMain";
#else
return "main";
#endif
- const QByteArray functionName = data.functionName.toUtf8();
- if (!functionName.isEmpty())
- return functionName;
- if (const quint64 address = data.address)
- return addressSpec(address);
- // In this case, data->funcName is something like '*0xdeadbeef'
- const int lineNumber = data.lineNumber;
- if (lineNumber == 0)
- return functionName;
+ if (data.type == BreakpointByFunction)
+ return data.functionName.toUtf8();
+ if (data.type == BreakpointByAddress)
+ return addressSpec(data.address);
+
const QString fileName = data.useFullPath
? data.fileName : breakLocation(data.fileName);
// The argument is simply a C-quoted version of the argument to the
// non-MI "break" command, including the "original" quoting it wants.
return "\"\\\"" + GdbMi::escapeCString(fileName).toLocal8Bit() + "\\\":"
- + QByteArray::number(lineNumber) + '"';
+ + QByteArray::number(data.lineNumber) + '"';
}
void GdbEngine::handleWatchInsert(const GdbResponse &response)
void GdbEngine::handleBreakInsert1(const GdbResponse &response)
{
- const int id = response.cookie.toInt();
+ BreakpointId id(response.cookie.toInt());
if (response.resultClass == GdbResultDone) {
// Interesting only on Mac?
GdbMi bkpt = response.data.findChild("bkpt");
QTC_ASSERT(handler->state(id) == BreakpointRemoveRequested, /**/);
handler->notifyBreakpointRemoveProceeding(id);
BreakpointResponse br = handler->response(id);
- showMessage(_("DELETING BP %1 IN ").arg(br.number)
- + handler->fileName(id));
+ showMessage(_("DELETING BP %1 IN %2").arg(br.number)
+ .arg(handler->fileName(id)));
postCommand("-break-delete " + QByteArray::number(br.number),
NeedsStop | RebuildBreakpointModel);
// Pretend it succeeds without waiting for response. Feels better.
private: ////////// Inferior Management //////////
// This should be always the last call in a function.
- //Q_SLOT virtual void attemptBreakpointSynchronization();
bool stateAcceptsBreakpointChanges() const;
bool acceptsBreakpoint(BreakpointId id) const;
void insertBreakpoint(BreakpointId id);
Q_UNUSED(index)
}
-void PdbEngine::attemptBreakpointSynchronization()
+bool PdbEngine::acceptsBreakpoint(BreakpointId id) const
+{
+ const QString fileName = breakHandler()->fileName(id);
+ return fileName.endsWith(QLatin1String(".py"));
+}
+
+void PdbEngine::insertBreakpoint(BreakpointId id)
{
BreakHandler *handler = breakHandler();
- //qDebug() << "ATTEMPT BP SYNC";
- bool updateNeeded = false;
- foreach (BreakpointId id, handler->engineBreakpointIds(this)) {
- if (handler->state(id) == BreakpointInsertRequested) {
- handler->notifyBreakpointInsertOk(id);
- updateNeeded = true;
-
- QByteArray loc;
- if (!handler->functionName(id).isEmpty())
- loc = handler->functionName(id).toLatin1();
- // The argument is simply a C-quoted version of the argument to the
- // non-MI "break" command, including the "original" quoting it wants.
- //return "\"\\\"" + GdbMi::escapeCString(data->fileName).toLocal8Bit()
- // + "\\\":" + data->lineNumber + '"';
- else
- loc = handler->fileName(id).toLocal8Bit() + ':'
- + QByteArray::number(handler->lineNumber(id));
-
- postCommand("break " + loc, CB(handleBreakInsert), QVariant(id));
- }
-/*
- if (data->bpNumber.isEmpty()) {
- data->bpNumber = QByteArray::number(index + 1);
- updateNeeded = true;
- }
- if (!data->fileName.isEmpty() && data->markerFileName().isEmpty()) {
- data->setMarkerFileName(data->fileName);
- data->setMarkerLineNumber(data->lineNumber.toInt());
- updateNeeded = true;
- }
-*/
- }
- //if (updateNeeded)
- // handler->updateMarkers();
+ QTC_ASSERT(handler->state(id) == BreakpointInsertRequested, /**/);
+ handler->notifyBreakpointInsertProceeding(id);
+
+ QByteArray loc;
+ if (handler->type(id) == BreakpointByFunction)
+ loc = handler->functionName(id).toLatin1();
+ else
+ loc = handler->fileName(id).toLocal8Bit() + ':'
+ + QByteArray::number(handler->lineNumber(id));
+
+ postCommand("break " + loc, CB(handleBreakInsert), QVariant(id));
}
void PdbEngine::handleBreakInsert(const PdbResponse &response)
handler->setResponse(id, br);
}
+void PdbEngine::removeBreakpoint(BreakpointId id)
+{
+ BreakHandler *handler = breakHandler();
+ QTC_ASSERT(handler->state(id) == BreakpointRemoveRequested, /**/);
+ handler->notifyBreakpointRemoveProceeding(id);
+ BreakpointResponse br = handler->response(id);
+ showMessage(_("DELETING BP %1 IN %2").arg(br.number)
+ .arg(handler->fileName(id)));
+ postCommand("clear " + QByteArray::number(br.number));
+ // Pretend it succeeds without waiting for response.
+ handler->notifyBreakpointRemoveOk(id);
+}
+
void PdbEngine::loadSymbols(const QString &moduleName)
{
Q_UNUSED(moduleName)
void activateFrame(int index);
void selectThread(int index);
- void attemptBreakpointSynchronization();
+ bool acceptsBreakpoint(BreakpointId id) const;
+ void insertBreakpoint(BreakpointId id);
+ void removeBreakpoint(BreakpointId id);
- void assignValueInDebugger(const Internal::WatchData *w, const QString &expr, const QVariant &value);
+ void assignValueInDebugger(const WatchData *data,
+ const QString &expr, const QVariant &value);
void executeDebuggerCommand(const QString &command);
void loadSymbols(const QString &moduleName);
*(QString*)value.data() = QString("XXX");
int i = 1;
- Q_UNUSED(i);
+ ++i;
+ ++i;
+ ++i;
#if 1
QVariant var;
var.setValue(1);