<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - "frame variable" reports incorrect values for structs with float fields"
   href="https://bugs.llvm.org/show_bug.cgi?id=36692">36692</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"frame variable" reports incorrect values for structs with float fields
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>eldar.abusalimov@jetbrains.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The issue is originally reported as
<a href="https://youtrack.jetbrains.com/issue/CPP-12328">https://youtrack.jetbrains.com/issue/CPP-12328</a> by Daniel Thompson.

Turns out, there's no minimal code snippet to illustrate the issue, but it can
be reproduced by checking out a certain revision:

1. Clone <a href="https://github.com/danielthompson/polytope.git">https://github.com/danielthompson/polytope.git</a>
2. Checkout commit 55b5229da1da58234de1a2b939a1caf346ae57a9
3. Set a breakpoint on Transform.cpp line 148.
4. Compare output of console with what's displayed in the Variables window for
variable `r`.

The function in question
(<a href="https://github.com/danielthompson/polytope/blob/55b5229da1da58234de1a2b939a1caf346ae57a9/src/structures/Transform.cpp#L139-L150">https://github.com/danielthompson/polytope/blob/55b5229da1da58234de1a2b939a1caf346ae57a9/src/structures/Transform.cpp#L139-L150</a>):
```
   Ray Transform::Apply(const Ray &ray) const {
      Point p = (*this).Apply(ray.Origin);
      Vector v = (*this).Apply(ray.Direction);

      Ray r(p, v);

      std::cout << "o.x: " << r.Origin.x << ", o.y: " << r.Origin.y << ", o.z:
" << r.Origin.z << std::endl;
      std::cout << "d.x: " << r.Direction.x << ", d.y: " << r.Direction.y << ",
d.z: " << r.Direction.z << std::endl;

      return r;  // <- BREAKPOINT HERE

   }
```

`frame variable` output:
```
(const Polytope::Transform *) this = 0x00007fb2aee0023c
(const Polytope::Ray &) ray = 0x00007ffee0e73b20: {
  Origin = (x = 0, y = 0, z = 0)
  Direction = (x = -0.490027964, y = 0.367136955, z = -0.790621936)
  DirectionInverse = (x = 0.490027964, y = -0.367136955, z = 0.790621936)
  MinT = +Inf
  MaxT = +Inf
}
(Polytope::Point) p = (x = 0, y = 0, z = 0)
(Polytope::Vector) v = (x = -0.490027964, y = 0.367136955, z = -0.790621936)
(Polytope::Ray) r = {
  Origin = (x = -1.33297964E+20, y =
0.0000000000000000000000000000000000000000459149455, z = -0.490027964) //
doesn't match cout
  Direction = (x = 0.367136955, y = -0.790621936, z =
0.0000000000000000000000000000000000000000459149455) // doesn't match cout
  DirectionInverse = (x = 0, y = 0, z = 0)
  MinT = 0.00000000000000000000000000000000000000000000140129846
  MaxT = -0.490027964
}
```

The values displayed x, y, and z fields of r.Origin and r.Direction do not
match what's printed by std::cout:
```
o.x: 0, o.y: 0, o.z: 0
d.x: -0.490028, d.y: 0.367137, d.z: -0.790622
```

Compiler:
```
[~] => c++ --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```</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>