[Lldb-commits] [lldb] r127166 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp

Greg Clayton gclayton at apple.com
Mon Mar 7 10:51:54 PST 2011

Author: gclayton
Date: Mon Mar  7 12:51:54 2011
New Revision: 127166

URL: http://llvm.org/viewvc/llvm-project?rev=127166&view=rev
Don't cache .o files in the debug map + DWARF in .o files. If we cache them
then we end up using older .o files with out of date section remappings if
we debug, compile + fix, and debug again.


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=127166&r1=127165&r2=127166&view=diff
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Mon Mar  7 12:51:54 2011
@@ -165,7 +165,18 @@
         if (oso_symbol)
             FileSpec oso_file_spec(oso_symbol->GetMangled().GetName().AsCString(), true);
+            // Normally we don't want the .o files we open added to the shared
+            // module list. This is because we will add our own section 
+            // remappning to each .o file, and if the executable changes, yet 
+            // the .o file does not change, we can't have the old remapped 
+            // sections in the .o file since they can be out of date. But when
+            // debugging issues in the debug map + DWARF in .o files, it is nice
+            // to be able to use the "image XXX" commands to look at the symbol
+            // tables and sections in the .o files, so the SYMBOL_FILE_DWARF_DEBUG_MODULES
+            // can be used when debugging issues, but it shouldn't be left in
+            // for normal debugging.
             ModuleList::GetSharedModule (oso_file_spec,
                                          NULL,  // lldb_private::UUID pointer
@@ -174,7 +185,9 @@
-            //comp_unit_info->oso_module_sp.reset(new Module (oso_file_spec, m_obj_file->GetModule()->GetArchitecture()));
+            comp_unit_info->oso_module_sp.reset(new Module (oso_file_spec, m_obj_file->GetModule()->GetArchitecture()));
     return comp_unit_info->oso_module_sp.get();

More information about the lldb-commits mailing list