Merge commit 'origin/1.3'

Conflicts:
	src/plugins/debugger/gdb/gdbengine.cpp

Reviewed-by: Oswald Buddenhagen
This commit is contained in:
con
2009-11-16 11:35:47 +01:00
31 changed files with 1518 additions and 1401 deletions

View File

@@ -1161,6 +1161,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
}
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
// reaching the entry point. So handle it before the entry point hacks below.
if (reason.isEmpty() && m_gdbVersion < 70000 && !m_isMacGdb) {
@@ -1187,6 +1188,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
return;
}
}
#endif
#ifdef Q_OS_LINUX
if (!m_entryPoint.isEmpty()) {
@@ -1252,7 +1254,9 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
|| m_debuggingHelperState == DebuggingHelperLoadTried;
// Don't load helpers on stops triggered by signals unless it's
// an intentional trap.
if (initHelpers && reason == "signal-received") {
if (initHelpers
&& m_gdbAdapter->dumperHandling() != AbstractGdbAdapter::DumperLoadedByGdbPreload
&& reason == "signal-received") {
QByteArray name = data.findChild("signal-name").data();
if (name != STOP_SIGNAL
&& (startParameters().startMode != StartRemote
@@ -1284,6 +1288,12 @@ void GdbEngine::handleStop1(const GdbMi &data)
if (m_sourcesListOutdated)
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();
if (reason == "breakpoint-hit") {
showStatusMessage(tr("Stopped at breakpoint."));
@@ -2261,8 +2271,10 @@ void GdbEngine::reloadModulesInternal()
{
m_modulesListOutdated = false;
postCommand(_("info shared"), NeedsStop, CB(handleModulesList));
#if 0
if (m_gdbVersion < 70000 && !m_isMacGdb)
postCommand(_("set stop-on-solib-events 1"));
#endif
}
void GdbEngine::handleModulesList(const GdbResponse &response)
@@ -2331,8 +2343,10 @@ void GdbEngine::reloadSourceFilesInternal()
m_sourcesListOutdated = false;
postCommand(_("-file-list-exec-source-files"), NeedsStop, CB(handleQuerySources));
postCommand(_("-break-list"), CB(handleBreakList));
#if 0
if (m_gdbVersion < 70000 && !m_isMacGdb)
postCommand(_("set stop-on-solib-events 1"));
#endif
}
@@ -3429,7 +3443,11 @@ void GdbEngine::handleChildren(const WatchData &data0, const GdbMi &item,
data1.name = _(name.data());
else
data1.name = QString::number(i);
data1.iname = data.iname + _c('.') + data1.name;
GdbMi iname = child.findChild("iname");
if (iname.isValid())
data1.iname = _(iname.data());
else
data1.iname = data.iname + _c('.') + data1.name;
if (!data1.name.isEmpty() && data1.name.at(0).isDigit())
data1.name = _c('[') + data1.name + _c(']');
QByteArray key = child.findChild("key").data();

View File

@@ -60,7 +60,8 @@ PlainGdbAdapter::PlainGdbAdapter(GdbEngine *engine, QObject *parent)
AbstractGdbAdapter::DumperHandling PlainGdbAdapter::dumperHandling() const
{
#ifdef Q_OS_WIN
// LD_PRELOAD fails for System-Qt on Mac.
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
return DumperLoadedByGdb;
#else
return DumperLoadedByGdbPreload;

View File

@@ -71,7 +71,8 @@ TermGdbAdapter::~TermGdbAdapter()
AbstractGdbAdapter::DumperHandling TermGdbAdapter::dumperHandling() const
{
#ifdef Q_OS_WIN
// LD_PRELOAD fails for System-Qt on Mac.
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
return DumperLoadedByGdb;
#else
return DumperLoadedByAdapter; // Handles loading itself via LD_PRELOAD