forked from qt-creator/qt-creator
remote gdb: explicitly relocate the most likely source location
Change-Id: I523de9372b9adfa40f0ab9194ef3b462bd2a3056 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -166,8 +166,12 @@ void CoreGdbAdapter::setupInferior()
|
|||||||
QFileInfo fi(m_executable);
|
QFileInfo fi(m_executable);
|
||||||
const QByteArray sysroot = startParameters().sysroot.toLocal8Bit();
|
const QByteArray sysroot = startParameters().sysroot.toLocal8Bit();
|
||||||
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
|
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
|
||||||
if (!sysroot.isEmpty())
|
if (!sysroot.isEmpty()) {
|
||||||
m_engine->postCommand("set sysroot " + sysroot);
|
m_engine->postCommand("set sysroot " + sysroot);
|
||||||
|
// sysroot is not enough to correctly locate the sources, so explicitly
|
||||||
|
// relocate the most likely place for the debug source
|
||||||
|
m_engine->postCommand("set substitute-path /usr/src " + sysroot + "/usr/src");
|
||||||
|
}
|
||||||
m_engine->postCommand("-file-exec-and-symbols \"" + path + '"',
|
m_engine->postCommand("-file-exec-and-symbols \"" + path + '"',
|
||||||
CB(handleFileExecAndSymbols));
|
CB(handleFileExecAndSymbols));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,8 +180,12 @@ void RemoteGdbServerAdapter::setupInferior()
|
|||||||
m_engine->postCommand("set architecture " + remoteArch);
|
m_engine->postCommand("set architecture " + remoteArch);
|
||||||
if (!gnuTarget.isEmpty())
|
if (!gnuTarget.isEmpty())
|
||||||
m_engine->postCommand("set gnutarget " + gnuTarget);
|
m_engine->postCommand("set gnutarget " + gnuTarget);
|
||||||
if (!sysroot.isEmpty())
|
if (!sysroot.isEmpty()) {
|
||||||
m_engine->postCommand("set sysroot " + sysroot);
|
m_engine->postCommand("set sysroot " + sysroot);
|
||||||
|
// sysroot is not enough to correctly locate the sources, so explicitly
|
||||||
|
// relocate the most likely place for the debug source
|
||||||
|
m_engine->postCommand("set substitute-path /usr/src " + sysroot + "/usr/src");
|
||||||
|
}
|
||||||
if (!searchPath.isEmpty())
|
if (!searchPath.isEmpty())
|
||||||
m_engine->postCommand("set solib-search-path " + searchPath);
|
m_engine->postCommand("set solib-search-path " + searchPath);
|
||||||
if (!args.isEmpty())
|
if (!args.isEmpty())
|
||||||
|
|||||||
Reference in New Issue
Block a user