Index: lit/SymbolFile/DWARF/split-dwarf-inlining.cpp =================================================================== --- /dev/null +++ lit/SymbolFile/DWARF/split-dwarf-inlining.cpp @@ -0,0 +1,8 @@ +// RUN: %clangxx -target x86_64-pc-linux -gsplit-dwarf -fsplit-dwarf-inlining \ +// RUN: -c %s -o %t +// RUN: %lldb %t -o "breakpoint set -n foo" -b | FileCheck %s + +// CHECK: Breakpoint 1: 2 locations + +__attribute__((always_inline)) int foo(int x) { return x; } +int bar(int x) { return foo(x); } Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -240,6 +240,15 @@ m_die_array.shrink_to_fit(); if (m_dwo_symbol_file) { + // With -fsplit-dwarf-inlining, clang will emit non-empty skeleton compile + // units. We are not able to access these DIE *and* the dwo file + // simultaneously. We also don't need to do that as the dwo file will + // contain a superset of information. So, we just delete these extra DIEs + // (if any) and reclaim some space. + m_die_array.resize(1); + m_die_array.shrink_to_fit(); + m_die_array[0].SetHasChildren(false); + DWARFUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit(); dwo_cu->ExtractDIEsIfNeeded(); }