map.insert(_("disabled"), _("1"));
if (data.useFullPath)
map.insert(_("usefullpath"), _("1"));
+ if (data.tracepoint)
+ map.insert(_("tracepoint"), _("1"));
list.append(map);
}
debuggerCore()->setSessionValue("Breakpoints", list);
v = map.value(_("usefullpath"));
if (v.isValid())
data.useFullPath = bool(v.toInt());
+ v = map.value(_("tracepoint"));
+ if (v.isValid())
+ data.tracepoint = bool(v.toInt());
v = map.value(_("type"));
if (v.isValid() && v.toInt() != UnknownType)
data.type = BreakpointType(v.toInt());
scheduleSynchronization();
}
+bool BreakHandler::isTracepoint(BreakpointId id) const
+{
+ ConstIterator it = m_storage.find(id);
+ QTC_ASSERT(it != m_storage.end(), return false);
+ return it->data.tracepoint;
+}
+
+void BreakHandler::setTracepoint(BreakpointId id, bool on)
+{
+ Iterator it = m_storage.find(id);
+ QTC_ASSERT(it != m_storage.end(), return);
+ if (it->data.tracepoint == on)
+ return;
+ it->data.tracepoint = on;
+ it->destroyMarker();
+ it->state = BreakpointChangeRequested;
+ updateMarker(id);
+ scheduleSynchronization();
+}
+
void BreakHandler::setMarkerFileAndLine(BreakpointId id,
const QString &fileName, int lineNumber)
{
void updateLineNumberFromMarker(BreakpointId id, int lineNumber);
void setMarkerFileAndLine(BreakpointId id,
const QString &fileName, int lineNumber);
+ bool isTracepoint(BreakpointId id) const;
+ void setTracepoint(BreakpointId, bool on);
DebuggerEngine *engine(BreakpointId id) const;
void setEngine(BreakpointId id, DebuggerEngine *engine);
const BreakpointResponse &response(BreakpointId id) const;
} else if (child.hasName("thread")) {
response.threadSpec = child.data().toInt();
} else if (child.hasName("type")) {
- if (!child.data().contains("reakpoint")) // "breakpoint", "hw breakpoint"
+ // "breakpoint", "hw breakpoint", "tracepoint"
+ if (child.data().contains("tracepoint"))
+ response.tracepoint = true;
+ else if (!child.data().contains("reakpoint"))
response.type = Watchpoint;
}
// This field is not present. Contents needs to be parsed from
void GdbEngine::handleBreakInsert1(const GdbResponse &response)
{
+ BreakHandler *handler = breakHandler();
BreakpointId id(response.cookie.toInt());
if (response.resultClass == GdbResultDone) {
// Interesting only on Mac?
GdbMi bkpt = response.data.findChild("bkpt");
updateBreakpointDataFromOutput(id, bkpt);
- BreakHandler *handler = breakHandler();
if (handler->needsChange(id)) {
handler->notifyBreakpointChangeAfterInsertNeeded(id);
changeBreakpoint(id);
handler->notifyBreakpointInsertOk(id);
attemptAdjustBreakpointLocation(id);
}
+ } else if (response.data.findChild("msg").data().contains("Unknown option")) {
+ // Older version of gdb don't know the -a option to set tracepoints
+ // ^error,msg="mi_cmd_break_insert: Unknown option ``a''"
+ const QString fileName = handler->fileName(id);
+ const int lineNumber = handler->lineNumber(id);
+ QByteArray cmd = "trace "
+ "\"" + GdbMi::escapeCString(fileName).toLocal8Bit() + "\":"
+ + QByteArray::number(lineNumber);
+ postCommand(cmd, NeedsStop | RebuildBreakpointModel,
+ CB(handleTraceInsert2), id);
} else {
// Some versions of gdb like "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4)"
// know how to do pending breakpoints using CLI but not MI. So try
}
}
+void GdbEngine::handleTraceInsert2(const GdbResponse &response)
+{
+ if (response.resultClass == GdbResultDone)
+ reloadBreakListInternal();
+}
+
void GdbEngine::reloadBreakListInternal()
{
postCommand("-break-list",
}
QByteArray cmd;
- if (m_isMacGdb) {
+ if (handler->isTracepoint(id)) {
+ cmd = "-break-insert -a -f ";
+ } else if (m_isMacGdb) {
cmd = "-break-insert -l -1 -f ";
} else if (m_gdbAdapter->isTrkAdapter()) {
cmd = "-break-insert -h -f ";