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

@@ -119,6 +119,9 @@ void TermGdbAdapter::handleStubAttached(const GdbResponse &response)
setState(InferiorStopped);
debugMessage(_("INFERIOR ATTACHED"));
emit inferiorPrepared();
#ifdef Q_OS_LINUX
m_engine->postCommand(_("-stack-list-frames 0 0"), CB(handleEntryPoint));
#endif
} else if (response.resultClass == GdbResultError) {
QString msg = _(response.data.findChild("msg").data());
emit inferiorStartFailed(msg);
@@ -130,6 +133,17 @@ void TermGdbAdapter::startInferiorPhase2()
m_engine->continueInferiorInternal();
}
#ifdef Q_OS_LINUX
void TermGdbAdapter::handleEntryPoint(const GdbResponse &response)
{
if (response.resultClass == GdbResultDone) {
GdbMi stack = response.data.findChild("stack");
if (stack.isValid() && stack.childCount() == 1)
m_engine->m_entryPoint = stack.childAt(0).findChild("addr").data();
}
}
#endif
void TermGdbAdapter::interruptInferior()
{
const qint64 attachedPID = m_engine->inferiorPid();