<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - LLDB calls wrong C++ method when virtual hides non-virtual"
   href="https://llvm.org/bugs/show_bug.cgi?id=28940">28940</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB calls wrong C++ method when virtual hides non-virtual
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dberlin@dberlin.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If i have a virtual in a subclass that hides a non-virtual in a base-class,
LLDB calls the non-virtual.


Example from LLVM:

class Value {
..
  /// \brief Support for debugging, callable in GDB: V->dump()
  void dump() const;
}

<somewhere else>

class MemoryAccess: public Value {
 virtual void dump() const;
}


(lldb) p Dominator->MemoryAccess::dump()
1 = MemoryDef(liveOnEntry)

(this is the correct dump)

(lldb) p Dominator->dump()
While deleting: void %
Use still stuck around after Def is destroyed:Unknown value to print out!
UNREACHABLE executed at ../lib/IR/AsmWriter.cpp:3437!
error: Execution was interrupted, reason: signal SIGABRT.
The process has been returned to the state before expression evaluation.

This is calling Value::dump().

What dump is called certainly depends on the pointer type.
If the pointer type here was Value*, i would expect this behavior.

However, it is "const MemoryAccess *Dominator", so it should be calling the
virtual dump here.

(and for anyone curious, fixing llvm ... would be hard :P)


gdb calls the correct dump here :)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>