[Lldb-commits] [PATCH] D11667: Allow ValueObject::Dereference to dereference references.

Chaoren Lin chaorenl at google.com
Thu Jul 30 17:36:21 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL243716: Allow ValueObject::Dereference to dereference references. (authored by chaoren).

Changed prior to commit:
  http://reviews.llvm.org/D11667?vs=31084&id=31091#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11667

Files:
  lldb/trunk/source/Core/ValueObject.cpp

Index: lldb/trunk/source/Core/ValueObject.cpp
===================================================================
--- lldb/trunk/source/Core/ValueObject.cpp
+++ lldb/trunk/source/Core/ValueObject.cpp
@@ -3711,9 +3711,9 @@
 {
     if (m_deref_valobj)
         return m_deref_valobj->GetSP();
-        
-    const bool is_pointer_type = IsPointerType();
-    if (is_pointer_type)
+
+    const bool is_pointer_or_reference_type = IsPointerOrReferenceType();
+    if (is_pointer_or_reference_type)
     {
         bool omit_empty_base_classes = true;
         bool ignore_array_bounds = false;
@@ -3730,7 +3730,7 @@
         ClangASTType child_clang_type;
 
         ExecutionContext exe_ctx (GetExecutionContextRef());
-        
+
         child_clang_type = clang_type.GetChildClangTypeAtIndex (&exe_ctx,
                                                                 0,
                                                                 transparent_pointers,
@@ -3773,10 +3773,10 @@
         StreamString strm;
         GetExpressionPath(strm, true);
 
-        if (is_pointer_type)
+        if (is_pointer_or_reference_type)
             error.SetErrorStringWithFormat("dereference failed: (%s) %s", GetTypeName().AsCString("<invalid type>"), strm.GetString().c_str());
         else
-            error.SetErrorStringWithFormat("not a pointer type: (%s) %s", GetTypeName().AsCString("<invalid type>"), strm.GetString().c_str());
+            error.SetErrorStringWithFormat("not a pointer or reference type: (%s) %s", GetTypeName().AsCString("<invalid type>"), strm.GetString().c_str());
         return ValueObjectSP();
     }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11667.31091.patch
Type: text/x-patch
Size: 1630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150731/be414dce/attachment.bin>


More information about the lldb-commits mailing list