Source Paths Mapping does not work in Ubuntu (works in Windows)
-
Summary: with Qt Creator, I can debug Qt code in Windows, not in Ubuntu.
My Windows environment:
- Windows 10 (64-bit)
- Qt 5.6.3
- Qt Creator 4.8.1
- Visual Studio 2015, Update 3
My Ubuntu environment:
- Ubuntu 18.04 (64-bit)
- Qt 5.6.3
- Qt Creator 4.8.1
- gcc 7.3.0
This is how I installed Qt in Windows:
- dowload qt-unified-windows-x86-3.0.6-online.exe from https://www.qt.io/download
- execute qt-unified-windows-x86-3.0.6-online.exe
- installation folder => C:\Qt
- selected components:
- Qt 5.6.3
- msvc2015 64-bit
- Source Components
- Qt Source Package
- Tools
- Qt Creator 4.8.1 CDB Debugger Support
- Qt 5.6.3
This is how I installed Qt in Ubuntu:
- dowload qt-unified-linux-x64-3.0.6-online.run from https://www.qt.io/download
- execute qt-unified-linux-x64-3.0.6-online.run from a terminal
- installation folder => /home/dave/Qt
- selected components: same as in Windows, except:
- msvc2015 64-bit => Desktop gcc 64-bit
- no "Qt Creator 4.8.1 CDB Debugger Support" available
- execute these commands in a terminal (as per wiki.qt.io/Install_Qt_5_on_Ubuntu):
$ sudo apt-get install libfontconfig1
$ sudo apt-get install mesa-common-dev
$ sudo apt-get install libglu1-mesa-dev -y
This is how I configured Qt Creator's source mapping in Windows:
- Tools -> Options... -> Debugger -> General -> Add Qt sources... -> C:\Qt\5.6.3\Src
- at this point, "Source Paths Mapping" in the "Debugger" dialog shows the following lines:
Source path Target path C:/work/build/qt5_workdir/w/s C:\Qt\5.6.3\Src Q:/qt5_workdir/w/s C:\Qt\5.6.3\Src c:/Users/qt/work/install C:\Qt\5.6.3\Src c:/users/qt/work/qt C:\Qt\5.6.3\Src
This is how I configured Qt Creator's source mapping in Ubuntu:
- Tools -> Options... -> Debugger -> General -> Add Qt sources... -> /home/dave/Qt/5.6.3/Src
- at this point, "Source Paths Mapping" in the "Debugger" dialog shows the following lines:
Source path Target path /home/qt/work/qt /home/dave/Qt/5.6.3/Src
When I try to Step Into a Qt function call in Ubuntu, execution jumps over the Qt call, as if I had selected Step Over. When I do the same in Windows, the debugger takes me into the Qt function, as it should.
The only Qt code I can debug in Ubuntu is Qt code defined in headers.
I do use Debug builds in both Windows and Ubuntu.
Any idea?
-
Summary: with Qt Creator, I can debug Qt code in Windows, not in Ubuntu.
My Windows environment:
- Windows 10 (64-bit)
- Qt 5.6.3
- Qt Creator 4.8.1
- Visual Studio 2015, Update 3
My Ubuntu environment:
- Ubuntu 18.04 (64-bit)
- Qt 5.6.3
- Qt Creator 4.8.1
- gcc 7.3.0
This is how I installed Qt in Windows:
- dowload qt-unified-windows-x86-3.0.6-online.exe from https://www.qt.io/download
- execute qt-unified-windows-x86-3.0.6-online.exe
- installation folder => C:\Qt
- selected components:
- Qt 5.6.3
- msvc2015 64-bit
- Source Components
- Qt Source Package
- Tools
- Qt Creator 4.8.1 CDB Debugger Support
- Qt 5.6.3
This is how I installed Qt in Ubuntu:
- dowload qt-unified-linux-x64-3.0.6-online.run from https://www.qt.io/download
- execute qt-unified-linux-x64-3.0.6-online.run from a terminal
- installation folder => /home/dave/Qt
- selected components: same as in Windows, except:
- msvc2015 64-bit => Desktop gcc 64-bit
- no "Qt Creator 4.8.1 CDB Debugger Support" available
- execute these commands in a terminal (as per wiki.qt.io/Install_Qt_5_on_Ubuntu):
$ sudo apt-get install libfontconfig1
$ sudo apt-get install mesa-common-dev
$ sudo apt-get install libglu1-mesa-dev -y
This is how I configured Qt Creator's source mapping in Windows:
- Tools -> Options... -> Debugger -> General -> Add Qt sources... -> C:\Qt\5.6.3\Src
- at this point, "Source Paths Mapping" in the "Debugger" dialog shows the following lines:
Source path Target path C:/work/build/qt5_workdir/w/s C:\Qt\5.6.3\Src Q:/qt5_workdir/w/s C:\Qt\5.6.3\Src c:/Users/qt/work/install C:\Qt\5.6.3\Src c:/users/qt/work/qt C:\Qt\5.6.3\Src
This is how I configured Qt Creator's source mapping in Ubuntu:
- Tools -> Options... -> Debugger -> General -> Add Qt sources... -> /home/dave/Qt/5.6.3/Src
- at this point, "Source Paths Mapping" in the "Debugger" dialog shows the following lines:
Source path Target path /home/qt/work/qt /home/dave/Qt/5.6.3/Src
When I try to Step Into a Qt function call in Ubuntu, execution jumps over the Qt call, as if I had selected Step Over. When I do the same in Windows, the debugger takes me into the Qt function, as it should.
The only Qt code I can debug in Ubuntu is Qt code defined in headers.
I do use Debug builds in both Windows and Ubuntu.
Any idea?
@dave2 said in Source Paths Mapping does not work in Ubuntu (works in Windows):
/home/qt/work/qt /home/dave/Qt/5.6.3/Src
is it really /home/qt? If so why? Does the user "dave" has read access to /home/qt?
-
When I add
/home/dave/Qt/5.6.3/Src
as theTarget path
(withTools -> Options... -> Debugger -> General -> Add Qt sources...
), theSource path
is automatically set to/home/qt/work/qt
. And no,/home/qt/work/qt
does not exist on my Ubuntu machine.Similarly, none of the four directories which were automatically added as
Source path
when I addedC:\Qt\5.6.3\Src
as theTarget path
(that is:C:/work/build/qt5_workdir/w/s
,Q:/qt5_workdir/w/s
,c:/Users/qt/work/install
andc:/users/qt/work/qt
) exists on my Windows machine.I suppose that these source paths are directories in which the Qt versions I installed were built. The debugger then maps those directories to the directory where I have installed Qt. The mapping works in Windows, not in Ubuntu.