[Lldb-commits] [lldb] r113195 - in /lldb/trunk: include/lldb/API/SBBlock.h include/lldb/API/SBFileSpec.h include/lldb/API/SBFrame.h include/lldb/Symbol/Block.h include/lldb/Target/StackFrame.h lldb.xcodeproj/project.pbxproj source/API/SBBlock.cpp source/API/SBFrame.cpp source/Symbol/Block.cpp source/Symbol/SymbolContext.cpp source/Target/StackFrame.cpp source/Target/StackFrameList.cpp

Greg Clayton gclayton at apple.com
Mon Sep 6 21:20:48 PDT 2010


Author: gclayton
Date: Mon Sep  6 23:20:48 2010
New Revision: 113195

URL: http://llvm.org/viewvc/llvm-project?rev=113195&view=rev
Log:
Added more API to lldb::SBBlock to allow getting the block
parent, sibling and first child block, and access to the
inline function information.

Added an accessor the StackFrame:

	Block * lldb_private::StackFrame::GetFrameBlock();
	
LLDB represents inline functions as lexical blocks that have
inlined function information in them. The function above allows
us to easily get the top most lexical block that defines a stack
frame. When there are no inline functions in function, the block
returned ends up being the top most block for the function. When
the PC is in an inlined funciton for a frame, this will return the
first parent block that has inlined function information. The
other accessor: StackFrame::GetBlock() will return the deepest block
that matches the frame's PC value. Since most debuggers want to display
all variables in the current frame, the Block returned by
StackFrame::GetFrameBlock can be used to retrieve all variables for
the current frame.

Fixed the lldb_private::Block::DumpStopContext(...) to properly
display inline frames a block should display all of its inlined
functions. Prior to this fix, one of the call sites was being skipped.
This is a separate code path from the current default where inlined
functions get their own frames.

Fixed an issue where a block would always grab variables for any
child inline function blocks.


Modified:
    lldb/trunk/include/lldb/API/SBBlock.h
    lldb/trunk/include/lldb/API/SBFileSpec.h
    lldb/trunk/include/lldb/API/SBFrame.h
    lldb/trunk/include/lldb/Symbol/Block.h
    lldb/trunk/include/lldb/Target/StackFrame.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBBlock.cpp
    lldb/trunk/source/API/SBFrame.cpp
    lldb/trunk/source/Symbol/Block.cpp
    lldb/trunk/source/Symbol/SymbolContext.cpp
    lldb/trunk/source/Target/StackFrame.cpp
    lldb/trunk/source/Target/StackFrameList.cpp

Modified: lldb/trunk/include/lldb/API/SBBlock.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBlock.h?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBBlock.h (original)
+++ lldb/trunk/include/lldb/API/SBBlock.h Mon Sep  6 23:20:48 2010
@@ -23,17 +23,44 @@
     ~SBBlock ();
 
     bool
+    IsInlined () const;
+
+    bool
     IsValid () const;
 
-    void
-    AppendVariables (bool can_create, bool get_parent_variables, lldb_private::VariableList *var_list);
+    const char *
+    GetInlinedName () const;
+
+    lldb::SBFileSpec
+    GetInlinedCallSiteFile () const;
+
+    uint32_t 
+    GetInlinedCallSiteLine () const;
+
+    uint32_t
+    GetInlinedCallSiteColumn () const;
+
+    lldb::SBBlock
+    GetParent ();
+    
+    lldb::SBBlock
+    GetSibling ();
+    
+    lldb::SBBlock
+    GetFirstChild ();
 
 private:
     friend class SBFrame;
     friend class SBSymbolContext;
 
+#ifndef SWIG
+
     SBBlock (lldb_private::Block *lldb_object_ptr);
 
+    void
+    AppendVariables (bool can_create, bool get_parent_variables, lldb_private::VariableList *var_list);
+
+#endif
 
     lldb_private::Block *m_opaque_ptr;
 };

Modified: lldb/trunk/include/lldb/API/SBFileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFileSpec.h?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBFileSpec.h (original)
+++ lldb/trunk/include/lldb/API/SBFileSpec.h Mon Sep  6 23:20:48 2010
@@ -49,9 +49,10 @@
     ResolvePath (const char *src_path, char *dst_path, size_t dst_len);
 
 private:
-    friend class SBLineEntry;
+    friend class SBBlock;
     friend class SBCompileUnit;
     friend class SBHostOS;
+    friend class SBLineEntry;
     friend class SBModule;
     friend class SBSourceManager;
     friend class SBThread;

Modified: lldb/trunk/include/lldb/API/SBFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFrame.h?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBFrame.h (original)
+++ lldb/trunk/include/lldb/API/SBFrame.h Mon Sep  6 23:20:48 2010
@@ -57,9 +57,25 @@
     lldb::SBFunction
     GetFunction () const;
 
+    // Gets the deepest block that contains the frame PC
     lldb::SBBlock
     GetBlock () const;
 
+    // Gets the lexical block that defines the stack frame. Another way to think
+    // of this is it will return the block that contains all of the variables
+    // for a stack frame. Inlined functions are represented as SBBlock objects
+    // that have inlined function information: the name of the inlined function,
+    // where it was called from. The block that is returned will be the first 
+    // block at or above the block for the PC (SBFrame::GetBlock()) that defines
+    // the scope of the frame. When a function contains no inlined functions,
+    // this will be the top most lexical block that defines the function. 
+    // When a function has inlined functions and the PC is currently
+    // in one of those inlined functions, this method will return the inlined
+    // block that defines this frame. If the PC isn't currently in an inlined
+    // function, the lexical block that defines the function is returned.
+    lldb::SBBlock
+    GetFrameBlock () const;
+
     lldb::SBLineEntry
     GetLineEntry () const;
 

Modified: lldb/trunk/include/lldb/Symbol/Block.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Block.h?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Block.h (original)
+++ lldb/trunk/include/lldb/Symbol/Block.h Mon Sep  6 23:20:48 2010
@@ -159,7 +159,11 @@
     Dump (Stream *s, lldb::addr_t base_addr, int32_t depth, bool show_context) const;
 
     void
-    DumpStopContext (Stream *s, const SymbolContext *sc, bool show_fullpaths);
+    DumpStopContext (Stream *s, 
+                     const SymbolContext *sc, 
+                     const Declaration *child_inline_call_site,
+                     bool show_fullpaths,
+                     bool show_inline_blocks);
 
     //------------------------------------------------------------------
     /// @copydoc SymbolContextScope::DumpSymbolContext(Stream*)
@@ -251,12 +255,19 @@
     ///     to see the current state of what has been parsed up to this
     ///     point.
     ///
+    /// @param[in] add_inline_child_block_variables
+    ///     If this is \b false, no child variables of child blocks 
+    ///     that are inlined functions will be gotten. If \b true then
+    ///     all child variables will be added regardless of wether they
+    ///     come from inlined functions or not.
+    ///
     /// @return
     ///     A variable list shared pointer that contains all variables
     ///     for this block.
     //------------------------------------------------------------------
     lldb::VariableListSP
-    GetVariableList (bool get_child_variables, bool can_create);
+    GetVariableList (bool get_child_variables, 
+                     bool can_create);
 
 
     //------------------------------------------------------------------
@@ -301,7 +312,7 @@
     ///     if this is a regular block.
     //------------------------------------------------------------------
     const InlineFunctionInfo*
-    InlinedFunctionInfo () const
+    GetInlinedFunctionInfo () const
     {
         return m_inlineInfoSP.get();
     }

Modified: lldb/trunk/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/StackFrame.h (original)
+++ lldb/trunk/include/lldb/Target/StackFrame.h Mon Sep  6 23:20:48 2010
@@ -81,6 +81,9 @@
     bool
     GetFrameBaseValue(Scalar &value, Error *error_ptr);
 
+    Block *
+    GetFrameBlock ();
+
     RegisterContext *
     GetRegisterContext ();
 

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Sep  6 23:20:48 2010
@@ -2282,7 +2282,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/API/SBBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBlock.cpp?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBlock.cpp (original)
+++ lldb/trunk/source/API/SBBlock.cpp Mon Sep  6 23:20:48 2010
@@ -8,9 +8,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "lldb/API/SBBlock.h"
+#include "lldb/API/SBFileSpec.h"
 #include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/Function.h"
 
 using namespace lldb;
+using namespace lldb_private;
 
 
 SBBlock::SBBlock () :
@@ -34,6 +37,63 @@
     return m_opaque_ptr != NULL;
 }
 
+bool
+SBBlock::IsInlined () const
+{
+    if (m_opaque_ptr)
+        return m_opaque_ptr->GetInlinedFunctionInfo () != NULL;
+    return false;
+}
+
+const char *
+SBBlock::GetInlinedName () const
+{
+    if (m_opaque_ptr)
+    {
+        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
+        if (inlined_info)
+            return inlined_info->GetName().AsCString (NULL);
+    }
+    return NULL;
+}
+
+SBFileSpec
+SBBlock::GetInlinedCallSiteFile () const
+{
+    SBFileSpec sb_file;
+    if (m_opaque_ptr)
+    {
+        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
+        if (inlined_info)
+            sb_file.SetFileSpec (inlined_info->GetCallSite().GetFile());
+    }
+    return sb_file;
+}
+
+uint32_t
+SBBlock::GetInlinedCallSiteLine () const
+{
+    if (m_opaque_ptr)
+    {
+        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
+        if (inlined_info)
+            return inlined_info->GetCallSite().GetLine();
+    }
+    return 0;
+}
+
+uint32_t
+SBBlock::GetInlinedCallSiteColumn () const
+{
+    if (m_opaque_ptr)
+    {
+        const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
+        if (inlined_info)
+            return inlined_info->GetCallSite().GetColumn();
+    }
+    return 0;
+}
+
 void
 SBBlock::AppendVariables (bool can_create, bool get_parent_variables, lldb_private::VariableList *var_list)
 {
@@ -44,5 +104,32 @@
     }
 }
 
+SBBlock
+SBBlock::GetParent ()
+{
+    SBBlock sb_block;
+    if (m_opaque_ptr)
+        sb_block.m_opaque_ptr = m_opaque_ptr->GetParent();
+    return sb_block;
+}
+
+SBBlock
+SBBlock::GetSibling ()
+{
+    SBBlock sb_block;
+    if (m_opaque_ptr)
+        sb_block.m_opaque_ptr = m_opaque_ptr->GetSibling();
+    return sb_block;
+}
+
+SBBlock
+SBBlock::GetFirstChild ()
+{
+    SBBlock sb_block;
+    if (m_opaque_ptr)
+        sb_block.m_opaque_ptr = m_opaque_ptr->GetFirstChild();
+    return sb_block;
+}
+
 
 

Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Mon Sep  6 23:20:48 2010
@@ -105,6 +105,13 @@
     return sb_block;
 }
 
+SBBlock
+SBFrame::GetFrameBlock () const
+{
+    SBBlock sb_block(m_opaque_sp->GetFrameBlock ());
+    return sb_block;    
+}
+
 SBLineEntry
 SBFrame::GetLineEntry () const
 {

Modified: lldb/trunk/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Block.cpp?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Block.cpp (original)
+++ lldb/trunk/source/Symbol/Block.cpp Mon Sep  6 23:20:48 2010
@@ -145,48 +145,77 @@
 }
 
 void
-Block::DumpStopContext (Stream *s, const SymbolContext *sc, bool show_fullpaths)
+Block::DumpStopContext 
+(
+    Stream *s, 
+    const SymbolContext *sc_ptr, 
+    const Declaration *child_inline_call_site, 
+    bool show_fullpaths,
+    bool show_inline_blocks)
 {
     Block* parent_block = GetParent();
 
-    const InlineFunctionInfo* inline_info = InlinedFunctionInfo ();
+    const InlineFunctionInfo* inline_info = GetInlinedFunctionInfo ();
+    const Declaration *inline_call_site = child_inline_call_site;
     if (inline_info)
     {
-        const Declaration &call_site = inline_info->GetCallSite();
-        if (sc)
+        inline_call_site = &inline_info->GetCallSite();
+        if (sc_ptr)
         {
-            // First frame, dump the first inline call site
-//            if (call_site.IsValid())
-//            {
-//                s->PutCString(" at ");
-//                call_site.DumpStopContext (s);
-//            }
+            // First frame in a frame with inlined functions
             s->PutCString (" [inlined]");
         }
-        s->EOL();
-        inline_info->DumpStopContext (s);
-        if (sc == NULL)
+        if (show_inline_blocks)
+            s->EOL();
+        else
+            s->PutChar(' ');
+            
+        s->PutCString(inline_info->GetName ().AsCString());
+
+        if (child_inline_call_site && child_inline_call_site->IsValid())
         {
-            if (call_site.IsValid())
-            {
-                s->PutCString(" at ");
-                call_site.DumpStopContext (s, show_fullpaths);
-            }
+            s->PutCString(" at ");
+            child_inline_call_site->DumpStopContext (s, show_fullpaths);
         }
     }
 
-    if (sc)
+    if (sc_ptr)
     {
         // If we have any inlined functions, this will be the deepest most
         // inlined location
-        if (sc->line_entry.IsValid())
+        if (sc_ptr->line_entry.IsValid())
         {
             s->PutCString(" at ");
-            sc->line_entry.DumpStopContext (s, show_fullpaths);
+            sc_ptr->line_entry.DumpStopContext (s, show_fullpaths);
+        }
+    }
+
+    if (show_inline_blocks)
+    {
+        if (parent_block)
+        {
+            parent_block->Block::DumpStopContext (s, 
+                                                  NULL, 
+                                                  inline_call_site, 
+                                                  show_fullpaths, 
+                                                  show_inline_blocks);
+        }
+        else if (child_inline_call_site)
+        {
+            SymbolContext sc;
+            CalculateSymbolContext(&sc);
+            if (sc.function)
+            {
+                s->EOL();
+                s->Indent (sc.function->GetMangled().GetName().AsCString());
+                if (child_inline_call_site && child_inline_call_site->IsValid())
+                {
+                    s->PutCString(" at ");
+                    child_inline_call_site->DumpStopContext (s, show_fullpaths);
+                }
+            }
         }
     }
-    if (parent_block)
-        parent_block->Block::DumpStopContext (s, NULL, show_fullpaths);
 }
 
 
@@ -246,7 +275,7 @@
 Block *
 Block::GetContainingInlinedBlock ()
 {
-    if (InlinedFunctionInfo())
+    if (GetInlinedFunctionInfo())
         return this;
     return GetInlinedParent ();
 }
@@ -257,7 +286,7 @@
     Block *parent_block = GetParent ();
     if (parent_block)
     {
-        if (parent_block->InlinedFunctionInfo())
+        if (parent_block->GetInlinedFunctionInfo())
             return parent_block;
         else
             return parent_block->GetInlinedParent();
@@ -381,13 +410,17 @@
 
         if (get_child_variables)
         {
-            Block *child_block = GetFirstChild();
-            while (child_block)
-            {
-                VariableListSP child_block_variable_list(child_block->GetVariableList(get_child_variables, can_create));
-                if (child_block_variable_list.get())
-                    variable_list_sp->AddVariables(child_block_variable_list.get());
-                child_block = child_block->GetSibling();
+            for (Block *child_block = GetFirstChild(); 
+                 child_block != NULL; 
+                 child_block = child_block->GetSibling())
+            {   
+                if (child_block->GetInlinedFunctionInfo() == NULL)
+                {
+                    VariableListSP child_block_variable_list(child_block->GetVariableList(get_child_variables, can_create));
+                    if (child_block_variable_list.get())
+                        variable_list_sp->AddVariables(child_block_variable_list.get());
+                }
+                
             }
         }
     }
@@ -407,7 +440,7 @@
     uint32_t num_variables_added = 0;
     VariableListSP variable_list_sp(GetVariableList(false, can_create));
 
-    bool is_inlined_function = InlinedFunctionInfo() != NULL;
+    bool is_inlined_function = GetInlinedFunctionInfo() != NULL;
     if (variable_list_sp.get())
     {
         num_variables_added = variable_list_sp->GetSize();

Modified: lldb/trunk/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolContext.cpp?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/SymbolContext.cpp (original)
+++ lldb/trunk/source/Symbol/SymbolContext.cpp Mon Sep  6 23:20:48 2010
@@ -135,12 +135,12 @@
 
         if (show_inlined_frames && block)
         {
-            const InlineFunctionInfo *inline_info = block->InlinedFunctionInfo();
+            const InlineFunctionInfo *inline_info = block->GetInlinedFunctionInfo();
             if (inline_info == NULL)
             {
                 const Block *parent_inline_block = block->GetInlinedParent();
                 if (parent_inline_block)
-                    inline_info = parent_inline_block->InlinedFunctionInfo();
+                    inline_info = parent_inline_block->GetInlinedFunctionInfo();
             }
 
             if (inline_info)
@@ -163,7 +163,7 @@
         if (block != NULL)
         {
             s->IndentMore();
-            block->DumpStopContext(s, this, show_fullpaths);
+            block->DumpStopContext (s, this, NULL, show_fullpaths, show_inlined_frames);
             s->IndentLess();
         }
         else

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Mon Sep  6 23:20:48 2010
@@ -165,40 +165,27 @@
     {
         if (m_id.GetSymbolContextScope ())
         {
+            // We already have a symbol context scope, we just don't have our
+            // flag bit set.
             m_flags.Set (RESOLVED_FRAME_ID_SYMBOL_SCOPE);
         }
         else
         {
-            GetSymbolContext (eSymbolContextFunction | eSymbolContextBlock);
-            
-            if (m_sc.block)
-            {
-                Block *inline_block = m_sc.block->GetContainingInlinedBlock();
-                if (inline_block)
-                {
-                    // Use the block with the inlined function info
-                    // as the symbol context since we want this frame
-                    // to have only the variables for the inlined function
-                    SetSymbolContextScope (inline_block);
-                }
-                else
-                {
-                    // This block is not inlined with means it has no
-                    // inlined parents either, so we want to use the top
-                    // most function block.
-                    SetSymbolContextScope (&m_sc.function->GetBlock(false));
-                }
-            }
-            else
+            // Calculate the frame block and use this for the stack ID symbol
+            // context scope if we have one.
+            SymbolContextScope *scope = GetFrameBlock (); 
+            if (scope == NULL)
             {
-                // The current stack frame doesn't have a block. Check to see
-                // if it has a symbol. If it does we will use this as the 
-                // symbol scope. It is ok if "m_sc.symbol" is NULL below as
-                // it will set the symbol context to NULL and set the
-                // RESOLVED_FRAME_ID_SYMBOL_SCOPE flag bit.
-                GetSymbolContext (eSymbolContextSymbol);
-                SetSymbolContextScope (m_sc.symbol);
-            }
+                // We don't have a block, so use the symbol
+                if (m_flags.IsClear (eSymbolContextSymbol))
+                    GetSymbolContext (eSymbolContextSymbol);
+                
+                // It is ok if m_sc.symbol is NULL here
+                scope = m_sc.symbol;
+            }
+            // Set the symbol context scope (the accessor will set the
+            // RESOLVED_FRAME_ID_SYMBOL_SCOPE bit in m_flags).
+            SetSymbolContextScope (scope);
         }
     }
     return m_id;
@@ -270,6 +257,32 @@
     return m_disassembly.GetData();
 }
 
+Block *
+StackFrame::GetFrameBlock ()
+{
+    if (m_sc.block == NULL && m_flags.IsClear (eSymbolContextBlock))
+        GetSymbolContext (eSymbolContextBlock);
+
+    if (m_sc.block)
+    {    
+        Block *inline_block = m_sc.block->GetContainingInlinedBlock();
+        if (inline_block)
+        {
+            // Use the block with the inlined function info
+            // as the frame block we want this frame to have only the variables
+            // for the inlined function and its non-inlined block child blocks.
+            return inline_block;
+        }
+        else
+        {
+            // This block is not contained withing any inlined function blocks
+            // with so we want to use the top most function block.
+            return &m_sc.function->GetBlock (false);
+        }
+    }    
+    return NULL;
+}
+
 //----------------------------------------------------------------------
 // Get the symbol context if we already haven't done so by resolving the
 // PC address as much as possible. This way when we pass around a
@@ -427,24 +440,28 @@
     {
         m_flags.Set(RESOLVED_VARIABLES);
 
-        GetSymbolContext (eSymbolContextCompUnit | 
-                          eSymbolContextFunction | 
-                          eSymbolContextBlock);
-
-        if (m_sc.block)
-        {
-            bool get_child_variables = true;
-            bool can_create = true;
-            m_variable_list_sp = m_sc.function->GetBlock (can_create).GetVariableList (get_child_variables, can_create);
+        Block *frame_block = GetFrameBlock();
+        
+        if (frame_block)
+        {
+            const bool get_child_variables = true;
+            const bool can_create = true;
+            m_variable_list_sp = frame_block->GetVariableList (get_child_variables, can_create);
         }
         
-        if (get_file_globals && m_sc.comp_unit)
+        if (get_file_globals)
         {
-            VariableListSP global_variable_list_sp (m_sc.comp_unit->GetVariableList(true));
-            if (m_variable_list_sp)
-                m_variable_list_sp->AddVariables (global_variable_list_sp.get());
-            else
-                m_variable_list_sp = global_variable_list_sp;
+            if (m_flags.IsClear (eSymbolContextCompUnit))
+                GetSymbolContext (eSymbolContextCompUnit);
+
+            if (m_sc.comp_unit)
+            {
+                VariableListSP global_variable_list_sp (m_sc.comp_unit->GetVariableList(true));
+                if (m_variable_list_sp)
+                    m_variable_list_sp->AddVariables (global_variable_list_sp.get());
+                else
+                    m_variable_list_sp = global_variable_list_sp;
+            }
         }
     }
     return m_variable_list_sp.get();

Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=113195&r1=113194&r2=113195&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Mon Sep  6 23:20:48 2010
@@ -135,7 +135,7 @@
                             AddressRange range;
                             inlined_block->GetRangeContainingAddress (previous_frame_lookup_addr, range);
                         
-                            const InlineFunctionInfo* inline_info = inlined_block->InlinedFunctionInfo();
+                            const InlineFunctionInfo* inline_info = inlined_block->GetInlinedFunctionInfo();
                             assert (inline_info);
                             inline_sc.line_entry.range.GetBaseAddress() = m_frames.back()->GetFrameCodeAddress();
                             inline_sc.line_entry.file = inline_info->GetCallSite().GetFile();





More information about the lldb-commits mailing list