[Lldb-commits] [PATCH] D30272: Improve data formatter for libstdcpp unique_ptr

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 23 02:44:08 PST 2017


labath added a comment.

Jim's comment definitely makes sense. If we happen to not use pretty-printer for the unique_ptr, it will not behave as a pointer-like object, and it should be formatted as a normal struct (I have no idea how much of a challenge it would be to implement it that way).



================
Comment at: source/DataFormatters/ValueObjectPrinter.cpp:515
   const bool is_ptr = IsPtr();
+  const bool is_ref_or_ptr_like = IsRef() || IsPointerLikeObject();
   const bool is_uninit = IsUninitialized();
----------------
Is there are reason you are bundling the is-pointer-like with the is-ref flag instead of the is-ptr one (which would be more logical)? If there is one it certainly isn't obvious.


================
Comment at: source/Target/StackFrame.cpp:637
+        } else {
+          error.SetErrorStringWithFormat(
+              "Failed to dereference a pointer like object: %s",
----------------
SetErrorStringWithFormatv (and then you can drop the .AsCString from the deref_error).


https://reviews.llvm.org/D30272





More information about the lldb-commits mailing list