forked from qt-creator/qt-creator
debugger: remove infoTargetNecessary
Was only used for gdb < 7.0, and is not necessary on Mac. Change-Id: I9992d7aad52833f1e40d97395147bf1d2d546cf4 Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -71,13 +71,6 @@ void AbstractPlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &respon
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
||||||
if (response.resultClass == GdbResultDone) {
|
if (response.resultClass == GdbResultDone) {
|
||||||
if (infoTargetNecessary()) {
|
|
||||||
// Old gdbs do not announce the PID for programs without pthreads.
|
|
||||||
// Note that successfully preloading the debugging helpers will
|
|
||||||
// automatically load pthreads, so this will be unnecessary.
|
|
||||||
if (m_engine->m_gdbVersion < 70000)
|
|
||||||
m_engine->postCommand("info target", CB(handleInfoTarget));
|
|
||||||
}
|
|
||||||
m_engine->handleInferiorPrepared();
|
m_engine->handleInferiorPrepared();
|
||||||
} else {
|
} else {
|
||||||
QByteArray ba = response.data.findChild("msg").data();
|
QByteArray ba = response.data.findChild("msg").data();
|
||||||
@@ -114,26 +107,5 @@ void AbstractPlainGdbAdapter::handleExecRun(const GdbResponse &response)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractPlainGdbAdapter::handleInfoTarget(const GdbResponse &response)
|
|
||||||
{
|
|
||||||
if (response.resultClass == GdbResultDone) {
|
|
||||||
// [some leading stdout here]
|
|
||||||
// >&" Entry point: 0x80831f0 0x08048134 - 0x08048147 is .interp\n"
|
|
||||||
// [some trailing stdout here]
|
|
||||||
QString msg = _(response.consoleStreamOutput);
|
|
||||||
QRegExp needle(_("\\bEntry point: 0x([0-9a-f]+)\\b"));
|
|
||||||
if (needle.indexIn(msg) != -1) {
|
|
||||||
m_engine->m_entryPoint =
|
|
||||||
"0x" + needle.cap(1).toLatin1().rightJustified(sizeof(void *) * 2, '0');
|
|
||||||
m_engine->postCommand("tbreak *0x" + needle.cap(1).toAscii());
|
|
||||||
// Do nothing here - inferiorPrepared handles the sequencing.
|
|
||||||
} else {
|
|
||||||
m_engine->notifyInferiorSetupFailed(_("Parsing start address failed"));
|
|
||||||
}
|
|
||||||
} else if (response.resultClass == GdbResultError) {
|
|
||||||
m_engine->notifyInferiorSetupFailed(_("Fetching start address failed"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -49,12 +49,8 @@ public:
|
|||||||
virtual void setupInferior();
|
virtual void setupInferior();
|
||||||
void runEngine();
|
void runEngine();
|
||||||
|
|
||||||
protected:
|
|
||||||
void handleInfoTarget(const GdbResponse &response);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual QByteArray execFilePath() const = 0;
|
virtual QByteArray execFilePath() const = 0;
|
||||||
virtual bool infoTargetNecessary() const = 0;
|
|
||||||
virtual QByteArray toLocalEncoding(const QString &str) const = 0;
|
virtual QByteArray toLocalEncoding(const QString &str) const = 0;
|
||||||
virtual QString fromLocalEncoding(const QByteArray &ba) const = 0;
|
virtual QString fromLocalEncoding(const QByteArray &ba) const = 0;
|
||||||
void handleExecRun(const GdbResponse &response);
|
void handleExecRun(const GdbResponse &response);
|
||||||
|
|||||||
@@ -194,15 +194,6 @@ QByteArray LocalPlainGdbAdapter::execFilePath() const
|
|||||||
.absoluteFilePath().toLocal8Bit();
|
.absoluteFilePath().toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocalPlainGdbAdapter::infoTargetNecessary() const
|
|
||||||
{
|
|
||||||
#ifdef Q_OS_LINUX
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray LocalPlainGdbAdapter::toLocalEncoding(const QString &s) const
|
QByteArray LocalPlainGdbAdapter::toLocalEncoding(const QString &s) const
|
||||||
{
|
{
|
||||||
return s.toLocal8Bit();
|
return s.toLocal8Bit();
|
||||||
|
|||||||
@@ -64,10 +64,9 @@ private:
|
|||||||
DumperHandling dumperHandling() const;
|
DumperHandling dumperHandling() const;
|
||||||
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
|
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
|
||||||
|
|
||||||
virtual QByteArray execFilePath() const;
|
QByteArray execFilePath() const;
|
||||||
virtual bool infoTargetNecessary() const;
|
QByteArray toLocalEncoding(const QString &s) const;
|
||||||
virtual QByteArray toLocalEncoding(const QString &s) const;
|
QString fromLocalEncoding(const QByteArray &b) const;
|
||||||
virtual QString fromLocalEncoding(const QByteArray &b) const;
|
|
||||||
void checkForReleaseBuild();
|
void checkForReleaseBuild();
|
||||||
|
|
||||||
OutputCollector m_outputCollector;
|
OutputCollector m_outputCollector;
|
||||||
|
|||||||
@@ -74,11 +74,6 @@ QByteArray RemotePlainGdbAdapter::execFilePath() const
|
|||||||
return startParameters().executable.toUtf8();
|
return startParameters().executable.toUtf8();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RemotePlainGdbAdapter::infoTargetNecessary() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray RemotePlainGdbAdapter::toLocalEncoding(const QString &s) const
|
QByteArray RemotePlainGdbAdapter::toLocalEncoding(const QString &s) const
|
||||||
{
|
{
|
||||||
return s.toUtf8();
|
return s.toUtf8();
|
||||||
|
|||||||
@@ -62,10 +62,9 @@ private:
|
|||||||
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
|
AbstractGdbProcess *gdbProc() { return &m_gdbProc; }
|
||||||
DumperHandling dumperHandling() const { return DumperLoadedByGdbPreload; }
|
DumperHandling dumperHandling() const { return DumperLoadedByGdbPreload; }
|
||||||
|
|
||||||
virtual QByteArray execFilePath() const;
|
QByteArray execFilePath() const;
|
||||||
virtual bool infoTargetNecessary() const;
|
QByteArray toLocalEncoding(const QString &s) const;
|
||||||
virtual QByteArray toLocalEncoding(const QString &s) const;
|
QString fromLocalEncoding(const QByteArray &b) const;
|
||||||
virtual QString fromLocalEncoding(const QByteArray &b) const;
|
|
||||||
void handleApplicationOutput(const QByteArray &output);
|
void handleApplicationOutput(const QByteArray &output);
|
||||||
|
|
||||||
RemoteGdbProcess m_gdbProc;
|
RemoteGdbProcess m_gdbProc;
|
||||||
|
|||||||
Reference in New Issue
Block a user