[lldb-dev] [Bug 36403] New: LLDB Data Formatter for References

via lldb-dev lldb-dev at lists.llvm.org
Thu Feb 15 13:12:25 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36403

            Bug ID: 36403
           Summary: LLDB Data Formatter for References
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: fantaosha at gmail.com
                CC: llvm-bugs at lists.llvm.org

https://stackoverflow.com/questions/48738074/lldb-data-formatter-for-references

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20180215/a1dfb937/attachment.html>


More information about the lldb-dev mailing list