don't track shared library events on gdb < 7, after all.

The problem is that the shlib events disturb bounded execution requests
and there is no way to recover from this - the debugger will effectively
turn "step over" into "continue". this is nicely explained in
http://vladimir_prus.blogspot.com/2007/12/debugger-stories-pending-breakpoints.html
This commit is contained in:
Oswald Buddenhagen
2009-11-12 14:49:54 +01:00
parent 6485a66c5b
commit 0939a7f77f

View File

@@ -1153,6 +1153,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
} }
setState(InferiorStopped); setState(InferiorStopped);
#if 0 // See http://vladimir_prus.blogspot.com/2007/12/debugger-stories-pending-breakpoints.html
// Due to LD_PRELOADing the dumpers, these events can occur even before // Due to LD_PRELOADing the dumpers, these events can occur even before
// reaching the entry point. So handle it before the entry point hacks below. // reaching the entry point. So handle it before the entry point hacks below.
if (reason.isEmpty() && m_gdbVersion < 70000 && !m_isMacGdb) { if (reason.isEmpty() && m_gdbVersion < 70000 && !m_isMacGdb) {
@@ -1179,6 +1180,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
return; return;
} }
} }
#endif
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
if (!m_entryPoint.isEmpty()) { if (!m_entryPoint.isEmpty()) {
@@ -1272,6 +1274,12 @@ void GdbEngine::handleStop1(const GdbMi &data)
if (m_sourcesListOutdated) if (m_sourcesListOutdated)
reloadSourceFilesInternal(); // This needs to be done before fullName() may need it reloadSourceFilesInternal(); // This needs to be done before fullName() may need it
// Older gdb versions do not produce "library loaded" messages
// so the breakpoint update is not triggered.
if (m_gdbVersion < 70000 && !m_isMacGdb && !m_sourcesListUpdating
&& manager()->breakHandler()->size() > 0)
postCommand(_("-break-list"), CB(handleBreakList));
QByteArray reason = data.findChild("reason").data(); QByteArray reason = data.findChild("reason").data();
if (reason == "breakpoint-hit") { if (reason == "breakpoint-hit") {
showStatusMessage(tr("Stopped at breakpoint.")); showStatusMessage(tr("Stopped at breakpoint."));
@@ -2247,8 +2255,10 @@ void GdbEngine::reloadModulesInternal()
{ {
m_modulesListOutdated = false; m_modulesListOutdated = false;
postCommand(_("info shared"), NeedsStop, CB(handleModulesList)); postCommand(_("info shared"), NeedsStop, CB(handleModulesList));
#if 0
if (m_gdbVersion < 70000 && !m_isMacGdb) if (m_gdbVersion < 70000 && !m_isMacGdb)
postCommand(_("set stop-on-solib-events 1")); postCommand(_("set stop-on-solib-events 1"));
#endif
} }
void GdbEngine::handleModulesList(const GdbResponse &response) void GdbEngine::handleModulesList(const GdbResponse &response)
@@ -2317,8 +2327,10 @@ void GdbEngine::reloadSourceFilesInternal()
m_sourcesListOutdated = false; m_sourcesListOutdated = false;
postCommand(_("-file-list-exec-source-files"), NeedsStop, CB(handleQuerySources)); postCommand(_("-file-list-exec-source-files"), NeedsStop, CB(handleQuerySources));
postCommand(_("-break-list"), CB(handleBreakList)); postCommand(_("-break-list"), CB(handleBreakList));
#if 0
if (m_gdbVersion < 70000 && !m_isMacGdb) if (m_gdbVersion < 70000 && !m_isMacGdb)
postCommand(_("set stop-on-solib-events 1")); postCommand(_("set stop-on-solib-events 1"));
#endif
} }