[Lldb-commits] [lldb] r180236 - Don't print the type if there is none and don't print "<invalid type>". ValueObjects can be register sets and register groups and dumping those with:

Greg Clayton gclayton at apple.com
Wed Apr 24 18:05:15 PDT 2013


Author: gclayton
Date: Wed Apr 24 20:05:15 2013
New Revision: 180236

URL: http://llvm.org/viewvc/llvm-project?rev=180236&view=rev
Log:
Don't print the type if there is none and don't print "<invalid type>". ValueObjects can be register sets and register groups and dumping those with:

(lldb) script print frame.GetRegisters()


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

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=180236&r1=180235&r2=180236&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Wed Apr 24 20:05:15 2013
@@ -3410,7 +3410,13 @@ DumpValueObject_Impl (Stream &s,
                 show_type = options.m_show_types || (curr_depth == 0 && !options.m_flat_output);
             
             if (show_type)
-                s.Printf("(%s) ", valobj->GetQualifiedTypeName().AsCString("<invalid type>"));
+            {
+                // Some ValueObjects don't have types (like registers sets). Only print
+                // the type if there is one to print
+                ConstString qualified_type_name(valobj->GetQualifiedTypeName());
+                if (qualified_type_name)
+                    s.Printf("(%s) ", qualified_type_name.GetCString());
+            }
 
             if (options.m_flat_output)
             {
@@ -3543,9 +3549,8 @@ DumpValueObject_Impl (Stream &s,
                 
                 if (print_children && (!entry || entry->DoesPrintChildren() || !sum_cstr))
                 {
-                    ValueObject* synth_valobj;
                     ValueObjectSP synth_valobj_sp = valobj->GetSyntheticValue (options.m_use_synthetic);
-                    synth_valobj = (synth_valobj_sp ? synth_valobj_sp.get() : valobj);
+                    ValueObject* synth_valobj = (synth_valobj_sp ? synth_valobj_sp.get() : valobj);
                     
                     size_t num_children = synth_valobj->GetNumChildren();
                     bool print_dotdotdot = false;





More information about the lldb-commits mailing list