Setup of Qt Creator to debug into Qt classes

后端 未结 5 1345
闹比i
闹比i 2020-12-29 05:57

I want to setup Qt Creator (3.0) in a way, that I can debug into the Qt classes. So I download the corresponding src code (http://gitorious.org/qt/qt5) and install it in a d

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-29 06:29

    With Xcode, before you step into the Qt library the first time, enter the following command in the LLDB window:

    settings set target.source-map /Users/qt/work/qt /path/to/Qt/5.10.1/Src
    

    (Obviously you'll want to change the version number, as relevant).

    But suppose Trolltech changes its build directory, what to do then? (Or, how did the community wiki that gave the /Users/qt/work/qt path find it?) You can guess what the path needs to be by editing /path/to/Qt/5.10.1/clang_64/lib/QtCore.framework.dSYM/Contents/Resources/DWARF/QtCore_debug (or any other Qt library) and searching for some paths. "/Users" seems like a good guess. About 2% into the library you'll start seeing sections with a lot of paths like:

    ../../include/QtCore/../../src/corelib/kernel^@../../include/QtCore       
    /../../src/corelib/tools^@global^@/Users/qt/work/qt/qtbase/src/corelib
    /../../include/QtCore/../../src/corelib/arch^@/Applications/Xcode.app
    /Contents/Developer/Toolchains/XcodeDefault.xctoolchain/
    

    Look for an absolute path that looks like it could be writable. (/Applications/... would not be a likely build path, for example)

提交回复
热议问题