[Lldb-commits] [lldb] r152244 - in /lldb/trunk: include/lldb/Symbol/ lldb.xcodeproj/xcshareddata/xcschemes/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Plugins/DynamicLoader/Darwin-Kernel/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Plugins/ObjectFile/Mach-O/ source/Plugins/ObjectFile/PECOFF/ source/Plugins/Process/Utility/ source/Plugins/Process/gdb-remote/ source/Plugins/SymbolFile/DWARF/ source/Plugins/SymbolFile/Sy...

Greg Clayton gclayton at apple.com
Wed Mar 7 13:03:10 PST 2012


Author: gclayton
Date: Wed Mar  7 15:03:09 2012
New Revision: 152244

URL: http://llvm.org/viewvc/llvm-project?rev=152244&view=rev
Log:
<rdar://problem/10997402>

This fix really needed to happen as a previous fix I had submitted for
calculating symbol sizes made many symbols appear to have zero size since
the function that was calculating the symbol size was calling another function
that would cause the calculation to happen again. This resulted in some symbols
having zero size when they shouldn't. This could then cause infinite stack
traces and many other side affects.


Modified:
    lldb/trunk/include/lldb/Symbol/Symbol.h
    lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
    lldb/trunk/source/API/SBSymbol.cpp
    lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
    lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
    lldb/trunk/source/Commands/CommandObjectTarget.cpp
    lldb/trunk/source/Core/Address.cpp
    lldb/trunk/source/Core/AddressResolverName.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/Disassembler.cpp
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
    lldb/trunk/source/Symbol/ObjectFile.cpp
    lldb/trunk/source/Symbol/Symbol.cpp
    lldb/trunk/source/Symbol/SymbolContext.cpp
    lldb/trunk/source/Symbol/Symtab.cpp
    lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepRange.cpp

Modified: lldb/trunk/include/lldb/Symbol/Symbol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Symbol.h?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Symbol.h (original)
+++ lldb/trunk/include/lldb/Symbol/Symbol.h Wed Mar  7 15:03:09 2012
@@ -65,20 +65,36 @@
     void
     Dump (Stream *s, Target *target, uint32_t index) const;
 
-    AddressRange *
-    GetAddressRangePtr ();
-
-    const AddressRange *
-    GetAddressRangePtr () const;
+    bool
+    ValueIsAddress() const;
 
-    AddressRange &
-    GetAddressRangeRef() { return m_addr_range; }
+    //------------------------------------------------------------------
+    // Access the address value. Do NOT hand out the AddressRange as an
+    // object as the byte size of the address range may not be filled in
+    // and it should be accessed via GetByteSize().
+    //------------------------------------------------------------------
+    Address &
+    GetAddress()
+    {
+        return m_addr_range.GetBaseAddress();
+    }
 
-    const AddressRange &
-    GetAddressRangeRef() const { return m_addr_range; }
+    //------------------------------------------------------------------
+    // Access the address value. Do NOT hand out the AddressRange as an
+    // object as the byte size of the address range may not be filled in
+    // and it should be accessed via GetByteSize().
+    //------------------------------------------------------------------
+    const Address &
+    GetAddress() const
+    {
+        return m_addr_range.GetBaseAddress();
+    }
 
     const ConstString &
-    GetName () { return m_mangled.GetName(); }
+    GetName ()
+    {
+        return m_mangled.GetName();
+    }
 
     uint32_t
     GetID() const
@@ -93,85 +109,140 @@
     }
 
     Mangled&
-    GetMangled () { return m_mangled; }
+    GetMangled ()
+    {
+        return m_mangled;
+    }
 
     const Mangled&
-    GetMangled () const { return m_mangled; }
-
-    bool
-    GetSizeIsSibling () const { return m_size_is_sibling; }
-
-    bool
-    GetSizeIsSynthesized() const { return m_size_is_synthesized; }
+    GetMangled () const
+    {
+        return m_mangled;
+    }
 
     uint32_t
     GetSiblingIndex () const;
 
-    lldb::addr_t
-    GetByteSize () const;
-
     lldb::SymbolType
-    GetType () const { return (lldb::SymbolType)m_type; }
+    GetType () const
+    {
+        return (lldb::SymbolType)m_type;
+    }
 
     void
-    SetType (lldb::SymbolType type) { m_type = (lldb::SymbolType)type; }
+    SetType (lldb::SymbolType type)
+    {
+        m_type = (lldb::SymbolType)type;
+    }
 
     const char *
     GetTypeAsString () const;
 
     uint32_t
-    GetFlags () const { return m_flags; }
+    GetFlags () const
+    {
+        return m_flags;
+    }
 
     void
-    SetFlags (uint32_t flags) { m_flags = flags; }
+    SetFlags (uint32_t flags)
+    {
+        m_flags = flags;
+    }
 
     void
     GetDescription (Stream *s, lldb::DescriptionLevel level, Target *target) const;
 
-    Address &
-    GetValue () { return m_addr_range.GetBaseAddress(); }
-
-    const Address &
-    GetValue () const { return m_addr_range.GetBaseAddress(); }
-
     bool
-    IsSynthetic () const { return m_is_synthetic; }
+    IsSynthetic () const
+    {
+        return m_is_synthetic;
+    }
 
     void
-    SetIsSynthetic (bool b) { m_is_synthetic = b; }
+    SetIsSynthetic (bool b)
+    {
+        m_is_synthetic = b;
+    }
 
+    
+    bool
+    GetSizeIsSynthesized() const
+    {
+        return m_size_is_synthesized;
+    }
+    
     void
-    SetSizeIsSynthesized(bool b) { m_size_is_synthesized = b; }
+    SetSizeIsSynthesized(bool b)
+    {
+        m_size_is_synthesized = b;
+    }
 
     bool
-    IsDebug () const { return m_is_debug; }
+    IsDebug () const
+    {
+        return m_is_debug;
+    }
 
     void
-    SetDebug (bool b) { m_is_debug = b; }
+    SetDebug (bool b)
+    {
+        m_is_debug = b;
+    }
 
     bool
-    IsExternal () const { return m_is_external; }
+    IsExternal () const
+    {
+        return m_is_external;
+    }
 
     void
-    SetExternal (bool b) { m_is_external = b; }
+    SetExternal (bool b)
+    {
+        m_is_external = b;
+    }
 
     bool
     IsTrampoline () const;
 
+    lldb::addr_t
+    GetByteSize () const;
+    
     void
-    SetByteSize (uint32_t size) { m_addr_range.SetByteSize(size); }
-
-    void
-    SetSizeIsSibling (bool b) { m_size_is_sibling = b; }
+    SetByteSize (uint32_t size)
+    {
+        m_addr_range.SetByteSize(size);
+    }
 
-    void
-    SetValue (Address &value) { m_addr_range.GetBaseAddress() = value; }
+    bool
+    GetSizeIsSibling () const
+    {
+        return m_size_is_sibling;
+    }
 
     void
-    SetValue (const AddressRange &range) { m_addr_range = range; }
+    SetSizeIsSibling (bool b)
+    {
+        m_size_is_sibling = b;
+    }
 
-    void
-    SetValue (lldb::addr_t value);
+//    void
+//    SetValue (Address &value)
+//    {
+//        m_addr_range.GetBaseAddress() = value;
+//    }
+//
+//    void
+//    SetValue (const AddressRange &range)
+//    {
+//        m_addr_range = range;
+//    }
+//
+//    void
+//    SetValue (lldb::addr_t value);
+//    {
+//        m_addr_range.GetBaseAddress().SetRawAddress(value);
+//    }
 
     // If m_type is "Code" or "Function" then this will return the prologue size
     // in bytes, else it will return zero.

Modified: lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme (original)
+++ lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme Wed Mar  7 15:03:09 2012
@@ -82,8 +82,9 @@
       </EnvironmentVariables>
    </TestAction>
    <LaunchAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+      debugProcessAsUID = "4294967295"
       launchStyle = "0"
       useCustomWorkingDirectory = "NO"
       customWorkingDirectory = "/Volumes/work/gclayton/Documents/devb/attach"

Modified: lldb/trunk/source/API/SBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbol.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbol.cpp (original)
+++ lldb/trunk/source/API/SBSymbol.cpp Wed Mar  7 15:03:09 2012
@@ -129,16 +129,16 @@
             api_locker.Reset (target_sp->GetAPIMutex().GetMutex());
             target_sp->CalculateExecutionContext (exe_ctx);
         }
-        const AddressRange *symbol_range = m_opaque_ptr->GetAddressRangePtr();
-        if (symbol_range)
+        if (m_opaque_ptr->ValueIsAddress())
         {
-            ModuleSP module_sp (symbol_range->GetBaseAddress().GetModule());
+            ModuleSP module_sp (m_opaque_ptr->GetAddress().GetModule());
             if (module_sp)
             {
+                AddressRange symbol_range (m_opaque_ptr->GetAddress(), m_opaque_ptr->GetByteSize());
                 sb_instructions.SetDisassembler (Disassembler::DisassembleRange (module_sp->GetArchitecture (),
                                                                                  NULL,
                                                                                  exe_ctx,
-                                                                                 *symbol_range));
+                                                                                 symbol_range));
             }
         }
     }
@@ -161,14 +161,9 @@
 SBSymbol::GetStartAddress ()
 {
     SBAddress addr;
-    if (m_opaque_ptr)
+    if (m_opaque_ptr && m_opaque_ptr->ValueIsAddress())
     {
-        // Make sure the symbol is an address based symbol first:
-        AddressRange *symbol_arange_ptr = m_opaque_ptr->GetAddressRangePtr();
-        if (symbol_arange_ptr)
-        {
-            addr.SetAddress (&symbol_arange_ptr->GetBaseAddress());
-        }
+        addr.SetAddress (&m_opaque_ptr->GetAddress());
     }
     return addr;
 }
@@ -177,17 +172,13 @@
 SBSymbol::GetEndAddress ()
 {
     SBAddress addr;
-    if (m_opaque_ptr)
+    if (m_opaque_ptr && m_opaque_ptr->ValueIsAddress())
     {
-        AddressRange *symbol_arange_ptr = m_opaque_ptr->GetAddressRangePtr();
-        if (symbol_arange_ptr)
+        lldb::addr_t range_size = m_opaque_ptr->GetByteSize();
+        if (range_size > 0)
         {
-            addr_t byte_size = symbol_arange_ptr->GetByteSize();
-            if (byte_size > 0)
-            {
-                addr.SetAddress (&symbol_arange_ptr->GetBaseAddress());
-                addr->Slide (byte_size);
-            }
+            addr.SetAddress (&m_opaque_ptr->GetAddress());
+            addr->Slide (m_opaque_ptr->GetByteSize());
         }
     }
     return addr;

Modified: lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp (original)
+++ lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp Wed Mar  7 15:03:09 2012
@@ -236,9 +236,9 @@
                 SymbolContext symbol_sc;
                 if (sym_list.GetContextAtIndex(j, symbol_sc))
                 {
-                    if (symbol_sc.symbol && symbol_sc.symbol->GetAddressRangePtr())
+                    if (symbol_sc.symbol && symbol_sc.symbol->ValueIsAddress())
                     {
-                        if (sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddressRangePtr()->GetBaseAddress())
+                        if (sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddress())
                         {
                             sym_list.RemoveContextAtIndex(j);
                             continue;   // Don't increment j
@@ -297,9 +297,9 @@
     {
         if (sym_list.GetContextAtIndex(i, sc))
         {
-            if (sc.symbol && sc.symbol->GetAddressRangePtr())
+            if (sc.symbol && sc.symbol->ValueIsAddress())
             {
-                break_addr = sc.symbol->GetAddressRangePtr()->GetBaseAddress();
+                break_addr = sc.symbol->GetAddress();
                 
                 if (m_skip_prologue)
                 {

Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Wed Mar  7 15:03:09 2012
@@ -344,7 +344,10 @@
             }
             Symbol *symbol = frame->GetSymbolContext(eSymbolContextSymbol).symbol;
             if (symbol)
-                range = symbol->GetAddressRangeRef();
+            {
+                range.GetBaseAddress() = symbol->GetAddress();
+                range.SetByteSize(symbol->GetByteSize());
+            }
         }
 
         // Did the "m_options.frame_line" find a valid range already? If so
@@ -395,8 +398,8 @@
                     SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextSymbol));
                     if (sc.function)
                         range.GetBaseAddress() = sc.function->GetAddressRange().GetBaseAddress();
-                    else if (sc.symbol && sc.symbol->GetAddressRangePtr())
-                        range.GetBaseAddress() = sc.symbol->GetAddressRangePtr()->GetBaseAddress();
+                    else if (sc.symbol && sc.symbol->ValueIsAddress())
+                        range.GetBaseAddress() = sc.symbol->GetAddress();
                     else
                         range.GetBaseAddress() = frame->GetFrameCodeAddress();
                 }
@@ -437,8 +440,11 @@
                     SymbolContext sc(frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextSymbol));
                     if (sc.function)
                         range = sc.function->GetAddressRange();
-                    else if (sc.symbol && sc.symbol->GetAddressRangePtr())
-                        range = *sc.symbol->GetAddressRangePtr();
+                    else if (sc.symbol && sc.symbol->ValueIsAddress())
+                    {
+                        range.GetBaseAddress() = sc.symbol->GetAddress();
+                        range.SetByteSize (sc.symbol->GetByteSize());
+                    }
                     else
                         range.GetBaseAddress() = frame->GetFrameCodeAddress();
                 }

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Wed Mar  7 15:03:09 2012
@@ -3586,11 +3586,7 @@
                                         //ModuleSP new_module_sp (new Module (target_module_file, target_module_arch));
                                         ModuleSP new_module_sp;
                                                                 
-                                        Error error (ModuleList::GetSharedModule (module_spec, 
-                                                                                  new_module_sp, 
-                                                                                  &target->GetExecutableSearchPaths(),
-                                                                                  NULL,
-                                                                                  NULL));
+                                        new_module_sp = target->GetSharedModule (module_spec);
                                                         
                                         if (new_module_sp)
                                         {

Modified: lldb/trunk/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Address.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Core/Address.cpp (original)
+++ lldb/trunk/source/Core/Address.cpp Wed Mar  7 15:03:09 2012
@@ -468,7 +468,7 @@
                                     if (symbol_name)
                                     {
                                         s->PutCString(symbol_name);
-                                        addr_t delta = file_Addr - symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress();
+                                        addr_t delta = file_Addr - symbol->GetAddress().GetFileAddress();
                                         if (delta)
                                             s->Printf(" + %llu", delta);
                                         showed_info = true;
@@ -632,9 +632,9 @@
                         if (sc.function == NULL && sc.symbol != NULL)
                         {
                             // If we have just a symbol make sure it is in the right section
-                            if (sc.symbol->GetAddressRangePtr())
+                            if (sc.symbol->ValueIsAddress())
                             {
-                                if (sc.symbol->GetAddressRangePtr()->GetBaseAddress().GetSection() != GetSection())
+                                if (sc.symbol->GetAddress().GetSection() != GetSection())
                                 {
                                     // don't show the module if the symbol is a trampoline symbol
                                     show_stop_context = false;
@@ -685,7 +685,7 @@
                     // as our address. If it isn't, then we might have just found
                     // the last symbol that came before the address that we are 
                     // looking up that has nothing to do with our address lookup.
-                    if (sc.symbol->GetAddressRangePtr() && sc.symbol->GetAddressRangePtr()->GetBaseAddress().GetSection() != GetSection())
+                    if (sc.symbol->ValueIsAddress() && sc.symbol->GetAddress().GetSection() != GetSection())
                         sc.symbol = NULL;
                 }
                 sc.GetDescription(s, eDescriptionLevelBrief, target);

Modified: lldb/trunk/source/Core/AddressResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/AddressResolverName.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Core/AddressResolverName.cpp (original)
+++ lldb/trunk/source/Core/AddressResolverName.cpp Wed Mar  7 15:03:09 2012
@@ -160,9 +160,9 @@
                 SymbolContext symbol_sc;
                 if (sym_list.GetContextAtIndex(j, symbol_sc))
                 {
-                    if (symbol_sc.symbol && symbol_sc.symbol->GetAddressRangePtr())
+                    if (symbol_sc.symbol && symbol_sc.symbol->ValueIsAddress())
                     {
-                        if (sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddressRangePtr()->GetBaseAddress())
+                        if (sc.function->GetAddressRange().GetBaseAddress() == symbol_sc.symbol->GetAddress())
                         {
                             sym_list.RemoveContextAtIndex(j);
                             continue;   // Don't increment j
@@ -206,10 +206,10 @@
     {
         if (sym_list.GetContextAtIndex(i, sc))
         {
-            if (sc.symbol && sc.symbol->GetAddressRangePtr())
+            if (sc.symbol && sc.symbol->ValueIsAddress())
             {
-                func_addr = sc.symbol->GetAddressRangePtr()->GetBaseAddress();
-                addr_t byte_size = sc.symbol->GetAddressRangePtr()->GetByteSize();
+                func_addr = sc.symbol->GetAddress();
+                addr_t byte_size = sc.symbol->GetByteSize();
 
                 if (skip_prologue)
                 {

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Wed Mar  7 15:03:09 2012
@@ -2163,8 +2163,8 @@
                                                     func_addr = inline_range.GetBaseAddress();
                                             }
                                         }
-                                        else if (sc->symbol && sc->symbol->GetAddressRangePtr())
-                                            func_addr = sc->symbol->GetAddressRangePtr()->GetBaseAddress();
+                                        else if (sc->symbol && sc->symbol->ValueIsAddress())
+                                            func_addr = sc->symbol->GetAddress();
                                     }
                                     
                                     if (func_addr.IsValid())

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Wed Mar  7 15:03:09 2012
@@ -484,9 +484,10 @@
         {
             range = sc.function->GetAddressRange();
         }
-        else if (sc.symbol && sc.symbol->GetAddressRangePtr())
+        else if (sc.symbol && sc.symbol->ValueIsAddress())
         {
-            range = *sc.symbol->GetAddressRangePtr();
+            range.GetBaseAddress() = sc.symbol->GetAddress();
+            range.SetByteSize (sc.symbol->GetByteSize());
         }
         else
         {

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Mar  7 15:03:09 2012
@@ -732,7 +732,7 @@
     if (sym_ctx.function)
         func_so_addr = &sym_ctx.function->GetAddressRange().GetBaseAddress();
     else if (sym_ctx.symbol)
-        func_so_addr = &sym_ctx.symbol->GetAddressRangeRef().GetBaseAddress();
+        func_so_addr = &sym_ctx.symbol->GetAddress();
     else
         return false;
     
@@ -759,7 +759,7 @@
         SymbolContext sym_ctx;
         sc_list.GetContextAtIndex(i, sym_ctx);
     
-        const Address *sym_address = &sym_ctx.symbol->GetAddressRangeRef().GetBaseAddress();
+        const Address *sym_address = &sym_ctx.symbol->GetAddress();
         
         if (!sym_address || !sym_address->IsValid())
             return LLDB_INVALID_ADDRESS;
@@ -1036,7 +1036,7 @@
         }
         else if (expr_var_sp->m_parser_vars->m_lldb_sym)
         {
-            const Address sym_address = expr_var_sp->m_parser_vars->m_lldb_sym->GetAddressRangeRef().GetBaseAddress();
+            const Address sym_address = expr_var_sp->m_parser_vars->m_lldb_sym->GetAddress();
             
             if (!sym_address.IsValid())
                 return Value();
@@ -3008,8 +3008,7 @@
     
     std::auto_ptr<Value> symbol_location(new Value);
     
-    AddressRange &symbol_range = symbol.GetAddressRangeRef();
-    Address &symbol_address = symbol_range.GetBaseAddress();
+    Address &symbol_address = symbol.GetAddress();
     lldb::addr_t symbol_load_addr = symbol_address.GetLoadAddress(target);
     
     symbol_location->SetContext(Value::eContextTypeClangType, user_type.GetOpaqueQualType());
@@ -3196,8 +3195,7 @@
     }
     else if (symbol)
     {
-        fun_address = &symbol->GetAddressRangeRef().GetBaseAddress();
-        
+        fun_address = &symbol->GetAddress();
         fun_decl = context.AddGenericFunDecl();
     }
     else

Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Wed Mar  7 15:03:09 2012
@@ -315,7 +315,7 @@
             const Symbol *symbol = m_kernel.module_sp->FindFirstSymbolWithNameAndType (kext_summary_symbol, eSymbolTypeData);
             if (symbol)
             {
-                m_kext_summary_header_ptr_addr = symbol->GetValue();
+                m_kext_summary_header_ptr_addr = symbol->GetAddress();
                 // Update all image infos
                 ReadAllKextSummaries ();
             }

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Wed Mar  7 15:03:09 2012
@@ -342,7 +342,7 @@
                 static ConstString g_dyld_all_image_infos ("dyld_all_image_infos");
                 const Symbol *symbol = dyld_module_sp->FindFirstSymbolWithNameAndType (g_dyld_all_image_infos, eSymbolTypeData);
                 if (symbol)
-                    m_dyld_all_image_infos_addr = symbol->GetValue().GetLoadAddress(&m_process->GetTarget());
+                    m_dyld_all_image_infos_addr = symbol->GetAddress().GetLoadAddress(&m_process->GetTarget());
             }
 
             // Update all image infos
@@ -1333,11 +1333,7 @@
     ModuleSP module_sp;
     if (sym_ctx.symbol)
     {
-        AddressRange *ar = sym_ctx.symbol->GetAddressRangePtr();
-        if (ar)
-        {
-            module_sp = ar->GetBaseAddress().GetModule();
-        }
+        module_sp = sym_ctx.symbol->GetAddress().GetModule();
     }
     if (module_sp.get() == NULL && sym_ctx.function)
     {

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Wed Mar  7 15:03:09 2012
@@ -184,7 +184,7 @@
         
         contexts.GetContextAtIndex(0, context);
         
-        m_PrintForDebugger_addr.reset(new Address(context.symbol->GetValue()));
+        m_PrintForDebugger_addr.reset(new Address(context.symbol->GetAddress()));
     }
     
     return m_PrintForDebugger_addr.get();

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Wed Mar  7 15:03:09 2012
@@ -546,7 +546,7 @@
         || ivar_offset_symbol.symbol == NULL)
         return LLDB_INVALID_IVAR_OFFSET;
     
-    addr_t ivar_offset_address = ivar_offset_symbol.symbol->GetValue().GetLoadAddress (&target);
+    addr_t ivar_offset_address = ivar_offset_symbol.symbol->GetAddress().GetLoadAddress (&target);
     
     Error error;
     

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Wed Mar  7 15:03:09 2012
@@ -355,10 +355,10 @@
                                                                                             eSymbolTypeData);
         if (trampoline_symbol != NULL)
         {
-            if (!trampoline_symbol->GetValue().IsValid())
+            if (!trampoline_symbol->GetAddress().IsValid())
                 return false;
                 
-            m_trampoline_header = trampoline_symbol->GetValue().GetLoadAddress(&target);
+            m_trampoline_header = trampoline_symbol->GetAddress().GetLoadAddress(&target);
             if (m_trampoline_header == LLDB_INVALID_ADDRESS)
                 return false;
             
@@ -368,10 +368,10 @@
                                                                                              eSymbolTypeCode);
             if (changed_symbol != NULL)
             {
-                if (!changed_symbol->GetValue().IsValid())
+                if (!changed_symbol->GetAddress().IsValid())
                     return false;
                     
-                lldb::addr_t changed_addr = changed_symbol->GetValue().GetOpcodeLoadAddress (&target);
+                lldb::addr_t changed_addr = changed_symbol->GetAddress().GetOpcodeLoadAddress (&target);
                 if (changed_addr != LLDB_INVALID_ADDRESS)
                 {
                     BreakpointSP trampolines_changed_bp_sp = target.CreateBreakpoint (changed_addr, true);
@@ -543,13 +543,13 @@
     const Symbol *msg_forward_stret = m_objc_module_sp->FindFirstSymbolWithNameAndType (msg_forward_stret_name, eSymbolTypeCode);
     
     if (class_getMethodImplementation)
-        m_impl_fn_addr = class_getMethodImplementation->GetValue().GetOpcodeLoadAddress (target);
+        m_impl_fn_addr = class_getMethodImplementation->GetAddress().GetOpcodeLoadAddress (target);
     if  (class_getMethodImplementation_stret)
-        m_impl_stret_fn_addr = class_getMethodImplementation_stret->GetValue().GetOpcodeLoadAddress (target);
+        m_impl_stret_fn_addr = class_getMethodImplementation_stret->GetAddress().GetOpcodeLoadAddress (target);
     if (msg_forward)
-        m_msg_forward_addr = msg_forward->GetValue().GetOpcodeLoadAddress(target);
+        m_msg_forward_addr = msg_forward->GetAddress().GetOpcodeLoadAddress(target);
     if  (msg_forward_stret)
-        m_msg_forward_stret_addr = msg_forward_stret->GetValue().GetOpcodeLoadAddress(target);
+        m_msg_forward_stret_addr = msg_forward_stret->GetAddress().GetOpcodeLoadAddress(target);
     
     // FIXME: Do some kind of logging here.
     if (m_impl_fn_addr == LLDB_INVALID_ADDRESS || m_impl_stret_fn_addr == LLDB_INVALID_ADDRESS)
@@ -570,7 +570,7 @@
             // Problem is we also need to lookup the dispatch function.  For now we could have a side table of stret & non-stret
             // dispatch functions.  If that's as complex as it gets, we're fine.
             
-            lldb::addr_t sym_addr = msgSend_symbol->GetValue().GetOpcodeLoadAddress(target);
+            lldb::addr_t sym_addr = msgSend_symbol->GetAddress().GetOpcodeLoadAddress(target);
             
             m_msgSend_map.insert(std::pair<lldb::addr_t, int>(sym_addr, i));
         }
@@ -888,7 +888,7 @@
                         SymbolContext sc;
                         sc_list.GetContextAtIndex(0, sc);
                         if (sc.symbol != NULL)
-                            impl_code_address = sc.symbol->GetValue();
+                            impl_code_address = sc.symbol->GetAddress();
                             
                         //lldb::addr_t addr = impl_code_address.GetOpcodeLoadAddress (exe_ctx.GetTargetPtr());
                         //printf ("Getting address for our_utility_function: 0x%llx.\n", addr);

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Wed Mar  7 15:03:09 2012
@@ -606,10 +606,9 @@
         Symbol *symbol = symtab->FindSymbolContainingFileAddress(file_addr);
         if (symbol)
         {
-            const AddressRange *range_ptr = symbol->GetAddressRangePtr();
-            if (range_ptr)
+            if (symbol->ValueIsAddress())
             {
-                SectionSP section_sp (range_ptr->GetBaseAddress().GetSection());
+                SectionSP section_sp (symbol->GetAddress().GetSection());
                 if (section_sp)
                 {
                     const SectionType section_type = section_sp->GetType();
@@ -1881,8 +1880,8 @@
 
                         sym[sym_idx].SetID (nlist_idx);
                         sym[sym_idx].SetType (type);
-                        sym[sym_idx].GetAddressRangeRef().GetBaseAddress().SetSection (symbol_section);
-                        sym[sym_idx].GetAddressRangeRef().GetBaseAddress().SetOffset (symbol_value);
+                        sym[sym_idx].GetAddress().SetSection (symbol_section);
+                        sym[sym_idx].GetAddress().SetOffset (symbol_value);
                         sym[sym_idx].SetFlags (nlist.n_type << 16 | nlist.n_desc);
 
                         ++sym_idx;
@@ -1905,7 +1904,7 @@
                      nlist_idx < symtab_load_command.nsyms && (global_symbol = symtab->FindSymbolWithType (eSymbolTypeData, Symtab::eDebugYes, Symtab::eVisibilityAny, nlist_idx)) != NULL;
                      nlist_idx++)
                 {
-                    if (global_symbol->GetValue().GetFileAddress() == 0)
+                    if (global_symbol->GetAddress().GetFileAddress() == 0)
                     {
                         std::vector<uint32_t> indexes;
                         if (symtab->AppendSymbolIndexesWithName (global_symbol->GetMangled().GetName(), indexes) > 0)
@@ -1917,7 +1916,7 @@
                                 symbol_ptr = symtab->SymbolAtIndex(*pos);
                                 if (symbol_ptr != global_symbol && symbol_ptr->IsDebug() == false)
                                 {
-                                    global_symbol->SetValue(symbol_ptr->GetValue());
+                                    global_symbol->GetAddress() = symbol_ptr->GetAddress();
                                     break;
                                 }
                             }
@@ -1997,8 +1996,8 @@
                                                 // for no good reason.
                                                 stub_symbol->SetType (eSymbolTypeTrampoline);
                                                 stub_symbol->SetExternal (false);
-                                                stub_symbol->GetAddressRangeRef().GetBaseAddress() = so_addr;
-                                                stub_symbol->GetAddressRangeRef().SetByteSize (symbol_stub_byte_size);
+                                                stub_symbol->GetAddress() = so_addr;
+                                                stub_symbol->SetByteSize (symbol_stub_byte_size);
                                             }
                                             else
                                             {
@@ -2009,8 +2008,8 @@
                                                 sym[sym_idx].GetMangled() = stub_symbol->GetMangled();
                                                 sym[sym_idx].SetType (eSymbolTypeTrampoline);
                                                 sym[sym_idx].SetIsSynthetic (true);
-                                                sym[sym_idx].GetAddressRangeRef().GetBaseAddress() = so_addr;
-                                                sym[sym_idx].GetAddressRangeRef().SetByteSize (symbol_stub_byte_size);
+                                                sym[sym_idx].GetAddress() = so_addr;
+                                                sym[sym_idx].SetByteSize (symbol_stub_byte_size);
                                                 ++sym_idx;
                                             }
                                         }
@@ -2252,7 +2251,7 @@
             if (module_sp->FindSymbolsWithNameAndType(ConstString ("start"), eSymbolTypeCode, contexts))
             {
                 if (contexts.GetContextAtIndex(0, context))
-                    m_entry_point_address = context.symbol->GetValue();
+                    m_entry_point_address = context.symbol->GetAddress();
             }
         }
     }

Modified: lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Wed Mar  7 15:03:09 2012
@@ -539,7 +539,7 @@
                 symbol.naux     = symtab_data.GetU8  (&offset);		
                 Address symbol_addr(sect_list->GetSectionAtIndex(symbol.sect-1), symbol.value);
                 symbols[i].GetMangled ().SetValue (symbol_name.c_str(), symbol_name[0]=='_' && symbol_name[1] == 'Z');
-                symbols[i].SetValue(symbol_addr);
+                symbols[i].GetAddress() = symbol_addr;
 
                 if (symbol.naux > 0)
                     i += symbol.naux;

Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp Wed Mar  7 15:03:09 2012
@@ -136,10 +136,15 @@
 
             SymbolContext first_frame_sc (first_frame->GetSymbolContext(resolve_scope));
             const AddressRange *addr_range_ptr = NULL;
+            AddressRange range;
             if (first_frame_sc.function)
                 addr_range_ptr = &first_frame_sc.function->GetAddressRange();
             else if (first_frame_sc.symbol)
-                addr_range_ptr = first_frame_sc.symbol->GetAddressRangePtr();
+            {
+                range.GetBaseAddress() = first_frame_sc.symbol->GetAddress();
+                range.SetByteSize (first_frame_sc.symbol->GetByteSize());
+                addr_range_ptr = ⦥
+            }
 
             if (addr_range_ptr)
             {
@@ -230,10 +235,15 @@
 
             SymbolContext first_frame_sc(first_frame->GetSymbolContext(resolve_scope));
             const AddressRange *addr_range_ptr = NULL;
+            AddressRange range;
             if (first_frame_sc.function)
                 addr_range_ptr = &first_frame_sc.function->GetAddressRange();
             else if (first_frame_sc.symbol)
-                addr_range_ptr = first_frame_sc.symbol->GetAddressRangePtr();
+            {
+                range.GetBaseAddress() = first_frame_sc.symbol->GetAddress();
+                range.SetByteSize (first_frame_sc.symbol->GetByteSize());
+                addr_range_ptr = ⦥
+            }
 
             if (addr_range_ptr)
             {

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Wed Mar  7 15:03:09 2012
@@ -2482,7 +2482,7 @@
                     dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType (g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);
             }
             if (dispatch_queue_offsets_symbol)
-                m_dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetValue().GetLoadAddress(&m_target);
+                m_dispatch_queue_offsets_addr = dispatch_queue_offsets_symbol->GetAddress().GetLoadAddress(&m_target);
 
             if (m_dispatch_queue_offsets_addr == LLDB_INVALID_ADDRESS)
                 return NULL;

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=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Mar  7 15:03:09 2012
@@ -6076,10 +6076,9 @@
                                                                                                                            Symtab::eVisibilityExtern);
                                                 if (defined_symbol)
                                                 {
-                                                    const AddressRange *defined_range = defined_symbol->GetAddressRangePtr();
-                                                    if (defined_range)
+                                                    if (defined_symbol->ValueIsAddress())
                                                     {
-                                                        const addr_t defined_addr = defined_range->GetBaseAddress().GetFileAddress();
+                                                        const addr_t defined_addr = defined_symbol->GetAddress().GetFileAddress();
                                                         if (defined_addr != LLDB_INVALID_ADDRESS)
                                                         {
                                                             if (location.Update_DW_OP_addr (defined_addr))

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=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Wed Mar  7 15:03:09 2012
@@ -330,8 +330,8 @@
                                 if (oso_fun_symbol)
                                 {
                                     // If we found the symbol, then we
-                                    SectionSP exe_fun_section (exe_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection());
-                                    SectionSP oso_fun_section (oso_fun_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection());
+                                    SectionSP exe_fun_section (exe_symbol->GetAddress().GetSection());
+                                    SectionSP oso_fun_section (oso_fun_symbol->GetAddress().GetSection());
                                     if (oso_fun_section)
                                     {
                                         // Now we create a section that we will add as a child of the
@@ -342,17 +342,17 @@
                                         // size will reflect any size changes (ppc has been known to
                                         // shrink function sizes when it gets rid of jump islands that
                                         // aren't needed anymore).
-                                        SectionSP oso_fun_section_sp (new Section (oso_fun_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection(),
+                                        SectionSP oso_fun_section_sp (new Section (oso_fun_symbol->GetAddress().GetSection(),
                                                                                         oso_module_sp,                         // Module (the .o file)
                                                                                         sect_id++,                          // Section ID starts at 0x10000 and increments so the section IDs don't overlap with the standard mach IDs
                                                                                         exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), // Name the section the same as the symbol for which is was generated!
                                                                                         eSectionTypeDebug,
-                                                                                        oso_fun_symbol->GetAddressRangePtr()->GetBaseAddress().GetOffset(),  // File VM address offset in the current section
+                                                                                        oso_fun_symbol->GetAddress().GetOffset(),  // File VM address offset in the current section
                                                                                         exe_symbol->GetByteSize(),          // File size (we need the size from the executable)
                                                                                         0, 0, 0));
 
                                         oso_fun_section_sp->SetLinkedLocation (exe_fun_section,
-                                                                               exe_symbol->GetValue().GetFileAddress() - exe_fun_section->GetFileAddress());
+                                                                               exe_symbol->GetAddress().GetFileAddress() - exe_fun_section->GetFileAddress());
                                         oso_fun_section->GetChildren().AddSection(oso_fun_section_sp);
                                         comp_unit_info->debug_map_sections_sp->AddSection(oso_fun_section_sp);
                                     }
@@ -381,24 +381,24 @@
                                                                                                       Symtab::eDebugNo, 
                                                                                                       Symtab::eVisibilityAny);
 
-                                if (exe_symbol && oso_gsym_symbol && exe_symbol->GetAddressRangePtr() && oso_gsym_symbol->GetAddressRangePtr())
+                                if (exe_symbol && oso_gsym_symbol && exe_symbol->ValueIsAddress() && oso_gsym_symbol->ValueIsAddress())
                                 {
                                     // If we found the symbol, then we
-                                    SectionSP exe_gsym_section (exe_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection());
-                                    SectionSP oso_gsym_section (oso_gsym_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection());
+                                    SectionSP exe_gsym_section (exe_symbol->GetAddress().GetSection());
+                                    SectionSP oso_gsym_section (oso_gsym_symbol->GetAddress().GetSection());
                                     if (oso_gsym_section)
                                     {
-                                        SectionSP oso_gsym_section_sp (new Section (oso_gsym_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection(),
+                                        SectionSP oso_gsym_section_sp (new Section (oso_gsym_symbol->GetAddress().GetSection(),
                                                                                     oso_module_sp,                         // Module (the .o file)
                                                                                     sect_id++,                          // Section ID starts at 0x10000 and increments so the section IDs don't overlap with the standard mach IDs
                                                                                     exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), // Name the section the same as the symbol for which is was generated!
                                                                                     eSectionTypeDebug,
-                                                                                    oso_gsym_symbol->GetAddressRangePtr()->GetBaseAddress().GetOffset(),  // File VM address offset in the current section
+                                                                                    oso_gsym_symbol->GetAddress().GetOffset(),  // File VM address offset in the current section
                                                                                     1,                                   // We don't know the size of the global, just do the main address for now.
                                                                                     0, 0, 0));
 
                                         oso_gsym_section_sp->SetLinkedLocation (exe_gsym_section,
-                                                                                exe_symbol->GetValue().GetFileAddress() - exe_gsym_section->GetFileAddress());
+                                                                                exe_symbol->GetAddress().GetFileAddress() - exe_gsym_section->GetFileAddress());
                                         oso_gsym_section->GetChildren().AddSection(oso_gsym_section_sp);
                                         comp_unit_info->debug_map_sections_sp->AddSection(oso_gsym_section_sp);
                                     }

Modified: lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Wed Mar  7 15:03:09 2012
@@ -207,7 +207,7 @@
                 if (curr_symbol)
                 {
                     // Union of all ranges in the function DIE (if the function is discontiguous)
-                    AddressRange func_range(curr_symbol->GetValue(), 0);
+                    AddressRange func_range(curr_symbol->GetAddress(), 0);
                     if (func_range.GetBaseAddress().IsSectionOffset())
                     {
                         uint32_t symbol_size = curr_symbol->GetByteSize();
@@ -218,7 +218,7 @@
                             next_symbol = symtab->SymbolAtIndex(m_code_indexes[idx + 1]);
                             if (next_symbol)
                             {
-                                func_range.SetByteSize(next_symbol->GetValue().GetOffset() - curr_symbol->GetValue().GetOffset());
+                                func_range.SetByteSize(next_symbol->GetAddress().GetOffset() - curr_symbol->GetAddress().GetOffset());
                             }
                         }
 

Modified: lldb/trunk/source/Symbol/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ObjectFile.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp (original)
+++ lldb/trunk/source/Symbol/ObjectFile.cpp Wed Mar  7 15:03:09 2012
@@ -266,10 +266,9 @@
         Symbol *symbol = symtab->FindSymbolContainingFileAddress(file_addr);
         if (symbol)
         {
-            const AddressRange *range_ptr = symbol->GetAddressRangePtr();
-            if (range_ptr)
+            if (symbol->ValueIsAddress())
             {
-                const SectionSP section_sp (range_ptr->GetBaseAddress().GetSection());
+                const SectionSP section_sp (symbol->GetAddress().GetSection());
                 if (section_sp)
                 {
                     const SectionType section_type = section_sp->GetType();

Modified: lldb/trunk/source/Symbol/Symbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symbol.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symbol.cpp (original)
+++ lldb/trunk/source/Symbol/Symbol.cpp Wed Mar  7 15:03:09 2012
@@ -158,28 +158,10 @@
     m_addr_range.Clear();
 }
 
-AddressRange *
-Symbol::GetAddressRangePtr()
+bool
+Symbol::ValueIsAddress() const
 {
-    if (m_addr_range.GetBaseAddress().GetSection())
-    {
-        if (!m_calculated_size)
-            GetByteSize();
-        return &m_addr_range;
-    }
-    return NULL;
-}
-
-const AddressRange *
-Symbol::GetAddressRangePtr() const
-{
-    if (m_addr_range.GetBaseAddress().GetSection())
-    {
-        if (!m_calculated_size)
-            GetByteSize();
-        return &m_addr_range;
-    }
-    return NULL;
+    return m_addr_range.GetBaseAddress().GetSection().get() != NULL;
 }
 
 uint32_t
@@ -245,8 +227,10 @@
               m_is_external ? 'X' : ' ',
               GetTypeAsString());
 
-    SectionSP section_sp (m_addr_range.GetBaseAddress().GetSection());
-    if (section_sp)
+    // Make sure the size of the symbol is up to date before dumping
+    GetByteSize();
+
+    if (ValueIsAddress())
     {
         if (!m_addr_range.GetBaseAddress().Dump(s, NULL, Address::DumpStyleFileAddress))
             s->Printf("%*s", 18, "");
@@ -304,13 +288,6 @@
     return 0;
 }
 
-void
-Symbol::SetValue(addr_t value)
-{
-    m_addr_range.GetBaseAddress().SetRawAddress(value);
-}
-
-
 bool
 Symbol::Compare(const ConstString& name, SymbolType type) const
 {
@@ -365,9 +342,8 @@
 {
     // Symbols can reconstruct the symbol and the module in the symbol context
     sc->symbol = this;
-    const AddressRange *range = GetAddressRangePtr();
-    if (range)
-        sc->module_sp = range->GetBaseAddress().GetModule();
+    if (ValueIsAddress())
+        sc->module_sp = GetAddress().GetModule();
     else
         sc->module_sp.reset();
 }
@@ -375,9 +351,8 @@
 ModuleSP
 Symbol::CalculateSymbolContextModule ()
 {
-    const AddressRange *range = GetAddressRangePtr();
-    if (range)
-        return range->GetBaseAddress().GetModule();
+    if (ValueIsAddress())
+        return GetAddress().GetModule();
     return ModuleSP();
 }
 
@@ -392,10 +367,9 @@
 Symbol::DumpSymbolContext (Stream *s)
 {
     bool dumped_module = false;
-    const AddressRange *range = GetAddressRangePtr();
-    if (range)
-    {   
-        ModuleSP module_sp (range->GetBaseAddress().GetModule());
+    if (ValueIsAddress())
+    {
+        ModuleSP module_sp (GetAddress().GetModule());
         if (module_sp)
         {
             dumped_module = true;
@@ -416,10 +390,9 @@
     if (byte_size == 0 && !m_calculated_size)
     {
         const_cast<Symbol*>(this)->m_calculated_size = true;
-        const AddressRange *range = GetAddressRangePtr();
-        if (range)
+        if (ValueIsAddress())
         {
-            ModuleSP module_sp (range->GetBaseAddress().GetModule());
+            ModuleSP module_sp (GetAddress().GetModule());
             if (module_sp)
             {
                 ObjectFile *objfile = module_sp->GetObjectFile();
@@ -428,7 +401,7 @@
                     Symtab *symtab = objfile->GetSymtab();
                     if (symtab)
                     {
-                        const_cast<AddressRange &>(m_addr_range).SetByteSize(symtab->CalculateSymbolSize (const_cast<Symbol *>(this)));
+                        const_cast<Symbol*>(this)->SetByteSize (symtab->CalculateSymbolSize (const_cast<Symbol *>(this)));
                         byte_size = m_addr_range.GetByteSize();
                     }
                 }

Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Wed Mar  7 15:03:09 2012
@@ -206,9 +206,9 @@
             symbol->GetMangled().GetName().Dump(s);
         }
 
-        if (addr.IsValid() && symbol->GetAddressRangePtr())
+        if (addr.IsValid() && symbol->ValueIsAddress())
         {
-            const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddressRangePtr()->GetBaseAddress().GetOffset();
+            const addr_t symbol_offset = addr.GetOffset() - symbol->GetAddress().GetOffset();
             if (symbol_offset)
             {
                 dumped_something = true;
@@ -431,10 +431,10 @@
     {
         if (range_idx == 0)
         {
-            const AddressRange *range_ptr = symbol->GetAddressRangePtr();
-            if (range_ptr)
+            if (symbol->ValueIsAddress())
             {
-                range = *range_ptr;
+                range.GetBaseAddress() = symbol->GetAddress();
+                range.SetByteSize (symbol->GetByteSize());
                 return true;
             }
         }
@@ -551,7 +551,7 @@
         }
         return function->GetMangled().GetName(preference);
     }
-    else if (symbol && symbol->GetAddressRangePtr())
+    else if (symbol && symbol->ValueIsAddress())
     {
         return symbol->GetMangled().GetName(preference);
     }
@@ -934,14 +934,13 @@
         && sc.block     == NULL
         && sc.line_entry.IsValid() == false)
     {
-        const AddressRange *symbol_range = sc.symbol->GetAddressRangePtr();
-        if (symbol_range)
+        if (sc.symbol->ValueIsAddress())
         {
             for (pos = m_symbol_contexts.begin(); pos != end; ++pos)
             {
                 if (pos->function)
                 {
-                    if (pos->function->GetAddressRange().GetBaseAddress() == symbol_range->GetBaseAddress())
+                    if (pos->function->GetAddressRange().GetBaseAddress() == sc.symbol->GetAddress())
                     {
                         // Do we already have a function with this symbol?
                         if (pos->symbol == sc.symbol)

Modified: lldb/trunk/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Symtab.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Symtab.cpp (original)
+++ lldb/trunk/source/Symbol/Symtab.cpp Wed Mar  7 15:03:09 2012
@@ -442,15 +442,8 @@
         const std::vector<Symbol>& symbols;
         SymbolIndexComparator(const std::vector<Symbol>& s) : symbols(s) { }
         bool operator()(uint32_t index_a, uint32_t index_b) {
-            addr_t value_a;
-            addr_t value_b;
-            if (symbols[index_a].GetValue().GetSection() == symbols[index_b].GetValue().GetSection()) {
-                value_a = symbols[index_a].GetValue ().GetOffset();
-                value_b = symbols[index_b].GetValue ().GetOffset();
-            } else {
-                value_a = symbols[index_a].GetValue ().GetFileAddress();
-                value_b = symbols[index_b].GetValue ().GetFileAddress();
-            }
+            addr_t value_a = symbols[index_a].GetAddress().GetFileAddress();
+            addr_t value_b = symbols[index_b].GetAddress().GetFileAddress();
 
             if (value_a == value_b) {
                 // The if the values are equal, use the original symbol user ID
@@ -741,10 +734,9 @@
 
     // lldb::Symbol::GetAddressRangePtr() will only return a non NULL address
     // range if the symbol has a section!
-    const AddressRange *curr_range = curr_symbol->GetAddressRangePtr();
-    if (curr_range)
+    if (curr_symbol->ValueIsAddress())
     {
-        const addr_t curr_file_addr = curr_range->GetBaseAddress().GetFileAddress();
+        const addr_t curr_file_addr = curr_symbol->GetAddress().GetFileAddress();
         if (info_file_addr < curr_file_addr)
             return -1;
         if (info_file_addr > curr_file_addr)
@@ -765,10 +757,9 @@
         return -1;
 
     const addr_t info_file_addr = info->file_addr;
-    const AddressRange *curr_range = symbol->GetAddressRangePtr();
-    if (curr_range)
+    if (symbol->ValueIsAddress())
     {
-        const addr_t curr_file_addr = curr_range->GetBaseAddress().GetFileAddress();
+        const addr_t curr_file_addr = symbol->GetAddress().GetFileAddress();
         if (info_file_addr < curr_file_addr)
             return -1;
 
@@ -819,7 +810,7 @@
         const_iterator end = m_symbols.end();
         for (const_iterator pos = m_symbols.begin(); pos != end; ++pos)
         {
-            if (pos->GetAddressRangePtr())
+            if (pos->ValueIsAddress())
                 m_addr_indexes.push_back (std::distance(begin, pos));
         }
 #endif
@@ -851,15 +842,18 @@
 
     // Else if this is an address based symbol, figure out the delta between
     // it and the next address based symbol
-    if (symbol->GetAddressRangePtr())
+    if (symbol->ValueIsAddress())
     {
         if (!m_addr_indexes_computed)
             InitAddressIndexes();
         const size_t num_addr_indexes = m_addr_indexes.size();
-        SymbolSearchInfo info = FindIndexPtrForSymbolContainingAddress(this, symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress(), &m_addr_indexes.front(), num_addr_indexes);
+        SymbolSearchInfo info = FindIndexPtrForSymbolContainingAddress (this,
+                                                                        symbol->GetAddress().GetFileAddress(),
+                                                                        &m_addr_indexes.front(),
+                                                                        num_addr_indexes);
         if (info.match_index_ptr != NULL)
         {
-            const lldb::addr_t curr_file_addr = symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress();
+            const lldb::addr_t curr_file_addr = symbol->GetAddress().GetFileAddress();
             // We can figure out the address range of all symbols except the
             // last one by taking the delta between the current symbol and
             // the next symbol
@@ -872,12 +866,11 @@
                 if (next_symbol == NULL)
                     break;
 
-                assert (next_symbol->GetAddressRangePtr());
-                const lldb::addr_t next_file_addr = next_symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress();
+                const lldb::addr_t next_file_addr = next_symbol->GetAddress().GetFileAddress();
                 if (next_file_addr > curr_file_addr)
                 {
                     byte_size = next_file_addr - curr_file_addr;
-                    symbol->GetAddressRangePtr()->SetByteSize(byte_size);
+                    symbol->SetByteSize(byte_size);
                     symbol->SetSizeIsSynthesized(true);
                     break;
                 }

Modified: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInRange.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp Wed Mar  7 15:03:09 2012
@@ -201,7 +201,7 @@
             }
             else if (sc.symbol)
             {
-                func_start_address = sc.symbol->GetValue();
+                func_start_address = sc.symbol->GetAddress();
                 if (curr_addr == func_start_address.GetLoadAddress(m_thread.CalculateTarget().get()))
                     bytes_to_skip = sc.symbol->GetPrologueByteSize();
             }

Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=152244&r1=152243&r2=152244&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Wed Mar  7 15:03:09 2012
@@ -184,9 +184,10 @@
     {
         return m_addr_context.function->GetAddressRange().ContainsLoadAddress (cur_pc, m_thread.CalculateTarget().get());
     }
-    else if (m_addr_context.symbol != NULL)
+    else if (m_addr_context.symbol)
     {
-        return m_addr_context.symbol->GetAddressRangeRef().ContainsLoadAddress (cur_pc, m_thread.CalculateTarget().get());
+        AddressRange range(m_addr_context.symbol->GetAddress(), m_addr_context.symbol->GetByteSize());
+        return range.ContainsLoadAddress (cur_pc, m_thread.CalculateTarget().get());
     }
     return false;
 }





More information about the lldb-commits mailing list