Index: lldb/trunk/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile =================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile +++ lldb/trunk/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile @@ -0,0 +1,22 @@ +LEVEL = ../../make + +C_SOURCES := main.c + +# Make an archive that has two object files with the same name, but +# different timestamps. Do it all in one rule so that the timestamps +# can be controlled without confusing Make. +libfoo.a: a.c sub1/a.c + $(CC) $(CFLAGS) -c $( + +extern int a(int); +extern int b(int); +int main (int argc, char const *argv[]) +{ + printf ("a(1) returns %d\n", a(1)); + printf ("b(2) returns %d\n", b(2)); +} Index: lldb/trunk/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/sub1/a.c =================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/sub1/a.c +++ lldb/trunk/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/sub1/a.c @@ -0,0 +1,14 @@ +//===-- a.c -----------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +static int __b_global = 2; + +int b(int arg) { + int result = arg + __b_global; + return result; +} Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -300,7 +300,9 @@ std::vector m_compile_unit_infos; std::vector m_func_indexes; // Sorted by address std::vector m_glob_indexes; - std::map m_oso_map; + std::map>, + OSOInfoSP> + m_oso_map; UniqueDWARFASTTypeMap m_unique_ast_type_map; lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type; DebugMap m_debug_map; Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp =================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -411,13 +411,15 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo( CompileUnitInfo *comp_unit_info) { if (!comp_unit_info->oso_sp) { - auto pos = m_oso_map.find(comp_unit_info->oso_path); + auto pos = m_oso_map.find( + {comp_unit_info->oso_path, comp_unit_info->oso_mod_time}); if (pos != m_oso_map.end()) { comp_unit_info->oso_sp = pos->second; } else { ObjectFile *obj_file = GetObjectFile(); comp_unit_info->oso_sp.reset(new OSOInfo()); - m_oso_map[comp_unit_info->oso_path] = comp_unit_info->oso_sp; + m_oso_map[{comp_unit_info->oso_path, comp_unit_info->oso_mod_time}] = + comp_unit_info->oso_sp; const char *oso_path = comp_unit_info->oso_path.GetCString(); FileSpec oso_file(oso_path, false); ConstString oso_object;