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

Helpers won't run for base class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 2.3.0
    • Qt Creator 2.2.0
    • Debugger
    • None
    • cc43f534755f897eeea5333186b84fec91dbb8c0, f446bebadc936c7d6e3247037277e1985982f113

    Description

      A helper does not appear to be called correctly on a base class through a subclass (i.e. dumping the A portion of a class B that inherits from A). This appears to be due to RTTI and the use of the "dynamic_type" attribute of a GDB value with the putItem() method in dumper.py.

      This can be seen by debugging main.cpp within QtCreator and setting a breakpoint at line 28 (after the constructor runs). If you create a helper for the A class and try to introspect b, without the attached fix for dumper.py, the helper for A will not be run. After the fix, a custom helper for A will be called. This problem occurs because the dynamic_type of the value representing the A base class of B resolves back to B.

      The attached patch fixes this by allowing the caller of putItem() to override/disable the use of dynamic_type. This allows the code path which is handling base classes to override the behavior.

      Attachments

        1. fix-helper-baseclass.diff
          1 kB
        2. gdbmacros.py
          0.1 kB
        3. main.cpp
          0.3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            cyclone31 Ryan May
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes