How to configure qt creator to show C++ codes rather than disassembler?

后端 未结 4 1583
说谎
说谎 2021-02-15 12:07

Yesterday I had done a lot of things like updating GCC,Clang and reinstalling Qt Creator.Today when debugging my codes step by step, the debugger was showing the disassembler r

4条回答
  •  不思量自难忘°
    2021-02-15 12:41

    I ran into a very similar problem debugging code built with the clang toolset in qtcreator, and this answer fixed me up:

    gdb doesn't find source files compiled by clang++

    You can quickly check if that solution will work for you by navigating to the root of your solution in a shell window and then invoking qtcreator from there...set a break point in main() and try debugging - if it stops and shows source in main.cpp, it's quite likely this is the problem.

    If that does work for you, there are probably several better ways to implement the permanent solution suggested by https://stackoverflow.com/users/1632219/rene, but the method that worked for me was to modify my qmake mkspec file for the clang toolset. On my system, it lives in /usr/local/Trolltech/Qt-4.8.5/mkspecs/common/clang.conf, so all I had to do was put a clang invoker script with 'clang++ "$@"' in ~/bin/clang-compile and then set QMAKE_CXX in the mkspec to clang-compile. With that change, when the clang toolset is selected, qmake builds make files that use clang-compile instead of clang++ and then debugging works everywhere.

提交回复
热议问题