Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Qt Contribution
  4. can't debug hand-built Qt Frameworks

can't debug hand-built Qt Frameworks

Scheduled Pinned Locked Moved Unsolved Qt Contribution
32 Posts 2 Posters 5.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by davecotter
    #1

    so i got all the Qt frameworks built, and configured my Qt Creator kit to so my project can use them.
    but when i break in the debugger, apparently debug symbols aren't loaded, so i can't see the source code:

    note eg: lines 13 and 14: they are "grayed out" indicating no source code. even though as you can see they are in the "Qt5_Source" directory, which is where i built Qt myself.

    Screen Shot 2021-06-29 at 8.33.26 AM.png

    i've set "source path mapping" too:

    Screen Shot 2021-06-29 at 9.03.36 AM.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Might be a silly question but did you do a debug build ?
      If memory serves well a pure debug build does not generate frameworks, only libraries.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        davecotter
        wrote on last edited by davecotter
        #3

        to build the qt5 source i did these things:

        > ../qt5/configure -prefix ./obj/debug -developer-build -opensource -nomake examples -nomake tests -confirm-license
        > make
        

        doesn't that mean i built the debug version? if not, how do i build both debug and release?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          A developer build is an in place build with some special flags. You need to pass the -debug-and-release parameter to configure.

          Why are you passing a prefix when doing a developer build ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            davecotter
            wrote on last edited by
            #5

            i was under the impression that if i do NOT pass a prefix that it will leave artifacts in the source directory.

            so are you saying that my configure command should be this:

            > ../qt5/configure -developer-build  -debug-and-release -opensource -nomake examples -nomake tests -confirm-license
            

            should i bother with adding -developer-build? does it give me any advantage? if i add -debug-and-release are the frameworks put in separate directories?

            please bear with me this is all brand new to me

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6
              1. Do out of source builds. That way you keep your sources clean
              2. Unless you plan to hack on Qt, no drop the flag
              3. if you drop the flag, use a suitable prefix
              4. From memory it will make frameworks with both inside

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • D Offline
                D Offline
                davecotter
                wrote on last edited by davecotter
                #7
                1. what does "do out of source builds" mean?
                2. when you say "hack" do you mean "edit Qt source code"? and if so, then yes, that's the only reason one would want to build from source in the first place, that i can think of. yes i definitely need to edit the source code. to be clear we're talking about the -developer-build flag, right? so i should keep it?
                3. i am not dropping the flag, right? so no need to use prefix? where do the files go then?
                4. are these frameworks, with both debug and release inside, suitable for deploying release apps? i think i wouldn't want my actual release app to have debug frameworks. will "macdeployqt" just "do the right thing" ?

                please err on the side of extra verbosity in your replies. remember that things that you feel you've always known, or that everybody knows, or seem very obvious to you, some of these things are simply not even on my radar.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8
                  1. literally what it says: build in a folder outside of the source tree.
                  2. there are various reasons: build Qt with a different set of options, build a reduced version of Qt with features disabled to lower its footprint, etc. So yes you can keep the developer build option
                  3. no do not use the prefix flag. As already said it creates an in-place build so you do not need to call make install after each build.
                  4. no they are not. The developer build also enables some additional flags (sorry I don't have them on the top of my head) that makes the build less optimized than a usual release build. When you release an application use a proper release build for that.

                  One additional thing: build only what you really need and skip webengine in any case unless you have to.

                  There's no sense in building everything if you are only going to hack on qtbase. You will just waste time, space and electricity.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • D Offline
                    D Offline
                    davecotter
                    wrote on last edited by
                    #9

                    1: to build in a folder outside of the source tree, doesn't that mean using -prefix? or does it just mean set the current working directory to the location you want the build artifacts, and invoke "make" from that location?
                    2: okay, so keep the -developer-build option
                    3: see 1
                    4: so how do i create this "proper release build" that has the changes i've made to the Qt source? to be clear: i want to create both debug and release builds of Qt, and deploy my app WITH the release builds that i've built
                    5: does macdeployqt magically do the right thing?
                    6: by "build only what you really need" do you mean build only the modules that i have specified in my qmake file at the top? eg: if my .pro file has this line:

                    QT += core gui sql widgets multimedia multimediawidgets
                    

                    does that mean i only need to build those modules?

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by SGaist
                      #10
                      1. no, prefix is for the installation of the build result.

                      Snip

                      1. make a standard non developer build once you are satisfied with the changes you did with Qt.

                      2. there's nothing macdeployqt can do beside deploying the frameworks that were used to build your application. It's a helper tool that uses standard commands to create the dmg. So deploying your application with a developer build of Qt is not recommended.

                      3. with that list you need to build qtbase and qtmultimedia. Note that having only these two will disable the qml support in qtmultimedia.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1
                      • D Offline
                        D Offline
                        davecotter
                        wrote on last edited by
                        #11

                        so, to recap, i need to do these commands:

                        > cd <path_to>/Qt5_Source/build
                        > ../qt5/configure -developer-build -debug-and-release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                        > make
                        > ../qt5/configure -prefix ./release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                        > make
                        > make install
                        
                        1. is that all correct?
                        2. and after that i can build either debug or release version of my app and it should work?
                        3. and i can debug into the source of Qt?
                        4. and when i run macdeployqt, it will use my built version of Qt?
                        5. do i need to specify anything extra on the command line for macdeployqt?
                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12
                          1. no use two different build folder
                          2. it should
                          3. you should be able to
                          4. yes, note that you may need to build the qttools module or macdeployqt directly from it. But you should be able to use the one from your pre-built installation.
                          5. that depends on how you want to distribute your application. You should sign it and possibly notarize it.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            davecotter
                            wrote on last edited by davecotter
                            #13
                            1. do you mean this:
                            > cd <path_to>/Qt5_Source/build
                            > ../qt5/configure -prefix ./debug -developer-build -debug-and-release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                            > make
                            > ../qt5/configure -prefix ./release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                            > make
                            

                            if you don't mean that can you please just spell out exactly what you mean?
                            4) do you mean this:

                            ../qt5/configure -prefix ./release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia -feature qttools
                            

                            if not can you spell out what you mean?
                            5) yes i only have macdeployqt do the linking / signing / hardening. i already have a post process that builds a dmg and notarizes. i was only asking if i need something extra on the macdeployqt command line to get it to use MY copies of the built binaries for Qt

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by SGaist
                              #14
                              1. I mean: use two different folders for your out of source builds. You do not want it mix the build artifacts of your developer build and your release build.

                              Snip

                              1. If memory serves well, macdeployqt will use the information from the frameworks linked in your application to get the Qt frameworks to be copied into the app bundle.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                davecotter
                                wrote on last edited by davecotter
                                #15
                                1. do you mean this:
                                > cd <path_to>/Qt5_Source/build/debug
                                > ../../qt5/configure -developer-build -debug-and-release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                                > make
                                > cd <path_to>/Qt5_Source/build/release
                                > ../../qt5/configure -prefix ./obj -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                                > make
                                > make install
                                
                                1. what about 4. above?
                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  You should use more meaningful names for your folders. Your developer build is not just a debug build.
                                  Using obj as prefix is really strange considering that this folder is going to contain a full Qt installation.

                                  I missed that you used "feature". This a different thing. You do not need it right now. Currently you want to use the "-skip" parameter to avoid building certain qtXXX modules.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • D Offline
                                    D Offline
                                    davecotter
                                    wrote on last edited by
                                    #17

                                    believe me when i say i very much appreciate your bearing with me and continuing to answer my questions, but it's also true that you're assuming i have a lot of knowledge that you have, that i definitely don't have.

                                    can you please spell out EXACTLY what the command lines should be for me to build both debug and release, and please include what you mean by "more meaningful names" because i do NOT know what you have in mind.

                                    please would you be willing to just type up the command lines that you would use to do what i am trying to do, cuz i do not know what you mean. thanks...

                                    1 Reply Last reply
                                    0
                                    • D Offline
                                      D Offline
                                      davecotter
                                      wrote on last edited by davecotter
                                      #18

                                      perhaps i can be more clear in my question.

                                      1. what would you recommend for "meaningful names" ?
                                      2. what name would you recommend in place of where i used "obj" ?
                                      3. instead of using "feature" to include only the features i want, you suggest using "skip" to skip the features i do not want. how do i get a list of features that can go into "skip", and how do i know which ones i want to include on the "skip" line?
                                      1 Reply Last reply
                                      0
                                      • D Offline
                                        D Offline
                                        davecotter
                                        wrote on last edited by
                                        #19

                                        pretty please? with <insert favorite indulgence> on top?

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by SGaist
                                          #20
                                          1. use the Qt version in the name of folder. for example Qt_5_15_2_devel_build
                                          2. at least the Qt version as above.
                                          3. you are mixing modules and features. These are separate concepts. Skip everything you do not want to build.

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved