[Lldb-commits] [lldb] r113951 - in /lldb/trunk: include/lldb/Symbol/Declaration.h include/lldb/Symbol/Function.h lldb.xcodeproj/project.pbxproj source/Commands/CommandObjectDisassemble.cpp source/Core/Disassembler.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp source/Symbol/Block.cpp source/Symbol/Declaration.cpp source/Symbol/Function.cpp source/Symbol/Type.cpp source/Symbol/Variable.cpp

Greg Clayton gclayton at apple.com
Tue Sep 14 22:51:25 PDT 2010


Author: gclayton
Date: Wed Sep 15 00:51:24 2010
New Revision: 113951

URL: http://llvm.org/viewvc/llvm-project?rev=113951&view=rev
Log:
Fixed a missing newline when dumping mixed disassembly.

Added a "bool show_fullpaths" to many more objects that were
previously always dumping full paths.

Fixed a few places where the DWARF was not indexed when we
we needed it to be when making queries. Also fixed an issue
where the DWARF in .o files wasn't searching all .o files
for the types.

Fixed an issue with the output from "image lookup --type <TYPENAME>"
where the name and byte size might not be resolved and might not
display. We now call the accessors so we end up seeing all of the
type info.


Modified:
    lldb/trunk/include/lldb/Symbol/Declaration.h
    lldb/trunk/include/lldb/Symbol/Function.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
    lldb/trunk/source/Core/Disassembler.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/trunk/source/Symbol/Block.cpp
    lldb/trunk/source/Symbol/Declaration.cpp
    lldb/trunk/source/Symbol/Function.cpp
    lldb/trunk/source/Symbol/Type.cpp
    lldb/trunk/source/Symbol/Variable.cpp

Modified: lldb/trunk/include/lldb/Symbol/Declaration.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Declaration.h?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Declaration.h (original)
+++ lldb/trunk/include/lldb/Symbol/Declaration.h Wed Sep 15 00:51:24 2010
@@ -100,7 +100,7 @@
     ///     The stream to which to dump the object descripton.
     //------------------------------------------------------------------
     void
-    Dump (Stream *s) const;
+    Dump (Stream *s, bool show_fullpaths) const;
 
     void
     DumpStopContext (Stream *s, bool show_fullpaths) const;

Modified: lldb/trunk/include/lldb/Symbol/Function.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Function.h?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Function.h (original)
+++ lldb/trunk/include/lldb/Symbol/Function.h Wed Sep 15 00:51:24 2010
@@ -96,7 +96,7 @@
     ///     The stream to which to dump the object descripton.
     //------------------------------------------------------------------
     void
-    Dump (Stream *s) const;
+    Dump (Stream *s, bool show_fullpaths) const;
 
     //------------------------------------------------------------------
     /// Get accessor for the declaration information.
@@ -236,7 +236,7 @@
     ///     The stream to which to dump the object descripton.
     //------------------------------------------------------------------
     void
-    Dump(Stream *s) const;
+    Dump(Stream *s, bool show_fullpaths) const;
 
     void
     DumpStopContext (Stream *s) const;

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Sep 15 00:51:24 2010
@@ -2339,7 +2339,6 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
 			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				en,

Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Wed Sep 15 00:51:24 2010
@@ -196,7 +196,7 @@
     ExecutionContext exe_ctx(interpreter.GetDebugger().GetExecutionContext());
 
     if (m_options.show_mixed && m_options.num_lines_context == 0)
-        m_options.num_lines_context = 3;
+        m_options.num_lines_context = 1;
 
     if (!m_options.m_func_name.empty())
     {

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Wed Sep 15 00:51:24 2010
@@ -107,7 +107,10 @@
     if (module)
     {
         if (!module->FindFunctions (name, 
-                                    eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector, 
+                                    eFunctionNameTypeBase | 
+                                    eFunctionNameTypeFull | 
+                                    eFunctionNameTypeMethod | 
+                                    eFunctionNameTypeSelector, 
                                     true,
                                     sc_list))
             return false;
@@ -115,7 +118,10 @@
     else 
     {
         if (exe_ctx.target->GetImages().FindFunctions (name, 
-                                                       eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector,
+                                                       eFunctionNameTypeBase | 
+                                                       eFunctionNameTypeFull | 
+                                                       eFunctionNameTypeMethod | 
+                                                       eFunctionNameTypeSelector,
                                                        false,
                                                        sc_list))
         {
@@ -240,7 +246,8 @@
                                         if (offset != 0)
                                             strm.EOL();
 
-                                        sc.DumpStopContext(&strm, process, addr, true, true, false);
+                                        sc.DumpStopContext(&strm, process, addr, false, true, false);
+                                        strm.EOL();
 
                                         if (sc.comp_unit && sc.line_entry.IsValid())
                                         {

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=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Sep 15 00:51:24 2010
@@ -1834,6 +1834,10 @@
     if (!append)
         types.Clear();
 
+    // Index if we already haven't to make sure the compile units
+    // get indexed and make their global DIE index list
+    if (!m_indexed)
+        Index ();
 
     const uint32_t initial_types_size = types.GetSize();
     DWARFCompileUnit* cu = NULL;

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Wed Sep 15 00:51:24 2010
@@ -878,14 +878,35 @@
 
 
 uint32_t
-SymbolFileDWARFDebugMap::FindTypes (const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types)
+SymbolFileDWARFDebugMap::FindTypes 
+(
+    const SymbolContext& sc, 
+    const ConstString &name, 
+    bool append, 
+    uint32_t max_matches, 
+    TypeList& types
+)
 {
-    SymbolFileDWARF *oso_dwarf = GetSymbolFile (sc);
-    if (oso_dwarf)
-        return oso_dwarf->FindTypes (sc, name, append, max_matches, types);
     if (!append)
         types.Clear();
-    return 0;
+
+    const uint32_t initial_types_size = types.GetSize();
+    SymbolFileDWARF *oso_dwarf;
+
+    if (sc.comp_unit)
+    {
+        oso_dwarf = GetSymbolFile (sc);
+        if (oso_dwarf)
+            return oso_dwarf->FindTypes (sc, name, append, max_matches, types);
+    }
+    else
+    {
+        uint32_t oso_idx = 0;
+        while ((oso_dwarf = GetSymbolFileByOSOIndex (oso_idx++)) != NULL)
+            oso_dwarf->FindTypes (sc, name, append, max_matches, types);
+    }
+
+    return types.GetSize() - initial_types_size;
 }
 
 //

Modified: lldb/trunk/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Block.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Block.cpp (original)
+++ lldb/trunk/source/Symbol/Block.cpp Wed Sep 15 00:51:24 2010
@@ -57,7 +57,10 @@
     }
 
     if (m_inlineInfoSP.get() != NULL)
-        m_inlineInfoSP->Dump(s);
+    {
+        bool show_fullpaths = (level == eDescriptionLevelVerbose);
+        m_inlineInfoSP->Dump(s, show_fullpaths);
+    }
 }
 
 void
@@ -83,7 +86,10 @@
         s->Printf(", parent = {0x%8.8x}", parent_block->GetID());
     }
     if (m_inlineInfoSP.get() != NULL)
-        m_inlineInfoSP->Dump(s);
+    {
+        bool show_fullpaths = false;
+        m_inlineInfoSP->Dump(s, show_fullpaths);
+    }
 
     if (!m_ranges.empty())
     {

Modified: lldb/trunk/source/Symbol/Declaration.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Declaration.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Declaration.cpp (original)
+++ lldb/trunk/source/Symbol/Declaration.cpp Wed Sep 15 00:51:24 2010
@@ -57,11 +57,15 @@
 }
 
 void
-Declaration::Dump(Stream *s) const
+Declaration::Dump(Stream *s, bool show_fullpaths) const
 {
     if (m_file)
     {
-        *s << ", decl = " << m_file;
+        *s << ", decl = ";
+        if (show_fullpaths)
+            *s << m_file;
+        else
+            *s << m_file.GetFilename();
         if (m_line > 0)
             s->Printf(":%u", m_line);
         if (m_column > 0)

Modified: lldb/trunk/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Function.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Function.cpp (original)
+++ lldb/trunk/source/Symbol/Function.cpp Wed Sep 15 00:51:24 2010
@@ -45,11 +45,11 @@
 }
 
 void
-FunctionInfo::Dump(Stream *s) const
+FunctionInfo::Dump(Stream *s, bool show_fullpaths) const
 {
     if (m_name)
         *s << ", name = \"" << m_name << "\"";
-    m_declaration.Dump(s);
+    m_declaration.Dump(s, show_fullpaths);
 }
 
 
@@ -131,9 +131,9 @@
 }
 
 void
-InlineFunctionInfo::Dump(Stream *s) const
+InlineFunctionInfo::Dump(Stream *s, bool show_fullpaths) const
 {
-    FunctionInfo::Dump(s);
+    FunctionInfo::Dump(s, show_fullpaths);
     if (m_mangled)
         m_mangled.Dump(s);
 }

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Wed Sep 15 00:51:24 2010
@@ -87,13 +87,15 @@
 {
     *s << "id = " << (const UserID&)*this;
 
-    if (show_name && m_name)
+    // Call the name accessor to make sure we resolve the type name
+    if (show_name && GetName())
         *s << ", name = \"" << m_name << '"';
 
-    if (m_byte_size != 0)
+    // Call the get byte size accesor so we resolve our byte size
+    if (GetByteSize())
         s->Printf(", byte-size = %zu", m_byte_size);
-
-    m_decl.Dump(s);
+    bool show_fullpaths = (level == lldb::eDescriptionLevelVerbose);
+    m_decl.Dump(s, show_fullpaths);
 
     if (m_clang_qual_type)
     {
@@ -138,7 +140,8 @@
         s->PutCString(" )");
     }
 
-    m_decl.Dump(s);
+    bool show_fullpaths = false;
+    m_decl.Dump (s,show_fullpaths);
 
     if (m_clang_qual_type)
     {

Modified: lldb/trunk/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=113951&r1=113950&r2=113951&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Variable.cpp (original)
+++ lldb/trunk/source/Symbol/Variable.cpp Wed Sep 15 00:51:24 2010
@@ -91,7 +91,8 @@
         s->PutCString(" )");
     }
 
-    m_declaration.Dump(s);
+    bool show_fullpaths = false;
+    m_declaration.Dump(s, show_fullpaths);
 
     if (m_location.IsValid())
     {





More information about the lldb-commits mailing list