[Lldb-commits] [PATCH] D26403: Display the pointer value in the libstdc++ unique_ptr summary

Enrico Granata via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 8 10:36:14 PST 2016


granata.enrico accepted this revision.
granata.enrico added a comment.
This revision is now accepted and ready to land.

Make what you will of my suggestion above, but in general the reasoning looks good



================
Comment at: source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp:129
 
   if (m_ptr_obj->GetValueAsUnsigned(0) == 0) {
     stream.Printf("nullptr");
----------------
This is very nitpick-y but why not

lldb::addr_t ptr_value = m_ptr_obj->GetValueAsUnsigned(LLDB_INVALID_ADDRESS)
switch (ptr_value) {
  case 0: stream.Printf("nullptr"); break;
  case LLDB_INVALID_ADDRESS: return false;
  default: stream.Printf("0x%" PRIx64, ptr_value); break;
}

modulo clang-formatting the above, of course.
    


https://reviews.llvm.org/D26403





More information about the lldb-commits mailing list