diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py index cf8d822cd4e35038e867462d30f6577ad62ac210..200d6a73ce30287e399cc59e5c4515536a7a8398 100644 --- a/share/qtcreator/gdbmacros/dumper.py +++ b/share/qtcreator/gdbmacros/dumper.py @@ -128,13 +128,14 @@ def listOfBreakpoints(d): continue number = line[0:5] pos0x = line.find(" 0x") - posin = line.find(" in ") - posat = line.find(" at ") + posin = line.find(" in ", pos0x) + posat = line.find(" at ", posin) poscol = line.find(":", posat) if pos0x < posin and pos0x != -1: bp.address.append(line[pos0x + 1 : posin]) - if line.find("<PENDING>") >= 0: - bp.address.append("<PENDING>") + # Take "no address" as indication that the bp is pending. + #if line.find("<PENDING>") >= 0: + # bp.address.append("<PENDING>") if posin < posat and posin != -1: bp.function = line[posin + 4 : posat] if posat < poscol and poscol != -1: @@ -625,10 +626,10 @@ class FrameCommand(gdb.Command): # Breakpoints # breakpoints = "" - #d.safeoutput = "" - #listOfBreakpoints(d) - #d.pushOutput() - #breakpoints = d.safeoutput + d.safeoutput = "" + listOfBreakpoints(d) + d.pushOutput() + breakpoints = d.safeoutput print('data=[' + locals + sep + watchers + '],bkpts=[' + breakpoints + ']\n') diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 4b65eac27bef0bab79d5b49d0f238e47e613ac7d..f2119119f986f5845d292c66d0535b56a7ef6913 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -91,7 +91,7 @@ public: QString bpFileName; // file name acknowledged by the debugger engine QByteArray bpLineNumber; // line number acknowledged by the debugger engine QString bpFuncName; // function name acknowledged by the debugger engine - QString bpAddress; // address acknowledged by the debugger engine + QByteArray bpAddress; // address acknowledged by the debugger engine bool bpMultiple; // happens in constructors/gdb bool bpEnabled; // enable/disable command sent diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 697448b4533e029bf7afbb4ee5159251dfaca356..9d77208ac37c8e81a9feaa535b0f704bd64f8320 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1315,14 +1315,16 @@ void GdbEngine::handleStop1(const GdbMi &data) if (m_sourcesListOutdated && theDebuggerBoolSetting(UsePreciseBreakpoints)) reloadSourceFilesInternal(); // This needs to be done before fullName() may need it - if (m_breakListOutdated) - reloadBreakListInternal(); - else - // Older gdb versions do not produce "library loaded" messages - // so the breakpoint update is not triggered. - if (m_gdbVersion < 70000 && !m_isMacGdb && !m_breakListUpdating - && manager()->breakHandler()->size() > 0) + if (!hasPython()) { + if (m_breakListOutdated) reloadBreakListInternal(); + else + // Older gdb versions do not produce "library loaded" messages + // so the breakpoint update is not triggered. + if (m_gdbVersion < 70000 && !m_isMacGdb && !m_breakListUpdating + && manager()->breakHandler()->size() > 0) + reloadBreakListInternal(); + } if (reason == "breakpoint-hit") { showStatusMessage(tr("Stopped at breakpoint.")); @@ -1945,7 +1947,7 @@ void GdbEngine::breakpointDataFromOutput(BreakpointData *data, const GdbMi &bkpt if (child.data() == "<MULTIPLE>") data->bpMultiple = true; else - data->bpAddress = _(child.data()); + data->bpAddress = child.data(); } else if (child.hasName("file")) { file = child.data(); } else if (child.hasName("fullname")) { @@ -2190,7 +2192,7 @@ void GdbEngine::extractDataFromInfoBreak(const QString &output, BreakpointData * re.setMinimal(true); if (re.indexIn(output) != -1) { - data->bpAddress = re.cap(1); + data->bpAddress = re.cap(1).toLatin1(); data->bpFuncName = re.cap(2).trimmed(); data->bpLineNumber = re.cap(4).toLatin1(); QString full = fullName(re.cap(3)); diff --git a/src/plugins/debugger/gdb/pythongdbengine.cpp b/src/plugins/debugger/gdb/pythongdbengine.cpp index 93226f3a4102725627065ab02e9bd9f57cc18538..d1025e9ce5edd7e158365f7b2f6d38f90bf1414a 100644 --- a/src/plugins/debugger/gdb/pythongdbengine.cpp +++ b/src/plugins/debugger/gdb/pythongdbengine.cpp @@ -33,6 +33,7 @@ #include "debuggeractions.h" #include "debuggerstringutils.h" +#include "breakhandler.h" #include "watchhandler.h" #include "stackhandler.h" @@ -141,6 +142,35 @@ void GdbEngine::handleStackFramePython(const GdbResponse &response) //for (int i = 0; i != list.size(); ++i) // qDebug() << "LOCAL: " << list.at(i).toString(); + data = all.findChild("bkpts"); + if (data.isValid()) { + BreakHandler *handler = manager()->breakHandler(); + foreach (const GdbMi &child, data.children()) { + int bpNumber = child.findChild("number").data().toInt(); + int found = handler->findBreakpoint(bpNumber); + if (found != -1) { + BreakpointData *bp = handler->at(found); + GdbMi addr = child.findChild("addr"); + if (addr.isValid()) { + bp->bpAddress = child.findChild("addr").data(); + bp->pending = false; + } else { + bp->bpAddress = "<PENDING>"; + bp->pending = true; + } + bp->bpFuncName = child.findChild("func").data(); + bp->bpLineNumber = child.findChild("line").data(); + bp->bpFileName = child.findChild("file").data(); + bp->markerLineNumber = bp->bpLineNumber.toInt(); + bp->markerFileName = bp->bpFileName; + } else { + QTC_ASSERT(false, qDebug() << child.toString()); + //bp->bpNumber = "<unavailable>"; + } + } + handler->updateMarkers(); + } + //PENDING_DEBUG("AFTER handleStackFrame()"); // FIXME: This should only be used when updateLocals() was // triggered by expanding an item in the view.