<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 - LLDB Data Formatter for References"
   href="https://bugs.llvm.org/show_bug.cgi?id=36403">36403</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB Data Formatter for References
          </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>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>fantaosha@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://stackoverflow.com/questions/48738074/lldb-data-formatter-for-references">https://stackoverflow.com/questions/48738074/lldb-data-formatter-for-references</a>

I'm currently developing data formatters for my own types. However, I encounter
some problems to print references.

#include <iostream>

class Circle
{
  protected:
    double R;
    double a;
    double b;

  public:
    Circle():R(1), a(0), b(0)
    {
    }
};

int main()
{
  Circle A;
  Circle & B = A;

  return 0;
}

And I use type summary add to customize my own data formatters

(lldb) type summary add -s "The circle is (R = ${var.R}, a = ${var.a}, b =
${var.b})" Circle
Now it goes very well for non-references, for example

(lldb) frame variable A
(Circle) A = The circle is (R = 1, a = 0, b = 0)
However, for references,

(lldb) frame variable B
(Circle &const) B = 0x00007fffffffd200 The circle is (R = 1, a = 0, b = 0): {
  R = 1
  a = 0
  b = 0
}
for which the contents after ":" is not wanted.

It seems that this is a bug.</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>