[Lldb-commits] [lldb] r138694 - in /lldb/trunk/source/Plugins/SymbolFile/DWARF: DWARFDebugInfo.cpp DWARFDebugInfoEntry.cpp DWARFDebugInfoEntry.h DWARFDebugRanges.cpp DWARFDebugRanges.h DWARFFormValue.cpp DWARFFormValue.h DWARFLocationDescription.cpp DWARFLocationDescription.h DWARFLocationList.cpp DWARFLocationList.h SymbolFileDWARF.cpp

Jim Ingham jingham at apple.com
Fri Aug 26 18:24:54 PDT 2011


Author: jingham
Date: Fri Aug 26 20:24:54 2011
New Revision: 138694

URL: http://llvm.org/viewvc/llvm-project?rev=138694&view=rev
Log:
Fix a bunch of places where we were passing Stream *'s but were
never checking them for NULL.  Pass a reference instead.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Fri Aug 26 20:24:54 2011
@@ -940,7 +940,7 @@
         {
             // Yes we are dumping everything. Obey our recurse level though
             if (curr_depth < dumpInfo->recurse_depth)
-                die->Dump(dwarf2Data, cu, s, 0);
+                die->Dump(dwarf2Data, cu, *s, 0);
         }
         else
         {
@@ -956,7 +956,7 @@
                     {
                         for (uint32_t i=0; i<num_ancestors-1; ++i)
                         {
-                            dumpInfo->ancestors[i].Dump(dwarf2Data, cu, s, 0);
+                            dumpInfo->ancestors[i].Dump(dwarf2Data, cu, *s, 0);
                             s->IndentMore();
                         }
                     }
@@ -964,7 +964,7 @@
 
                 dumpInfo->found_depth = curr_depth;
 
-                die->Dump(dwarf2Data, cu, s, 0);
+                die->Dump(dwarf2Data, cu, *s, 0);
 
                 // Note that we found the DIE we were looking for
                 dumpInfo->found_die = true;
@@ -983,7 +983,7 @@
                 // our recurse depth and return an invalid offset if we get done
                 // dumping all the the children
                 if (dumpInfo->recurse_depth == UINT32_MAX || curr_depth <= dumpInfo->found_depth + dumpInfo->recurse_depth)
-                    die->Dump(dwarf2Data, cu, s, 0);
+                    die->Dump(dwarf2Data, cu, *s, 0);
             }
             else if (dumpInfo->die_offset > die->GetOffset())
             {
@@ -1133,7 +1133,7 @@
     {
         const DWARFCompileUnitSP& cu_sp = *pos;
         DumpCallback(m_dwarf2Data, (DWARFCompileUnitSP&)cu_sp, NULL, 0, curr_depth, &dumpInfo);
-        cu_sp->DIE()->Dump(m_dwarf2Data, cu_sp.get(), s, recurse_depth);
+        cu_sp->DIE()->Dump(m_dwarf2Data, cu_sp.get(), *s, recurse_depth);
     }
 }
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Fri Aug 26 20:24:54 2011
@@ -583,7 +583,7 @@
     SymbolFileDWARF* dwarf2Data,
     const DWARFCompileUnit* cu,
     const DWARFDebugInfoEntry* oldest,
-    Stream *s,
+    Stream &s,
     uint32_t recurse_depth
 ) const
 {
@@ -1074,7 +1074,7 @@
 (
     SymbolFileDWARF* dwarf2Data,
     const DWARFCompileUnit* cu,
-    Stream *s,
+    Stream &s,
     uint32_t recurse_depth
 ) const
 {
@@ -1085,14 +1085,14 @@
     {
         dw_uleb128_t abbrCode = debug_info_data.GetULEB128(&offset);
 
-        s->Printf("\n0x%8.8x: ", m_offset);
-        s->Indent();
+        s.Printf("\n0x%8.8x: ", m_offset);
+        s.Indent();
         if (abbrCode)
         {
             if (m_abbrevDecl)
             {
-                s->PutCString(DW_TAG_value_to_name(m_abbrevDecl->Tag()));
-                s->Printf( " [%u] %c\n", abbrCode, m_abbrevDecl->HasChildren() ? '*':' ');
+                s.PutCString(DW_TAG_value_to_name(m_abbrevDecl->Tag()));
+                s.Printf( " [%u] %c\n", abbrCode, m_abbrevDecl->HasChildren() ? '*':' ');
 
                 // Dump all data in the .debug_info for the attributes
                 const uint32_t numAttributes = m_abbrevDecl->NumAttributes();
@@ -1109,22 +1109,22 @@
                 const DWARFDebugInfoEntry* child = GetFirstChild();
                 if (recurse_depth > 0 && child)
                 {
-                    s->IndentMore();
+                    s.IndentMore();
 
                     while (child)
                     {
                         child->Dump(dwarf2Data, cu, s, recurse_depth-1);
                         child = child->GetSibling();
                     }
-                    s->IndentLess();
+                    s.IndentLess();
                 }
             }
             else
-                s->Printf( "Abbreviation code note found in 'debug_abbrev' class for code: %u\n", abbrCode);
+                s.Printf( "Abbreviation code note found in 'debug_abbrev' class for code: %u\n", abbrCode);
         }
         else
         {
-            s->Printf( "NULL\n");
+            s.Printf( "NULL\n");
         }
     }
 }
@@ -1134,7 +1134,7 @@
 (
     SymbolFileDWARF* dwarf2Data,
     DWARFCompileUnit* cu,
-    Stream *s
+    Stream &s
 ) const
 {
     const DWARFDebugInfoEntry *cu_die = cu->GetCompileUnitDIEOnly();
@@ -1146,7 +1146,7 @@
     if (obj_file)
         obj_file_name = obj_file->GetFileSpec().GetFilename().AsCString();
     const char *die_name = GetName (dwarf2Data, cu);
-    s->Printf ("CU: %s OBJFILE: %s DIE: %s (0x%llx).", 
+    s.Printf ("CU: %s OBJFILE: %s DIE: %s (0x%llx).", 
                 cu_name ? cu_name : "<UNKNOWN>",
                 obj_file_name ? obj_file_name : "<UNKNOWN>",
                 die_name ? die_name : "<NO NAME>", 
@@ -1167,23 +1167,23 @@
     const DWARFCompileUnit* cu,
     const DataExtractor& debug_info_data,
     uint32_t* offset_ptr,
-    Stream *s,
+    Stream &s,
     dw_attr_t attr,
     dw_form_t form
 )
 {
-    bool verbose    = s->GetVerbose();
-    bool show_form  = s->GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm);
+    bool verbose    = s.GetVerbose();
+    bool show_form  = s.GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm);
     const DataExtractor* debug_str_data = dwarf2Data ? &dwarf2Data->get_debug_str_data() : NULL;
     if (verbose)
-        s->Offset (*offset_ptr);
+        s.Offset (*offset_ptr);
     else
-        s->Printf ("            ");
-    s->Indent(DW_AT_value_to_name(attr));
+        s.Printf ("            ");
+    s.Indent(DW_AT_value_to_name(attr));
 
     if (show_form)
     {
-        s->Printf( "[%s", DW_FORM_value_to_name(form));
+        s.Printf( "[%s", DW_FORM_value_to_name(form));
     }
 
     DWARFFormValue form_value(form);
@@ -1195,13 +1195,13 @@
     {
         if (form == DW_FORM_indirect)
         {
-            s->Printf( " [%s]", DW_FORM_value_to_name(form_value.Form()));
+            s.Printf( " [%s]", DW_FORM_value_to_name(form_value.Form()));
         }
 
-        s->PutCString("] ");
+        s.PutCString("] ");
     }
 
-    s->PutCString("( ");
+    s.PutCString("( ");
 
     // Always dump form value if verbose is enabled
     if (verbose)
@@ -1214,21 +1214,21 @@
     switch (attr)
     {
     case DW_AT_stmt_list:
-        if ( verbose ) s->PutCString(" ( ");
-        s->Printf( "0x%8.8x", form_value.Unsigned());
-        if ( verbose ) s->PutCString(" )");
+        if ( verbose ) s.PutCString(" ( ");
+        s.Printf( "0x%8.8x", form_value.Unsigned());
+        if ( verbose ) s.PutCString(" )");
         break;
 
     case DW_AT_language:
-        if ( verbose ) s->PutCString(" ( ");
-        s->PutCString(DW_LANG_value_to_name(form_value.Unsigned()));
-        if ( verbose ) s->PutCString(" )");
+        if ( verbose ) s.PutCString(" ( ");
+        s.PutCString(DW_LANG_value_to_name(form_value.Unsigned()));
+        if ( verbose ) s.PutCString(" )");
         break;
 
     case DW_AT_encoding:
-        if ( verbose ) s->PutCString(" ( ");
-        s->PutCString(DW_ATE_value_to_name(form_value.Unsigned()));
-        if ( verbose ) s->PutCString(" )");
+        if ( verbose ) s.PutCString(" ( ");
+        s.PutCString(DW_ATE_value_to_name(form_value.Unsigned()));
+        if ( verbose ) s.PutCString(" )");
         break;
 
     case DW_AT_frame_base:
@@ -1243,9 +1243,9 @@
 
                 // Location description is inlined in data in the form value
                 DataExtractor locationData(debug_info_data, (*offset_ptr) - form_value.Unsigned(), form_value.Unsigned());
-                if ( verbose ) s->PutCString(" ( ");
+                if ( verbose ) s.PutCString(" ( ");
                 print_dwarf_expression (s, locationData, DWARFCompileUnit::GetAddressByteSize(cu), 4, false);
-                if ( verbose ) s->PutCString(" )");
+                if ( verbose ) s.PutCString(" )");
             }
             else
             {
@@ -1274,9 +1274,9 @@
             uint64_t abstract_die_offset = form_value.Reference(cu);
             form_value.Dump(s, debug_str_data, cu);
         //  *ostrm_ptr << HEX32 << abstract_die_offset << " ( ";
-            if ( verbose ) s->PutCString(" ( ");
+            if ( verbose ) s.PutCString(" ( ");
             GetName(dwarf2Data, cu, abstract_die_offset, s);
-            if ( verbose ) s->PutCString(" )");
+            if ( verbose ) s.PutCString(" )");
         }
         break;
 
@@ -1285,9 +1285,9 @@
             uint64_t type_die_offset = form_value.Reference(cu);
             if (!verbose)
                 form_value.Dump(s, debug_str_data, cu);
-            s->PutCString(" ( ");
+            s.PutCString(" ( ");
             AppendTypeName(dwarf2Data, cu, type_die_offset, s);
-            s->PutCString(" )");
+            s.PutCString(" )");
         }
         break;
 
@@ -1307,7 +1307,7 @@
         break;
     }
 
-    s->PutCString(" )\n");
+    s.PutCString(" )\n");
 }
 
 //----------------------------------------------------------------------
@@ -1684,7 +1684,7 @@
     SymbolFileDWARF* dwarf2Data,
     const DWARFCompileUnit* cu,
     const uint32_t die_offset,
-    Stream *s
+    Stream &s
 )
 {
     DWARFDebugInfoEntry die;
@@ -1693,7 +1693,7 @@
     {
         if (die.IsNULL())
         {
-            s->PutCString("NULL");
+            s.PutCString("NULL");
             return true;
         }
         else
@@ -1704,7 +1704,7 @@
                 const char* name = form_value.AsCString(&dwarf2Data->get_debug_str_data());
                 if (name)
                 {
-                    s->PutCString(name);
+                    s.PutCString(name);
                     return true;
                 }
             }
@@ -1727,7 +1727,7 @@
     SymbolFileDWARF* dwarf2Data,
     const DWARFCompileUnit* cu,
     const uint32_t die_offset,
-    Stream *s
+    Stream &s
 )
 {
     DWARFDebugInfoEntry die;
@@ -1736,7 +1736,7 @@
     {
         if (die.IsNULL())
         {
-            s->PutCString("NULL");
+            s.PutCString("NULL");
             return true;
         }
         else
@@ -1745,7 +1745,7 @@
         //  if (die.GetAttributeValue(dwarf2Data, cu, DW_AT_name, form_value))
         //      name = form_value.AsCString(&dwarf2Data->get_debug_str_data());
             if (name)
-                s->PutCString(name);
+                s.PutCString(name);
             else
             {
                 bool result = true;
@@ -1754,27 +1754,27 @@
                 switch (abbrevDecl->Tag())
                 {
                 case DW_TAG_array_type:         break;  // print out a "[]" after printing the full type of the element below
-                case DW_TAG_base_type:          s->PutCString("base ");         break;
-                case DW_TAG_class_type:         s->PutCString("class ");            break;
-                case DW_TAG_const_type:         s->PutCString("const ");            break;
-                case DW_TAG_enumeration_type:   s->PutCString("enum ");         break;
-                case DW_TAG_file_type:          s->PutCString("file ");         break;
-                case DW_TAG_interface_type:     s->PutCString("interface ");        break;
-                case DW_TAG_packed_type:        s->PutCString("packed ");       break;
+                case DW_TAG_base_type:          s.PutCString("base ");         break;
+                case DW_TAG_class_type:         s.PutCString("class ");            break;
+                case DW_TAG_const_type:         s.PutCString("const ");            break;
+                case DW_TAG_enumeration_type:   s.PutCString("enum ");         break;
+                case DW_TAG_file_type:          s.PutCString("file ");         break;
+                case DW_TAG_interface_type:     s.PutCString("interface ");        break;
+                case DW_TAG_packed_type:        s.PutCString("packed ");       break;
                 case DW_TAG_pointer_type:       break;  // print out a '*' after printing the full type below
                 case DW_TAG_ptr_to_member_type: break;  // print out a '*' after printing the full type below
                 case DW_TAG_reference_type:     break;  // print out a '&' after printing the full type below
-                case DW_TAG_restrict_type:      s->PutCString("restrict ");     break;
-                case DW_TAG_set_type:           s->PutCString("set ");          break;
-                case DW_TAG_shared_type:        s->PutCString("shared ");       break;
-                case DW_TAG_string_type:        s->PutCString("string ");       break;
-                case DW_TAG_structure_type:     s->PutCString("struct ");       break;
-                case DW_TAG_subrange_type:      s->PutCString("subrange ");     break;
-                case DW_TAG_subroutine_type:    s->PutCString("function ");     break;
-                case DW_TAG_thrown_type:        s->PutCString("thrown ");       break;
-                case DW_TAG_union_type:         s->PutCString("union ");            break;
-                case DW_TAG_unspecified_type:   s->PutCString("unspecified ");  break;
-                case DW_TAG_volatile_type:      s->PutCString("volatile ");     break;
+                case DW_TAG_restrict_type:      s.PutCString("restrict ");     break;
+                case DW_TAG_set_type:           s.PutCString("set ");          break;
+                case DW_TAG_shared_type:        s.PutCString("shared ");       break;
+                case DW_TAG_string_type:        s.PutCString("string ");       break;
+                case DW_TAG_structure_type:     s.PutCString("struct ");       break;
+                case DW_TAG_subrange_type:      s.PutCString("subrange ");     break;
+                case DW_TAG_subroutine_type:    s.PutCString("function ");     break;
+                case DW_TAG_thrown_type:        s.PutCString("thrown ");       break;
+                case DW_TAG_union_type:         s.PutCString("union ");            break;
+                case DW_TAG_unspecified_type:   s.PutCString("unspecified ");  break;
+                case DW_TAG_volatile_type:      s.PutCString("volatile ");     break;
                 default:
                     return false;
                 }
@@ -1789,10 +1789,10 @@
 
                 switch (abbrevDecl->Tag())
                 {
-                case DW_TAG_array_type:         s->PutCString("[]");    break;
-                case DW_TAG_pointer_type:       s->PutChar('*');    break;
-                case DW_TAG_ptr_to_member_type: s->PutChar('*');    break;
-                case DW_TAG_reference_type:     s->PutChar('&');    break;
+                case DW_TAG_array_type:         s.PutCString("[]");    break;
+                case DW_TAG_pointer_type:       s.PutChar('*');    break;
+                case DW_TAG_ptr_to_member_type: s.PutChar('*');    break;
+                case DW_TAG_reference_type:     s.PutChar('&');    break;
                 default:
                     break;
                 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h Fri Aug 26 20:24:54 2011
@@ -201,13 +201,13 @@
                     SymbolFileDWARF* dwarf2Data,
                     const DWARFCompileUnit* cu,
                     const dw_offset_t die_offset,
-                    lldb_private::Stream *s);
+                    lldb_private::Stream &s);
 
     static bool AppendTypeName(
                     SymbolFileDWARF* dwarf2Data,
                     const DWARFCompileUnit* cu,
                     const dw_offset_t die_offset,
-                    lldb_private::Stream *s);
+                    lldb_private::Stream &s);
 
 //    static int  Compare(
 //                    SymbolFileDWARF* dwarf2Data,
@@ -238,14 +238,14 @@
     void        Dump(
                     SymbolFileDWARF* dwarf2Data,
                     const DWARFCompileUnit* cu,
-                    lldb_private::Stream *s,
+                    lldb_private::Stream &s,
                     uint32_t recurse_depth) const;
 
     void        DumpAncestry(
                     SymbolFileDWARF* dwarf2Data,
                     const DWARFCompileUnit* cu,
                     const DWARFDebugInfoEntry* oldest,
-                    lldb_private::Stream *s,
+                    lldb_private::Stream &s,
                     uint32_t recurse_depth) const;
 
     static void DumpAttribute(
@@ -253,14 +253,14 @@
                     const DWARFCompileUnit* cu,
                     const lldb_private::DataExtractor& debug_info_data,
                     uint32_t* offset_ptr,
-                    lldb_private::Stream *s,
+                    lldb_private::Stream &s,
                     dw_attr_t attr,
                     dw_form_t form);
     // This one dumps the comp unit name, objfile name and die offset for this die so the stream S.
     void          DumpLocation(
                     SymbolFileDWARF* dwarf2Data,
                     DWARFCompileUnit* cu,
-                    lldb_private::Stream *s) const;
+                    lldb_private::Stream &s) const;
                     
     bool        GetDIENamesAndRanges(
                     SymbolFileDWARF* dwarf2Data,

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp Fri Aug 26 20:24:54 2011
@@ -215,10 +215,10 @@
 
 
 void
-DWARFDebugRanges::Dump(Stream *s, const DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr)
+DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr)
 {
-    uint32_t addr_size = s->GetAddressByteSize();
-    bool verbose = s->GetVerbose();
+    uint32_t addr_size = s.GetAddressByteSize();
+    bool verbose = s.GetVerbose();
 
     dw_addr_t base_addr = cu_base_addr;
     while (debug_ranges_data.ValidOffsetForDataOfSize(*offset_ptr, 2 * addr_size))
@@ -230,23 +230,23 @@
         if (begin == 0xFFFFFFFFull && addr_size == 4)
             begin = DW_INVALID_ADDRESS;
 
-        s->Indent();
+        s.Indent();
         if (verbose)
         {
-            s->AddressRange(begin, end, sizeof (dw_addr_t), " offsets = ");
+            s.AddressRange(begin, end, sizeof (dw_addr_t), " offsets = ");
         }
 
 
         if (begin == 0 && end == 0)
         {
-            s->PutCString(" End");
+            s.PutCString(" End");
             break;
         }
         else if (begin == DW_INVALID_ADDRESS)
         {
             // A base address selection entry
             base_addr = end;
-            s->Address(base_addr, sizeof (dw_addr_t), " Base address = ");
+            s.Address(base_addr, sizeof (dw_addr_t), " Base address = ");
         }
         else
         {
@@ -254,7 +254,7 @@
             dw_addr_t begin_addr = begin + base_addr;
             dw_addr_t end_addr = end + base_addr;
 
-            s->AddressRange(begin_addr, end_addr, sizeof (dw_addr_t), verbose ? " ==> addrs = " : NULL);
+            s.AddressRange(begin_addr, end_addr, sizeof (dw_addr_t), verbose ? " ==> addrs = " : NULL);
         }
     }
 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h Fri Aug 26 20:24:54 2011
@@ -75,7 +75,7 @@
     DWARFDebugRanges();
     ~DWARFDebugRanges();
     void Extract(SymbolFileDWARF* dwarf2Data);
-    static void Dump(lldb_private::Stream *s, const lldb_private::DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr);
+    static void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr);
     bool FindRanges(dw_offset_t debug_ranges_offset, DWARFDebugRanges::RangeList& range_list) const;
 
 protected:

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp Fri Aug 26 20:24:54 2011
@@ -350,22 +350,22 @@
 //}
 
 void
-DWARFFormValue::Dump(Stream *s, const DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const
+DWARFFormValue::Dump(Stream &s, const DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const
 {
     uint64_t uvalue = Unsigned();
     bool cu_relative_offset = false;
 
-    bool verbose = s->GetVerbose();
+    bool verbose = s.GetVerbose();
 
     switch (m_form)
     {
-    case DW_FORM_addr:      s->Address(uvalue, sizeof (uint64_t)); break;
+    case DW_FORM_addr:      s.Address(uvalue, sizeof (uint64_t)); break;
     case DW_FORM_flag:
-    case DW_FORM_data1:     s->PutHex8(uvalue);     break;
-    case DW_FORM_data2:     s->PutHex16(uvalue);        break;
-    case DW_FORM_data4:     s->PutHex32(uvalue);        break;
-    case DW_FORM_data8:     s->PutHex64(uvalue);        break;
-    case DW_FORM_string:    s->QuotedCString(AsCString(NULL));          break;
+    case DW_FORM_data1:     s.PutHex8(uvalue);     break;
+    case DW_FORM_data2:     s.PutHex16(uvalue);        break;
+    case DW_FORM_data4:     s.PutHex32(uvalue);        break;
+    case DW_FORM_data8:     s.PutHex64(uvalue);        break;
+    case DW_FORM_string:    s.QuotedCString(AsCString(NULL));          break;
     case DW_FORM_block:
     case DW_FORM_block1:
     case DW_FORM_block2:
@@ -374,10 +374,10 @@
         {
             switch (m_form)
             {
-            case DW_FORM_block:  s->Printf("<0x%llx> ", uvalue);                break;
-            case DW_FORM_block1: s->Printf("<0x%2.2x> ", (uint8_t)uvalue);      break;
-            case DW_FORM_block2: s->Printf("<0x%4.4x> ", (uint16_t)uvalue);     break;
-            case DW_FORM_block4: s->Printf("<0x%8.8x> ", (uint32_t)uvalue);     break;
+            case DW_FORM_block:  s.Printf("<0x%llx> ", uvalue);                break;
+            case DW_FORM_block1: s.Printf("<0x%2.2x> ", (uint8_t)uvalue);      break;
+            case DW_FORM_block2: s.Printf("<0x%4.4x> ", (uint16_t)uvalue);     break;
+            case DW_FORM_block4: s.Printf("<0x%8.8x> ", (uint32_t)uvalue);     break;
             default:                                                            break;
             }
 
@@ -387,57 +387,57 @@
                 const uint8_t* end_data_ptr = data_ptr + uvalue;    // uvalue contains size of block
                 while (data_ptr < end_data_ptr)
                 {
-                    s->Printf("%2.2x ", *data_ptr);
+                    s.Printf("%2.2x ", *data_ptr);
                     ++data_ptr;
                 }
             }
             else
-                s->PutCString("NULL");
+                s.PutCString("NULL");
         }
         break;
 
-    case DW_FORM_sdata:     s->PutSLEB128(uvalue); break;
-    case DW_FORM_udata:     s->PutULEB128(uvalue); break;
+    case DW_FORM_sdata:     s.PutSLEB128(uvalue); break;
+    case DW_FORM_udata:     s.PutULEB128(uvalue); break;
     case DW_FORM_strp:
         if (debug_str_data)
         {
             if (verbose)
-                s->Printf(" .debug_str[0x%8.8x] = ", (uint32_t)uvalue);
+                s.Printf(" .debug_str[0x%8.8x] = ", (uint32_t)uvalue);
 
             const char* dbg_str = AsCString(debug_str_data);
             if (dbg_str)
-                s->QuotedCString(dbg_str);
+                s.QuotedCString(dbg_str);
         }
         else
         {
-            s->PutHex32(uvalue);
+            s.PutHex32(uvalue);
         }
         break;
 
     case DW_FORM_ref_addr:
     {
-        s->Address(uvalue, sizeof (uint64_t) * 2);
+        s.Address(uvalue, sizeof (uint64_t) * 2);
         break;
     }
-    case DW_FORM_ref1:      cu_relative_offset = true;  if (verbose) s->Printf("cu + 0x%2.2x", (uint8_t)uvalue); break;
-    case DW_FORM_ref2:      cu_relative_offset = true;  if (verbose) s->Printf("cu + 0x%4.4x", (uint16_t)uvalue); break;
-    case DW_FORM_ref4:      cu_relative_offset = true;  if (verbose) s->Printf("cu + 0x%4.4x", (uint32_t)uvalue); break;
-    case DW_FORM_ref8:      cu_relative_offset = true;  if (verbose) s->Printf("cu + 0x%8.8llx", uvalue); break;
-    case DW_FORM_ref_udata: cu_relative_offset = true;  if (verbose) s->Printf("cu + 0x%llx", uvalue); break;
+    case DW_FORM_ref1:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%2.2x", (uint8_t)uvalue); break;
+    case DW_FORM_ref2:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%4.4x", (uint16_t)uvalue); break;
+    case DW_FORM_ref4:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%4.4x", (uint32_t)uvalue); break;
+    case DW_FORM_ref8:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%8.8llx", uvalue); break;
+    case DW_FORM_ref_udata: cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%llx", uvalue); break;
 
     // All DW_FORM_indirect attributes should be resolved prior to calling this function
-    case DW_FORM_indirect:  s->PutCString("DW_FORM_indirect"); break;
+    case DW_FORM_indirect:  s.PutCString("DW_FORM_indirect"); break;
     default:
-        s->Printf("DW_FORM(0x%4.4x)", m_form);
+        s.Printf("DW_FORM(0x%4.4x)", m_form);
         break;
     }
 
     if (cu_relative_offset)
     {
         if (verbose)
-            s->PutCString(" => ");
+            s.PutCString(" => ");
 
-        s->Printf("{0x%8.8x}", (uvalue + (cu ? cu->GetOffset() : 0)));
+        s.Printf("{0x%8.8x}", (uvalue + (cu ? cu->GetOffset() : 0)));
     }
 }
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h Fri Aug 26 20:24:54 2011
@@ -52,7 +52,7 @@
     dw_form_t           Form()  const { return m_form; }
     void                SetForm(dw_form_t form) { m_form = form; }
     const ValueType&    Value() const { return m_value; }
-    void                Dump(lldb_private::Stream *s, const lldb_private::DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const;
+    void                Dump(lldb_private::Stream &s, const lldb_private::DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const;
     bool                ExtractValue(const lldb_private::DataExtractor& data, uint32_t* offset_ptr, const DWARFCompileUnit* cu);
     bool                IsInlinedCStr() const { return (m_value.data != NULL) && m_value.data == (uint8_t*)m_value.value.cstr; }
     const uint8_t*      BlockData() const;

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp Fri Aug 26 20:24:54 2011
@@ -15,10 +15,10 @@
 
 using namespace lldb_private;
 
-static int print_dwarf_exp_op (Stream *s, const DataExtractor& data, uint32_t* offset_ptr, int address_size, int dwarf_ref_size);
+static int print_dwarf_exp_op (Stream &s, const DataExtractor& data, uint32_t* offset_ptr, int address_size, int dwarf_ref_size);
 
 int
-print_dwarf_expression (Stream *s,
+print_dwarf_expression (Stream &s,
                         const DataExtractor& data,
                         int address_size,
                         int dwarf_ref_size,
@@ -35,7 +35,7 @@
         }
         if (op_count > 0)
         {
-            s->PutCString(", ");
+            s.PutCString(", ");
         }
         if (print_dwarf_exp_op (s, data, &offset, address_size, dwarf_ref_size) == 1)
             return 1;
@@ -46,7 +46,7 @@
 }
 
 static int
-print_dwarf_exp_op (Stream *s,
+print_dwarf_exp_op (Stream &s,
                     const DataExtractor& data,
                     uint32_t* offset_ptr,
                     int address_size,
@@ -61,7 +61,7 @@
 
     opcode_class = DW_OP_value_to_class (opcode) & (~DRC_DWARFv3);
 
-    s->Printf("%s ", DW_OP_value_to_name (opcode));
+    s.Printf("%s ", DW_OP_value_to_name (opcode));
 
     /* Does this take zero parameters?  If so we can shortcut this function.  */
     if (opcode_class == DRC_ZEROOPERANDS)
@@ -71,12 +71,12 @@
     {
         uint = data.GetULEB128(offset_ptr);
         sint = data.GetSLEB128(offset_ptr);
-        s->Printf("%llu %lli", uint, sint);
+        s.Printf("%llu %lli", uint, sint);
         return 0;
     }
     if (opcode_class != DRC_ONEOPERAND)
     {
-        s->Printf("UNKNOWN OP %u", opcode);
+        s.Printf("UNKNOWN OP %u", opcode);
         return 1;
     }
 
@@ -150,22 +150,22 @@
         case DW_OP_regx:
             size = 128; break;
         default:
-            s->Printf("UNKNOWN ONE-OPERAND OPCODE, #%u", opcode);
+            s.Printf("UNKNOWN ONE-OPERAND OPCODE, #%u", opcode);
             return 1;
     }
 
     switch (size)
     {
-    case -1:    sint = (int8_t)     data.GetU8(offset_ptr);     s->Printf("%+lli", sint); break;
-    case -2:    sint = (int16_t)    data.GetU16(offset_ptr);    s->Printf("%+lli", sint); break;
-    case -4:    sint = (int32_t)    data.GetU32(offset_ptr);    s->Printf("%+lli", sint); break;
-    case -8:    sint = (int64_t)    data.GetU64(offset_ptr);    s->Printf("%+lli", sint); break;
-    case -128:  sint = data.GetSLEB128(offset_ptr);         s->Printf("%+lli", sint); break;
-    case 1:     uint = data.GetU8(offset_ptr);                  s->Printf("0x%2.2llx", uint); break;
-    case 2:     uint = data.GetU16(offset_ptr);                 s->Printf("0x%4.4llx", uint); break;
-    case 4:     uint = data.GetU32(offset_ptr);                 s->Printf("0x%8.8llx", uint); break;
-    case 8:     uint = data.GetU64(offset_ptr);                 s->Printf("0x%16.16llx", uint); break;
-    case 128:   uint = data.GetULEB128(offset_ptr);         s->Printf("0x%llx", uint); break;
+    case -1:    sint = (int8_t)     data.GetU8(offset_ptr);     s.Printf("%+lli", sint); break;
+    case -2:    sint = (int16_t)    data.GetU16(offset_ptr);    s.Printf("%+lli", sint); break;
+    case -4:    sint = (int32_t)    data.GetU32(offset_ptr);    s.Printf("%+lli", sint); break;
+    case -8:    sint = (int64_t)    data.GetU64(offset_ptr);    s.Printf("%+lli", sint); break;
+    case -128:  sint = data.GetSLEB128(offset_ptr);             s.Printf("%+lli", sint); break;
+    case 1:     uint = data.GetU8(offset_ptr);                  s.Printf("0x%2.2llx", uint); break;
+    case 2:     uint = data.GetU16(offset_ptr);                 s.Printf("0x%4.4llx", uint); break;
+    case 4:     uint = data.GetU32(offset_ptr);                 s.Printf("0x%8.8llx", uint); break;
+    case 8:     uint = data.GetU64(offset_ptr);                 s.Printf("0x%16.16llx", uint); break;
+    case 128:   uint = data.GetULEB128(offset_ptr);             s.Printf("0x%llx", uint); break;
     }
 
     return 0;

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.h Fri Aug 26 20:24:54 2011
@@ -13,7 +13,7 @@
 #include "SymbolFileDWARF.h"
 
 int
-print_dwarf_expression (lldb_private::Stream *s,
+print_dwarf_expression (lldb_private::Stream &s,
                         const lldb_private::DataExtractor& data,
                         int address_size,
                         int dwarf_ref_size,

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp Fri Aug 26 20:24:54 2011
@@ -18,11 +18,11 @@
 using namespace lldb_private;
 
 dw_offset_t
-DWARFLocationList::Dump(Stream *s, const DWARFCompileUnit* cu, const DataExtractor& debug_loc_data, dw_offset_t offset)
+DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtractor& debug_loc_data, dw_offset_t offset)
 {
     uint64_t start_addr, end_addr;
     uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu);
-    s->SetAddressByteSize(DWARFCompileUnit::GetAddressByteSize(cu));
+    s.SetAddressByteSize(DWARFCompileUnit::GetAddressByteSize(cu));
     dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0;
     while (debug_loc_data.ValidOffset(offset))
     {
@@ -32,9 +32,9 @@
         if (start_addr == 0 && end_addr == 0)
             break;
 
-        s->PutCString("\n            ");
-        s->Indent();
-        s->AddressRange(start_addr + base_addr, end_addr + base_addr, NULL, ": ");
+        s.PutCString("\n            ");
+        s.Indent();
+        s.AddressRange(start_addr + base_addr, end_addr + base_addr, NULL, ": ");
         uint32_t loc_length = debug_loc_data.GetU16(&offset);
 
         DataExtractor locationData(debug_loc_data, offset, loc_length);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h Fri Aug 26 20:24:54 2011
@@ -16,7 +16,7 @@
 {
 public:
     static dw_offset_t
-    Dump (lldb_private::Stream *s,
+    Dump (lldb_private::Stream &s,
           const DWARFCompileUnit* cu,
           const lldb_private::DataExtractor& debug_loc_data,
           dw_offset_t offset);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=138694&r1=138693&r2=138694&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Aug 26 20:24:54 2011
@@ -3078,7 +3078,7 @@
         if (log && dwarf_cu)
         {
             StreamString s;
-            die->DumpLocation (this, dwarf_cu, &s);
+            die->DumpLocation (this, dwarf_cu, s);
             log->Printf ("SymbolFileDwarf::%s %s", __FUNCTION__, s.GetData());
             
         }





More information about the lldb-commits mailing list