Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Pretty Printer for std::vector not working
Forum Updated to NodeBB v4.3 + New Features

Pretty Printer for std::vector not working

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
14 Posts 3 Posters 3.7k Views 2 Watching
  • 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.
  • T tkansgar

    Hi,

    I just tested your code (with one small extension):
    0_1555518747884_Bildschirmfoto vom 2019-04-17 18-29-08.png
    I see only "<not accessible>", where you see the four vector items. But the program works as expected.

    I also tried this tip from a colleague: https://sourceware.org/gdb/wiki/STLSupport. It's just implemented here, but doesn't help too.

    Does anyone know, that QtCreator 4.6.2 cannot display std::vevtor values? I really can't believe that.

    Best Regards
    tkansgar

    aha_1980A Offline
    aha_1980A Offline
    aha_1980
    Lifetime Qt Champion
    wrote on last edited by
    #5

    @tkansgar why don't you upgrade Creator?

    4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released

    and as shown above, it works nicely.

    Qt has to stay free or it will die.

    T 1 Reply Last reply
    1
    • aha_1980A aha_1980

      @tkansgar why don't you upgrade Creator?

      4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released

      and as shown above, it works nicely.

      T Offline
      T Offline
      tkansgar
      wrote on last edited by
      #6

      @aha_1980 said in Pretty Printer for std::vector not working:

      @tkansgar why don't you upgrade Creator?

      4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released

      and as shown above, it works nicely.

      Hi,

      I installed 4.9.0. But now all gets much worse! When I now try to debug the program above, gdb hangs at the breakpoint at the beginning of main, increases its memory usage up to ~57GB and then terminates. What is going wrong here now?

      Best Regards
      tkansgar

      aha_1980A 1 Reply Last reply
      0
      • T tkansgar

        @aha_1980 said in Pretty Printer for std::vector not working:

        @tkansgar why don't you upgrade Creator?

        4.9 was released some day ago: https://blog.qt.io/blog/2019/04/15/qt-creator-4-9-0-released

        and as shown above, it works nicely.

        Hi,

        I installed 4.9.0. But now all gets much worse! When I now try to debug the program above, gdb hangs at the breakpoint at the beginning of main, increases its memory usage up to ~57GB and then terminates. What is going wrong here now?

        Best Regards
        tkansgar

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #7

        @tkansgar

        What is going wrong here now?

        I really don't know! And it is the simple example from above?

        Have you already removed the build foldr and .pro.user file and tried again?

        Qt has to stay free or it will die.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tkansgar
          wrote on last edited by
          #8

          @aha_1980 said in Pretty Printer for std::vector not working:

          @tkansgar

          What is going wrong here now?

          I really don't know! And it is the simple example from above?

          Have you already removed the build foldr and .pro.user file and tried again?

          Hi aha_1980,

          yes, source and binary are those from 4/17/2019. Nothing is rebuilt. And I don't have any project files for this sample. I just used "Debug external application" from the Debug menu in both test cases.

          And I just tested gdb with this sample from the shell command line (without QtCreator). It works very fine (and can print the four values of v too):

          (gdb) print v
          $1 = std::vector of length 4, capacity 4 = {1, 2, 3, 4}
          

          Any ideas?

          Best Regards
          tkansgar

          aha_1980A 1 Reply Last reply
          0
          • T tkansgar

            @aha_1980 said in Pretty Printer for std::vector not working:

            @tkansgar

            What is going wrong here now?

            I really don't know! And it is the simple example from above?

            Have you already removed the build foldr and .pro.user file and tried again?

            Hi aha_1980,

            yes, source and binary are those from 4/17/2019. Nothing is rebuilt. And I don't have any project files for this sample. I just used "Debug external application" from the Debug menu in both test cases.

            And I just tested gdb with this sample from the shell command line (without QtCreator). It works very fine (and can print the four values of v too):

            (gdb) print v
            $1 = std::vector of length 4, capacity 4 = {1, 2, 3, 4}
            

            Any ideas?

            Best Regards
            tkansgar

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #9

            @tkansgar

            And I don't have any project files for this sample. I just used "Debug external application" from the Debug menu in both test cases.

            Can you try with a minimal project?

            I guess debugging external apps is more rarely used...

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • T Offline
              T Offline
              tkansgar
              wrote on last edited by
              #10

              Hi again,

              I found some time to create a project for my test file. But the issue remains the same. gdb reaches the breakpoint at the opening { of main and hangs. In the variables view on the right there is an endless turning circle radial lines. top shows 100% CPU usage for gdb and its memory comsumption increases more and more. Then I killed gdb.

              Started on the command line gdb works totally normally with my test file, just like expected. So it must be an issue with qtcreator but not gdb. My suspicion is, it has to do with the attempt of qtcreator to get the variable values from gdb.

              Do you need some more info about my test project?

              Best Regards
              tkansgar

              aha_1980A 1 Reply Last reply
              0
              • T tkansgar

                Hi again,

                I found some time to create a project for my test file. But the issue remains the same. gdb reaches the breakpoint at the opening { of main and hangs. In the variables view on the right there is an endless turning circle radial lines. top shows 100% CPU usage for gdb and its memory comsumption increases more and more. Then I killed gdb.

                Started on the command line gdb works totally normally with my test file, just like expected. So it must be an issue with qtcreator but not gdb. My suspicion is, it has to do with the attempt of qtcreator to get the variable values from gdb.

                Do you need some more info about my test project?

                Best Regards
                tkansgar

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by
                #11

                @tkansgar

                Do you need some more info about my test project?

                Every info you have helps to solve the issue.

                But for your current problem, you can directly create a report at bugreports.qt.io - please add a link here. Attach the sample project and the debugger log (Window > Views > Debugger Log) there.

                sorry, but thats all I can do for you now :(

                Qt has to stay free or it will die.

                T 1 Reply Last reply
                0
                • aha_1980A aha_1980

                  @tkansgar

                  Do you need some more info about my test project?

                  Every info you have helps to solve the issue.

                  But for your current problem, you can directly create a report at bugreports.qt.io - please add a link here. Attach the sample project and the debugger log (Window > Views > Debugger Log) there.

                  sorry, but thats all I can do for you now :(

                  T Offline
                  T Offline
                  tkansgar
                  wrote on last edited by
                  #12

                  Hi again,
                  I just tried it with qtcreator 4.8.2. The result is the same. When encountering the first breakpoint in the test code, gdb hangs (trying to obtain the variable values).

                  @aha_1980 said in Pretty Printer for std::vector not working:

                  ...

                  But for your current problem, you can directly create a report at bugreports.qt.io - please add a link here. Attach the sample project and the debugger log (Window > Views > Debugger Log) there.

                  I wil do that now and come back again here.

                  Best Regards
                  tkansgar

                  1 Reply Last reply
                  1
                  • T Offline
                    T Offline
                    tkansgar
                    wrote on last edited by
                    #13

                    Here is the link to my bug report:
                    https://bugreports.qt.io/browse/QTCREATORBUG-22483

                    1 Reply Last reply
                    2
                    • T Offline
                      T Offline
                      tkansgar
                      wrote on last edited by
                      #14

                      Hi again,

                      I just solved both issues, displaying std::vector item values and hanging of gdb in qtcreator 4.9: If I switch on both "Use Debugging Helper" and "Load system GDB pretty printers", gdb hangs on the first breakpoint. If one of them is switched off, gdb works properly. But "Load system GDB pretty printers" seems to be useless for me now, and "Use Debugging Helper" provides exactly that functionality I missed here.

                      Best Regards
                      tkansgar

                      1 Reply Last reply
                      1

                      • Login

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