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

QByteArray "not accessible" after fromRawData()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 3.5.0
    • Qt Creator 3.5.0
    • Debugger
    • Windows 7 64 bit
      Qt 5.4.2, Qt 5.5.0
      MinGW g++ 4.9.1
      gdb 7.8
    • 1b5e5656f67ca0954a8ea67cbb8d6e86fb543aa3

    Description

      1. Have the following lines in a source file:
        QByteArray ba1 = "Hello";
        QByteArray ba2 = QByteArray::fromRawData("world", 5);
        QByteArray ba3 = ba2;
        QByteArray ba4 = ba3.data();
        
      2. Place a breakpoint in the last of these lines.
      3. Build it all on MinGW and let gdb hit the breakpoint.
        In Locals and Expressions view, only ba1 is shown correctly. The other QByteArrays are "not accessible".
      4. Step forward.
        ba4 is being initialized and Locals and Expressions view correctly displays its value. ba3 also becomes readable. Calling ba3.detach() would make it readable, too.

      Locals and Expressions view should always display the contents of an initialized QByteArray, no matter if it was detached or not.

      A simple copy using QByteArray ba1 = ba0; does not trigger this problem.

      Attachments

        1. left.log
          4 kB
        2. right.log
          41 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes