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. QVector instance passed into a method by reference is inaccessible to the debugger
QtWS25 Last Chance

QVector instance passed into a method by reference is inaccessible to the debugger

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 3 Posters 554 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.
  • I Offline
    I Offline
    In Fo
    wrote on last edited by
    #1

    I pass an instance of QVector into my method

    const QVector<quint32>& vec
    

    but when I hover above the variable, the debugger says

    vec <not accessible>

    and if I add an expression evaluator, it does not evaluate.
    I am in QT Creator 4.7.2 under QT 5.11.3 in Windows with Win SDK 10 CDB for a debugger.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Probably got optimized away or function got inlined. Are you running a Release config by any chance?

      1 Reply Last reply
      4
      • I Offline
        I Offline
        In Fo
        wrote on last edited by In Fo
        #3

        I do not believe it is possible to debug a release config. At least it does not occur to me to try. I am in a debug config.
        How can a compiler optimize away an instance of a class?

        JonBJ Chris KawaC 2 Replies Last reply
        0
        • I In Fo

          I do not believe it is possible to debug a release config. At least it does not occur to me to try. I am in a debug config.
          How can a compiler optimize away an instance of a class?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @In-Fo
          We could have a long discussion about how & why compilers can indeed optimize this and many other statements away. (Even in debug: I recall being surprised and having a conversation about this a long time ago.)

          In terms of practical, from where you are now. You could fiddle with code to try to introduce another variable or statement to resurrect your debugging ability on this symbol. But I'm just thinking: since it's a reference parameter, does your CDB allow you to go up to the calling frame simply and display the vector passed in there? Which may suffice for your debugging experience, if this is not a huge issue.

          1 Reply Last reply
          2
          • I In Fo

            I do not believe it is possible to debug a release config. At least it does not occur to me to try. I am in a debug config.
            How can a compiler optimize away an instance of a class?

            Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            I do not believe it is possible to debug a release config

            You better believe it :) release configs are just optimized. They can have debug info just the same as Debug builds.

            How can a compiler optimize away an instance of a class?

            Easily ;) CPUs don't have a notion of classes. It's all just bytes to them.

            It sounds a bit weird in a Debug build though. Could you provide a minimal compilable example of that problem?

            1 Reply Last reply
            2
            • I Offline
              I Offline
              In Fo
              wrote on last edited by
              #6

              I am trying plain old pointers and none of the buf[0] kind of inspectors work.

              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