Debugger: Fix use of external debug info for installer-based Qt

On Linux. Required installs are the gcc-built Qt libraries themselves,
the "Sources" and "Qt Debug Information Files" components.

Fixes: QTCREATORBUG-20693
Change-Id: I920efd641ce3ee4583741ea1db0bea18031adc51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-09-24 13:57:16 +02:00
parent 1b751c2d47
commit ada0e43c93
2 changed files with 15 additions and 2 deletions

View File

@@ -994,8 +994,21 @@ class Dumper(DumperBase):
qtCoreMatch = re.match('.*/libQt5?Core[^/.]*\.so', name) qtCoreMatch = re.match('.*/libQt5?Core[^/.]*\.so', name)
if qtCoreMatch is not None: if qtCoreMatch is not None:
self.addDebugLibs(objfile)
self.handleQtCoreLoaded(objfile) self.handleQtCoreLoaded(objfile)
def addDebugLibs(self, objfile):
# The directory where separate debug symbols are searched for
# is "/usr/lib/debug".
try:
cooked = gdb.execute('show debug-file-directory', to_string=True)
clean = cooked.split('"')[1]
newdir = '/'.join(objfile.filename.split('/')[:-1])
gdb.execute('set debug-file-directory %s:%s' % (clean, newdir))
except:
pass
def handleQtCoreLoaded(self, objfile): def handleQtCoreLoaded(self, objfile):
fd, tmppath = tempfile.mkstemp() fd, tmppath = tempfile.mkstemp()
os.close(fd) os.close(fd)

View File

@@ -62,7 +62,7 @@ QStringList qtBuildPaths()
"c:/users/qt/work/qt", "c:/users/qt/work/qt",
"c:/Users/qt/work/install"}; "c:/Users/qt/work/install"};
} else { } else {
return {}; return { "/home/qt/work/qt" };
} }
} }
@@ -450,7 +450,7 @@ DebuggerSourcePathMappingWidget::SourcePathMap
SourcePathMap rc = in; SourcePathMap rc = in;
for (const QString &buildPath : qtBuildPaths()) { for (const QString &buildPath : qtBuildPaths()) {
if (!rc.contains(buildPath)) // Do not overwrite user settings. if (!rc.contains(buildPath)) // Do not overwrite user settings.
rc.insert(buildPath, qtInstallPath); rc.insert(buildPath, qtInstallPath + "/../Src");
} }
return rc; return rc;
} }