[Lldb-commits] [lldb] r193761 - <rdar://problem/14496092>

Greg Clayton gclayton at apple.com
Thu Oct 31 09:59:48 PDT 2013


Author: gclayton
Date: Thu Oct 31 11:59:47 2013
New Revision: 193761

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

Fixes from code review by Jim Ingham that reinstate preferring an external vs non-external symbol when finding function addresses.


Modified:
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=193761&r1=193760&r2=193761&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Thu Oct 31 11:59:47 2013
@@ -1361,7 +1361,8 @@ ClangExpressionDeclMap::FindExternalVisi
             
             if (sc_list.GetSize())
             {
-                Symbol *symbol = NULL;
+                Symbol *extern_symbol = NULL;
+                Symbol *non_extern_symbol = NULL;
                 
                 for (uint32_t index = 0, num_indices = sc_list.GetSize();
                      index < num_indices;
@@ -1390,17 +1391,29 @@ ClangExpressionDeclMap::FindExternalVisi
                     else if (sym_ctx.symbol)
                     {
                         if (sym_ctx.symbol->GetType() == eSymbolTypeReExported)
-                            symbol = sym_ctx.symbol->ResolveReExportedSymbol(*target);
+                        {
+                            sym_ctx.symbol = sym_ctx.symbol->ResolveReExportedSymbol(*target);
+                            if (sym_ctx.symbol == NULL)
+                                continue;
+                        }
+                        
+                        if (sym_ctx.symbol->IsExternal())
+                            extern_symbol = sym_ctx.symbol;
                         else
-                            symbol = sym_ctx.symbol;
+                            non_extern_symbol = sym_ctx.symbol;
                     }
                 }
                 
                 if (!context.m_found.function_with_type_info)
                 {
-                    if (symbol)
+                    if (extern_symbol)
+                    {
+                        AddOneFunction (context, NULL, extern_symbol, current_id);
+                        context.m_found.function = true;
+                    }
+                    else if (non_extern_symbol)
                     {
-                        AddOneFunction (context, NULL, symbol, current_id);
+                        AddOneFunction (context, NULL, non_extern_symbol, current_id);
                         context.m_found.function = true;
                     }
                 }





More information about the lldb-commits mailing list