From b78c854caaeeefb0efaef0f2921139ed0f87fd37 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 22 May 2003 19:49:01 +0000 Subject: [PATCH] Fixed orphaned breakpoints with the xsldbg driver. --- kdbg/debugger.cpp | 8 ++++++-- kdbg/xsldbgdriver.cpp | 26 +++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/kdbg/debugger.cpp b/kdbg/debugger.cpp index 3b91dee..0b01253 100644 --- a/kdbg/debugger.cpp +++ b/kdbg/debugger.cpp @@ -1943,9 +1943,13 @@ void KDebugger::updateBreakList(const char* output) { if (bp->id == m_brkpts[i]->id) { // keep accurate location + // except that xsldbg doesn't have a location in + // the old breakpoint if it's just been set bp->text = m_brkpts[i]->text; - bp->fileName = m_brkpts[i]->fileName; - bp->lineNo = m_brkpts[i]->lineNo; + if (!m_brkpts[i]->fileName.isEmpty()) { + bp->fileName = m_brkpts[i]->fileName; + bp->lineNo = m_brkpts[i]->lineNo; + } m_brkpts.insert(i, bp); // old object is deleted goto stillAlive; } diff --git a/kdbg/xsldbgdriver.cpp b/kdbg/xsldbgdriver.cpp index 79d6497..7399879 100644 --- a/kdbg/xsldbgdriver.cpp +++ b/kdbg/xsldbgdriver.cpp @@ -1251,10 +1251,30 @@ XsldbgDriver::parseThreadList(const char */*output*/, } bool -XsldbgDriver::parseBreakpoint(const char */*output*/, int &/*id*/, - QString & /*file*/, int &/*lineNo*/, QString&/*address*/) +XsldbgDriver::parseBreakpoint(const char *output, int &id, + QString &file, int &lineNo, QString &address) { - TRACE("parseBreakpoint"); + // check for errors + if ( strncmp(output, "Error:", 6) == 0) { + return false; + } + + char *dummy; + if (strncmp(output, "Breakpoint ", 11) != 0) + return false; + + output += 11; + if (!isdigit(*output)) + return false; + + // get Num + id = strtol(output, &dummy, 10); /* don't care about overflows */ + if (output == dummy) + return false; + + // the file name + lineNo will be filled in later from the breakpoint list + file = address = QString(); + lineNo = 0; return true; } -- 2.11.4.GIT