From ada0e43c93199dbf54add275c1320d33c7c2bc9a Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 24 Sep 2018 13:57:16 +0200 Subject: 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 --- share/qtcreator/debugger/gdbbridge.py | 13 +++++++++++++ src/plugins/debugger/debuggersourcepathmappingwidget.cpp | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 6c6e2a7468..5a65078471 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -994,8 +994,21 @@ class Dumper(DumperBase): qtCoreMatch = re.match('.*/libQt5?Core[^/.]*\.so', name) if qtCoreMatch is not None: + self.addDebugLibs(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): fd, tmppath = tempfile.mkstemp() os.close(fd) diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 906610547c..6ed1196c96 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -62,7 +62,7 @@ QStringList qtBuildPaths() "c:/users/qt/work/qt", "c:/Users/qt/work/install"}; } else { - return {}; + return { "/home/qt/work/qt" }; } } @@ -450,7 +450,7 @@ DebuggerSourcePathMappingWidget::SourcePathMap SourcePathMap rc = in; for (const QString &buildPath : qtBuildPaths()) { if (!rc.contains(buildPath)) // Do not overwrite user settings. - rc.insert(buildPath, qtInstallPath); + rc.insert(buildPath, qtInstallPath + "/../Src"); } return rc; } -- cgit v1.2.1