Results 1 to 12 of 12

Thread: Qt 4.8: Step into Qt's source code on Windows using MSVC

  1. #1
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt 4.8: Step into Qt's source code on Windows using MSVC

    Hi,

    I was wondering whether there is a way to step into Qt's source code on Windows using MSVC? Right now, if I try to trace into Qt's source code, it will go into whatever code is located in a Qt header file, but not in anything which is located in Qt .cpp file. I have donwloaded Qt's source code, but I was surprised to find out that is located in a complete different place to where Qt's header files are. Anyway, any help on this (and, to some extent, the same on Linux and Mac OS X) would be much appreciated...

    Cheers, Alan.

  2. #2
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Your thread would better fit into "Installation and Deployment" .

    You have the source of Qt?
    The you should compile it with the configure option -debug-and-release.
    After the nmake you will have two version of the Qt libraries, e.g. QtCore4.dll and QtCored4.dll.
    The 'd' in the second filename marks the file as the one with debug information included.
    When compiling as debug version in Visual Studio you can step into all Qt functions.

  3. #3
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Quote Originally Posted by Boron View Post
    You have the source of Qt?
    Yes

    Quote Originally Posted by Boron View Post
    The you should compile it with the configure option -debug-and-release.
    After the nmake you will have two version of the Qt libraries, e.g. QtCore4.dll and QtCored4.dll.
    The 'd' in the second filename marks the file as the one with debug information included.
    When compiling as debug version in Visual Studio you can step into all Qt functions.
    Hmm... why should I have to compile Qt? I have downloaded and installed the Qt SDK and asked for the MSVC version of Qt to be installed. Also, and for good measure, I thought, I installed Qt's source code. So, from there, I would expect to be able to trace into Qt's source code using CDB from within Qt Creator, but I am clearly wrong since I can't seem to be able to do that...

  4. #4
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    I thought you were using Visual Studio and a self compiled Qt.
    Unfortunately I never used the Qt SDK and Qt Creator, so I am sorry for not being able to help you .

  5. #5
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Usually I work with Qt 4.6 and there it works out of the box but when I've tried 4.8 I had the same issue as you.
    Never had time to look into that though ;/

    If you find an answer, please post it here

  6. #6
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Quote Originally Posted by Spitfire View Post
    Usually I work with Qt 4.6 and there it works out of the box but when I've tried 4.8 I had the same issue as you.
    Could it be that Qt 4.6 ships with PDB files while Qt 4.8 doesn't? (Just a very wild guess since I am not very familiar with MSVC.)

  7. #7
    Join Date
    Apr 2012
    Posts
    7
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Quote Originally Posted by agarny View Post
    Hmm... why should I have to compile Qt? I have downloaded and installed the Qt SDK and asked for the MSVC version of Qt to be installed.
    If you use the QtSDK installer, I don't think that you can get the source code files. It's the case for me, and I've checked carefully (I have two different installations of Qt on my computer, one using QtSDK installer and the other compiled by myself. And for the second one, the source files are in the /src folder).

  8. #8
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Quote Originally Posted by Nesbit View Post
    If you use the QtSDK installer, I don't think that you can get the source code files. It's the case for me, and I've checked carefully (I have two different installations of Qt on my computer, one using QtSDK installer and the other compiled by myself. And for the second one, the source files are in the /src folder).
    I used the QtSDK installer and I definitely have the source files (under C:\QtSDK\QtSources\4.8.0\src). See here for how I installed the Qt SDK.

  9. #9
    Join Date
    Jun 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    I am using 4.8.1 SDK and Qt Creator 2.5, so things may be a little bit different for you...
    This works for me:

    1) install Debugging Tools for Windows
    2) in Qt Creator: Tools > Options > Debugger > Source Paths Mapping - add:

    Source path: c:\iwmake\build_vs2010_opensource_________________ PADDING_________________
    Target path: c:\QtSDK\QtSources\4.8.1

    I found source path by looking for some "path-like" strings in PDB files under c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib.

  10. #10
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Quote Originally Posted by krabicezpapundeklu View Post
    I am using 4.8.1 SDK and Qt Creator 2.5, so things may be a little bit different for you...
    I personally use Qt 4.8.0 with Qt Creator 2.4.1.

    Quote Originally Posted by krabicezpapundeklu View Post
    1) install Debugging Tools for Windows
    I already had them installed so that I could debug using CDB using Qt Creator.

    Quote Originally Posted by krabicezpapundeklu View Post
    2) in Qt Creator: Tools > Options > Debugger > Source Paths Mapping - add:

    Source path: c:\iwmake\build_vs2010_opensource_________________ PADDING_________________
    Target path: c:\QtSDK\QtSources\4.8.1

    I found source path by looking for some "path-like" strings in PDB files under c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib.
    Ok, I thought I would look for PDB files under c:\QtSDK\Desktop\Qt\4.8.0\msvc2010\lib, but couldn't find any.

    I use Qt SDK so I decided to double check what is the latest version of Qt and Qt Creator which comes with it. The Update Qt SDK program tells me that there are no updates available, yet the website says that the latest version of Qt SDK comes with Qt 4.8.1, and indeed if I decide to maintain (rather than update) my copy of Qt SDK, then I can see that Qt 4.8.1 is available (hmm... so much for the Update Qt SDK program!).

    Anyway, I have upgraded my copy of Qt to version 4.8.1 and I can now see some PDB files. So, there is already a difference between Qt 4.8.0 and Qt 4.8.1...

    Next, I did what you suggested, but unfortunately for me, it doesn't work in my case (I mean, I tried to trace into the QApplication code using the 'mainwindow' Qt demo, but to no avail). Maybe it's related to my using Qt Creator 2.4.1 while you use version 2.5?...

  11. #11
    Join Date
    Jun 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    I tried Qt Creator 2.4.1 and it works too...
    Can you start debugging, hit some breakpoint and then:

    1) open Window > Views > Debugger Log
    2) execute !lmi QtCored4 command?

    I get:

    Loaded Module Info: [qtcored4]
    Module: QtCored4
    Base Address: 000000006d670000
    Image Name: C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\QtCored4.dl l
    Machine Type: 332 (I386)
    Time Stamp: 4f619340 Thu Mar 15 07:59:12 2012
    Size: 449000
    CheckSum: 445fcf
    Characteristics: 2102
    Debug Data Dirs: Type Size VA Pointer
    CODEVIEW 74, 39664c, 39544c RSDS - GUID: {D9B88246-65E9-4B48-8C50-AA74663B223F}
    Age: 1, Pdb: c:\iwmake\build_vs2010_opensource_________________ PADDING_________________\lib\QtCored4.pdb
    Symbol Type: DEFERRED - No error - symbol load deferred
    Load Report: no symbols loaded

    Maybe image name is different?

  12. #12
    Join Date
    Mar 2010
    Posts
    319
    Thanks
    1
    Thanked 14 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.8: Step into Qt's source code on Windows using MSVC

    Ok, I have just tried what you suggested and I got the exact same result except for the base address, as well as... a space before "PADDING" in your version of the source path. In my comment above (#10), I used your version (with the space) which is the reason things were not working for me. Now, I am using the version (without a space before "PADDING") and everything works as expected. So, thanks a lot for following up on my issue. Much appreciated!

    PS: the issue with the space before "PADDING" is the forum's fault: it is it which added a space!

Similar Threads

  1. Qt 4.7.0 source compilation errors (MSVC 2010, Windows 7 Ultimate 64-bit)
    By andrey.khaletsky in forum Installation and Deployment
    Replies: 3
    Last Post: 30th September 2010, 08:16
  2. Qt Creator Debugging step by step through else rich code does not work
    By Terjoqu in forum Qt Tools
    Replies: 1
    Last Post: 11th March 2010, 21:44
  3. How to step inside(debug) webkit code?
    By nish in forum Qt Programming
    Replies: 5
    Last Post: 30th December 2009, 12:23
  4. Open source dev on windows: MinGW vs MSVC
    By magland in forum Installation and Deployment
    Replies: 4
    Last Post: 29th December 2007, 08:20
  5. QT Open Source, Designer and MSVC++
    By bradcb212 in forum Qt Programming
    Replies: 1
    Last Post: 4th October 2007, 05:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.