terminal adapter: make skipping of initial SIGSTOPs more reliable

first, _start being resolvable depends on libc-dbg being installed.
second, depending on the frame being in the dynloader makes it
a) work only for dynamic executables and b) fail on multi-target
systems (due to a hard-coded file name).
so instead just remember the entry point, as we are already there
anyway.

Reviewed-By: hjk
This commit is contained in:
Oswald Buddenhagen
2009-10-30 17:16:56 +01:00
parent 6d6ed26eae
commit 151b785d01
4 changed files with 35 additions and 8 deletions

View File

@@ -285,6 +285,9 @@ void GdbEngine::initializeVariables()
m_currentFunctionArgs.clear();
m_currentFrame.clear();
m_dumperHelper.clear();
#ifdef Q_OS_LINUX
m_entryPoint.clear();
#endif
}
QString GdbEngine::errorMessage(QProcess::ProcessError error)
@@ -1068,16 +1071,19 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
#ifdef Q_OS_LINUX
// For some reason, attaching to a stopped process causes *two* stops
// when trying to continue (kernel 2.6.24-23-ubuntu).
// when trying to continue (kernel i386 2.6.24-23-ubuntu, gdb 6.8).
// Interestingly enough, on MacOSX no signal is delivered at all.
if (reason == "signal-received"
&& data.findChild("signal-name").data() == "SIGSTOP") {
GdbMi frameData = data.findChild("frame");
if (frameData.findChild("func").data() == "_start"
&& frameData.findChild("from").data() == "/lib/ld-linux.so.2") {
continueInferiorInternal();
return;
if (!m_entryPoint.isEmpty()) {
if (reason == "signal-received"
&& data.findChild("signal-name").data() == "SIGSTOP") {
GdbMi frameData = data.findChild("frame");
if (frameData.findChild("addr").data() == m_entryPoint) {
continueInferiorInternal();
return;
}
}
// We are past the initial stops. No need to waste time on further checks.
m_entryPoint.clear();
}
#endif