Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-6854

watch window in debugger shows wrong content (win7 64bit cdb)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • Qt Creator 2.4.0
    • Debugger
    • None
    • I'm using visual studio 2010 with cdb (6.12.0002.633) running on win7 64 bit, but compiling and running for x86, qt creator 2.4 release. Complete rebuild doesn't help. I'm using a cmake-project and build type is debug.

    Description

      In the watch window the variables all have the wrong content. Here an example with source code (4 points in an array, but the other variables in the function aren't correct, too):

                 Vertex *verts[4] = {
                     (Vertex*)he->temp,
                     (Vertex*)he->mEdge->temp,
                     (Vertex*)face->temp,
                     (Vertex*)he->mPrev->mEdge->temp
                 };
                 printDebugString("%p", verts[0]);
                 printDebugString("%p", verts[1]);
                 printDebugString("%p", verts[2]);
                 printDebugString("%p", verts[3]);
      

      prints:

      [MSG] 07136878
      [MSG] 0712AB78
      [MSG] 07123F70
      [MSG] 0712AC98
      

      but the watch windows says:

      verts
      -> [0] 0x7123f70
      -> [1] 0x712ac98
      -> [2] 0xcccccccc
      -> [3] 0x111d48
      

      it seems that there is an offset of +8 because of something, [0] and [1] printed in the watchwindow is correctly [2] and [3] at the printf messages.

      this is the vertex-struct:

      struct Vertex {
            Vertex() {}
            Vertex(Vertex &src) <...>
            <here some functions>
            HalfEdge *mHalfEdge;
            Eigen::Vector3f position;
            Eigen::Vector3f normal;
            Eigen::Vector2f uv;
            Eigen::Vector4f tangent;
            uint32_t diffuseColor;
            void *temp;      //HalfEdge*
      };
      

      PS: when I enter the function the variables also have wrong content, this is the header of the function:

      void HalfEdgeMesh::subdivide(int iterations, float smoothness) {
         HalfEdgeMesh *workObject = new HalfEdgeMesh();
      
         int newVertexCount = getVertexCount() + getEdgeCount() + getFaceCount();
         int newPolyCount = getFaceCount() * 4;  //triangles and quads allowed
      
         workObject->reserveSpace(newVertexCount, newPolyCount);
         for(int i=0; i<getFaceCount(); ++i) {
      

      with a breakpoint on the first line I can see completly off results for newVertexCount and newPolyCount, after I've stepped the first line (the new HalfEdgeMesh) both variables change to <not in scope>. when the current pc stays at the for-loop the value shown for "i" is 678, also wrong.

      PPS: I've looked at the callstack:

      function2
      function1
      WinMain
      _tmainCRTStartup
      WinMainCRTSt
      BaseThreadInit
      RtlInitializeExce
      RtlInitializeExce
      

      and the variables in WinMain are shown correctly, but in function1 they're off by +8 already(and in function2 also off by +8)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            davschul David Schulz
            questor kai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes