fantaosha / LLDB-Eigen-Pretty-Printer

LLDB Eigen Pretty Printer
GNU General Public License v3.0
27 stars 11 forks source link

Pretty print in IDEs #3

Closed rkost closed 6 years ago

rkost commented 6 years ago

So I just noticed that your pretty printer performs well inside CLion when deleting all \n in the output (as the IDE just prints them like no backslash was there). That was great news but I got a small problem and was not able to explain it to myself:

When trying to print a reference of an eigen vector it will not appear on the top level in my IDE:

  Vector2f a = {0.32f, 2.56f};
  Vector2f& b = a;
  const Vector2f c = {1.5f, 6.f};

Results in:

image

While the reference is only printed when looking deeper into the structure:

image

Do you know a simple way to fix this? Not really sure how to approach this issue.

(Just so you know: If you think that this is not an issue with this pretty printer but with my IDE only you are free to close this issue - I may need to work it out myself in that case ;) )

fantaosha commented 6 years ago

It works well in my tests though I have not tested it in CLion. In fact, when developing this printer, I did encounter some problems printing references. If I remember correctly, this should be a problem of LLDB 5.0 or earlier, and be fixed in LLDB 6.0. Please let me know if LLDB 6.0 helps.

lldb_eigen

rkost commented 6 years ago

Ahh! This is indeed helpful. Clion comes bundled with lldb 5.0 and does not support custom lldb installations. Too bad - but i hope JetBrains will update asap.

I will close this for now and may update this thread if Clion received some updates.

Thanks for your help!

fantaosha commented 6 years ago

More accurately, according to https://stackoverflow.com/questions/48738074/lldb-data-formatter-for-references/48794968#48794968, this seems a bug for LLDB to print references using frame variable. And I retested my code with frame variable instead of print, I have similar problems as yours even in LLDB 6.0.