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

[REG] Use Dynamic Type option is not respected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.13.0-beta1
    • Fix Version/s: Qt Creator 4.13.0-beta1
    • Component/s: Debugger
    • Labels:
      None
    • Environment:
      Windows, GDB 9.1
    • Commits:
      00e814fdd18dadbea5942d002914b99fb07c4048

      Description

      Dynamic types are used whether the option is checked or not.

      Break at the line with the comment - both objects are displayed as Derived.

      Now step to the next line - both objects are displayed as Base.

      This is the expected behavior when "Use Dynamic Type" is checked, but when it is unchecked - b should always be Base and d should always be Derived. That part is broken.

      #include <new>
      
      struct Base { virtual ~Base() {} };
      struct Derived : Base { int a = 42; };
      
      int main()
      {
          char Buf[32];
          Derived *d = new(Buf) Derived;;
          Base *b = d;
          d->~Derived(); // BREAK_HERE
          return 0;
      }

      This happened long ago, reported as QTCREATORBUG-7504, and I fixed it. Now it happens again (I can't tell for sure on which version the regression was introduced).

        Attachments

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

          Activity

            People

            Assignee:
            orgads Orgad Shaneh
            Reporter:
            orgads Orgad Shaneh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes