<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 --- - transparent_pointers not working"
   href="https://llvm.org/bugs/show_bug.cgi?id=23299">23299</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>transparent_pointers not working
          </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@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ribrdb@google.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While working on a LanguageRuntime plugin for go, I noticed some strangeness
with ValueObjects for pointers.
If I use valobj.GetChildMemberWithName(...), it returns a child, but with the
wrong address so the value is unusable.
However, if I use valobj.Dereference()->GetChildMemberWithName(...) I can read
the data.

I think I've tracked this down to an interaction between
ValueObject::GetPointerValue and ValueObjectChild::UpdateValue:
 - UpdateValue performs pointer arithmetic, saves the result in
m_value.GetScalar(), and sets the value type to an address (could be Host, Load
or FileAddress).
 - However, GetPointerValue only uses m_value if the value type is
eValueTypeScalar or eValueTypeVector.

So at least in the case where the offset is != 0, GetPointerValue seems to be
returning something wrong.
Simply changing the value type to scalar doesn't work, because other code is
expecting it to be some sort of address.

Unfortunately I haven't found a way to reproduce this using the public api so I
can't write a test for it.</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>