[Lldb-commits] [lldb] r153274 - /lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp

Sean Callanan scallanan at apple.com
Thu Mar 22 13:04:24 PDT 2012


Author: spyffe
Date: Thu Mar 22 15:04:23 2012
New Revision: 153274

URL: http://llvm.org/viewvc/llvm-project?rev=153274&view=rev
Log:
Resolved two problems in the disassembler:

 - Addresses with no description were given
   comments, leading to useless comments like 
   "; , "

 - Addresses weren't resolved with respect
   to the correct module.

Modified:
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=153274&r1=153273&r2=153274&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Thu Mar 22 15:04:23 2012
@@ -620,10 +620,11 @@
         
         if (target)
         {
-            if (!target->GetSectionLoadList().IsEmpty())
-                target->GetSectionLoadList().ResolveLoadAddress(ReferenceValue, reference_address);
-            else
-                target->GetImages().ResolveFileAddress(ReferenceValue, reference_address);
+            if (!target->GetSectionLoadList().ResolveLoadAddress(ReferenceValue, reference_address))
+            {
+                if (ModuleSP module_sp = m_inst->GetAddress().GetModule())
+                    module_sp->ResolveFileAddress(ReferenceValue, reference_address);
+            }
             
             if (reference_address.IsValid() && reference_address.GetSection())
             {
@@ -634,7 +635,8 @@
                                         Address::DumpStyleResolvedDescriptionNoModule, 
                                         Address::DumpStyleSectionNameOffset);
                 
-                m_inst->AddReferencedAddress(ss.GetString());
+                if (!ss.GetString().empty())
+                    m_inst->AddReferencedAddress(ss.GetString());
             }
         }
     }





More information about the lldb-commits mailing list