diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 6c6e2a74682..5a65078471b 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 906610547ca..6ed1196c963 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; }