[LLDB][NativePDB] Create inline function decls
authorZequan Wu <zequanwu@google.com>
Fri, 18 Mar 2022 22:31:19 +0000 (15:31 -0700)
committerZequan Wu <zequanwu@google.com>
Fri, 1 Apr 2022 17:06:31 +0000 (10:06 -0700)
This creates inline functions decls in the TUs where the funcitons are inlined and local variable decls inside those functions.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D121967

lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp
lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites.lldbinit
lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites.s [moved from lldb/test/Shell/SymbolFile/NativePDB/inline_sites.s with 58% similarity]
lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites_live.lldbinit [new file with mode: 0644]
lldb/test/Shell/SymbolFile/NativePDB/inline_sites.test [new file with mode: 0644]
lldb/test/Shell/SymbolFile/NativePDB/inline_sites_live.cpp [new file with mode: 0644]
lldb/test/Shell/SymbolFile/NativePDB/local-variables.cpp

index c6f9ef6..7370753 100644 (file)
@@ -514,6 +514,8 @@ clang::Decl *PdbAstBuilder::GetOrCreateSymbolForId(PdbCompilandSymId id) {
     return nullptr;
   case S_BLOCK32:
     return GetOrCreateBlockDecl(id);
+  case S_INLINESITE:
+    return GetOrCreateInlinedFunctionDecl(id);
   default:
     return nullptr;
   }
@@ -539,6 +541,9 @@ llvm::Optional<CompilerDecl> PdbAstBuilder::GetOrCreateDeclForUid(PdbSymUid uid)
   default:
     return llvm::None;
   }
+
+  if (!result)
+    return llvm::None;
   m_uid_to_decl[toOpaqueUid(uid)] = result;
   return ToCompilerDecl(*result);
 }
@@ -913,6 +918,8 @@ PdbAstBuilder::GetOrCreateVariableDecl(PdbCompilandSymId scope_id,
     return llvm::dyn_cast<clang::VarDecl>(decl);
 
   clang::DeclContext *scope = GetOrCreateDeclContextForUid(scope_id);
+  if (!scope)
+    return nullptr;
 
   CVSymbol sym = m_index.ReadSymbolRecord(var_id);
   return CreateVariableDecl(PdbSymUid(var_id), sym, *scope);
@@ -1042,40 +1049,11 @@ clang::QualType PdbAstBuilder::GetOrCreateType(PdbTypeSymId type) {
 }
 
 clang::FunctionDecl *
-PdbAstBuilder::GetOrCreateFunctionDecl(PdbCompilandSymId func_id) {
-  if (clang::Decl *decl = TryGetDecl(func_id))
-    return llvm::dyn_cast<clang::FunctionDecl>(decl);
-
-  clang::DeclContext *parent = GetParentDeclContext(PdbSymUid(func_id));
-  std::string context_name;
-  if (clang::NamespaceDecl *ns = llvm::dyn_cast<clang::NamespaceDecl>(parent)) {
-    context_name = ns->getQualifiedNameAsString();
-  } else if (clang::TagDecl *tag = llvm::dyn_cast<clang::TagDecl>(parent)) {
-    context_name = tag->getQualifiedNameAsString();
-  }
-
-  CVSymbol cvs = m_index.ReadSymbolRecord(func_id);
-  ProcSym proc(static_cast<SymbolRecordKind>(cvs.kind()));
-  llvm::cantFail(SymbolDeserializer::deserializeAs<ProcSym>(cvs, proc));
-
-  PdbTypeSymId type_id(proc.FunctionType);
-  clang::QualType qt = GetOrCreateType(type_id);
-  if (qt.isNull())
-    return nullptr;
-
-  clang::StorageClass storage = clang::SC_None;
-  if (proc.Kind == SymbolRecordKind::ProcSym)
-    storage = clang::SC_Static;
-
-  const clang::FunctionProtoType *func_type =
-      llvm::dyn_cast<clang::FunctionProtoType>(qt);
-
-  CompilerType func_ct = ToCompilerType(qt);
-
-  llvm::StringRef proc_name = proc.Name;
-  proc_name.consume_front(context_name);
-  proc_name.consume_front("::");
-
+PdbAstBuilder::CreateFunctionDecl(PdbCompilandSymId func_id,
+                                  llvm::StringRef func_name, TypeIndex func_ti,
+                                  CompilerType func_ct, uint32_t param_count,
+                                  clang::StorageClass func_storage,
+                                  bool is_inline, clang::DeclContext *parent) {
   clang::FunctionDecl *function_decl = nullptr;
   if (parent->isRecord()) {
     clang::QualType parent_qt = llvm::cast<clang::TypeDecl>(parent)
@@ -1083,19 +1061,19 @@ PdbAstBuilder::GetOrCreateFunctionDecl(PdbCompilandSymId func_id) {
                                     ->getCanonicalTypeInternal();
     lldb::opaque_compiler_type_t parent_opaque_ty =
         ToCompilerType(parent_qt).GetOpaqueQualType();
-
     auto iter = m_cxx_record_map.find(parent_opaque_ty);
     if (iter != m_cxx_record_map.end()) {
-      if (iter->getSecond().contains({proc_name, func_ct})) {
+      if (iter->getSecond().contains({func_name, func_ct})) {
         return nullptr;
       }
     }
 
-    CVType cvt = m_index.tpi().getType(type_id.index);
+    CVType cvt = m_index.tpi().getType(func_ti);
     MemberFunctionRecord func_record(static_cast<TypeRecordKind>(cvt.kind()));
     llvm::cantFail(TypeDeserializer::deserializeAs<MemberFunctionRecord>(
         cvt, func_record));
     TypeIndex class_index = func_record.getClassType();
+
     CVType parent_cvt = m_index.tpi().getType(class_index);
     ClassRecord class_record = CVTagRecord::create(parent_cvt).asClass();
     // If it's a forward reference, try to get the real TypeIndex.
@@ -1109,30 +1087,153 @@ PdbAstBuilder::GetOrCreateFunctionDecl(PdbCompilandSymId func_id) {
     }
     if (!class_record.FieldList.isSimple()) {
       CVType field_list = m_index.tpi().getType(class_record.FieldList);
-      CreateMethodDecl process(m_index, m_clang, type_id.index, function_decl,
-                               parent_opaque_ty, proc_name, func_ct);
+      CreateMethodDecl process(m_index, m_clang, func_ti, function_decl,
+                               parent_opaque_ty, func_name, func_ct);
       if (llvm::Error err = visitMemberRecordStream(field_list.data(), process))
         llvm::consumeError(std::move(err));
     }
 
     if (!function_decl) {
       function_decl = m_clang.AddMethodToCXXRecordType(
-          parent_opaque_ty, proc_name,
+          parent_opaque_ty, func_name,
           /*mangled_name=*/nullptr, func_ct,
           /*access=*/lldb::AccessType::eAccessPublic,
           /*is_virtual=*/false, /*is_static=*/false,
           /*is_inline=*/false, /*is_explicit=*/false,
           /*is_attr_used=*/false, /*is_artificial=*/false);
     }
-
-    m_cxx_record_map[parent_opaque_ty].insert({proc_name, func_ct});
+    m_cxx_record_map[parent_opaque_ty].insert({func_name, func_ct});
   } else {
     function_decl = m_clang.CreateFunctionDeclaration(
-        parent, OptionalClangModuleID(), proc_name, func_ct, storage, false);
-    CreateFunctionParameters(func_id, *function_decl,
-                             func_type->getNumParams());
+        parent, OptionalClangModuleID(), func_name, func_ct, func_storage,
+        is_inline);
+    CreateFunctionParameters(func_id, *function_decl, param_count);
+  }
+  return function_decl;
+}
+
+clang::FunctionDecl *
+PdbAstBuilder::GetOrCreateInlinedFunctionDecl(PdbCompilandSymId inlinesite_id) {
+  CompilandIndexItem *cii =
+      m_index.compilands().GetCompiland(inlinesite_id.modi);
+  CVSymbol sym = cii->m_debug_stream.readSymbolAtOffset(inlinesite_id.offset);
+  InlineSiteSym inline_site(static_cast<SymbolRecordKind>(sym.kind()));
+  cantFail(SymbolDeserializer::deserializeAs<InlineSiteSym>(sym, inline_site));
+
+  // Inlinee is the id index to the function id record that is inlined.
+  PdbTypeSymId func_id(inline_site.Inlinee, true);
+  // Look up the function decl by the id index to see if we have created a
+  // function decl for a different inlinesite that refers the same function.
+  if (clang::Decl *decl = TryGetDecl(func_id))
+    return llvm::dyn_cast<clang::FunctionDecl>(decl);
+  clang::FunctionDecl *function_decl =
+      CreateFunctionDeclFromId(func_id, inlinesite_id);
+
+  // Use inline site id in m_decl_to_status because it's expected to be a
+  // PdbCompilandSymId so that we can parse local variables info after it.
+  uint64_t inlinesite_uid = toOpaqueUid(inlinesite_id);
+  DeclStatus status;
+  status.resolved = true;
+  status.uid = inlinesite_uid;
+  m_decl_to_status.insert({function_decl, status});
+  // Use the index in IPI stream as uid in m_uid_to_decl, because index in IPI
+  // stream are unique and there could be multiple inline sites (different ids)
+  // referring the same inline function. This avoid creating multiple same
+  // inline function delcs.
+  uint64_t func_uid = toOpaqueUid(func_id);
+  lldbassert(m_uid_to_decl.count(func_uid) == 0);
+  m_uid_to_decl[func_uid] = function_decl;
+  return function_decl;
+}
+
+clang::FunctionDecl *
+PdbAstBuilder::CreateFunctionDeclFromId(PdbTypeSymId func_tid,
+                                        PdbCompilandSymId func_sid) {
+  lldbassert(func_tid.is_ipi);
+  CVType func_cvt = m_index.ipi().getType(func_tid.index);
+  llvm::StringRef func_name;
+  TypeIndex func_ti;
+  clang::DeclContext *parent = nullptr;
+  switch (func_cvt.kind()) {
+  case LF_MFUNC_ID: {
+    MemberFuncIdRecord mfr;
+    cantFail(
+        TypeDeserializer::deserializeAs<MemberFuncIdRecord>(func_cvt, mfr));
+    func_name = mfr.getName();
+    func_ti = mfr.getFunctionType();
+    PdbTypeSymId class_type_id(mfr.ClassType, false);
+    parent = GetOrCreateDeclContextForUid(class_type_id);
+    break;
+  }
+  case LF_FUNC_ID: {
+    FuncIdRecord fir;
+    cantFail(TypeDeserializer::deserializeAs<FuncIdRecord>(func_cvt, fir));
+    func_name = fir.getName();
+    func_ti = fir.getFunctionType();
+    parent = FromCompilerDeclContext(GetTranslationUnitDecl());
+    if (!fir.ParentScope.isNoneType()) {
+      CVType parent_cvt = m_index.ipi().getType(fir.ParentScope);
+      if (parent_cvt.kind() == LF_STRING_ID) {
+        StringIdRecord sir;
+        cantFail(
+            TypeDeserializer::deserializeAs<StringIdRecord>(parent_cvt, sir));
+        parent = GetOrCreateNamespaceDecl(sir.String.data(), *parent);
+      }
+    }
+    break;
+  }
+  default:
+    lldbassert(false && "Invalid function id type!");
+  }
+  clang::QualType func_qt = GetOrCreateType(func_ti);
+  if (func_qt.isNull())
+    return nullptr;
+  CompilerType func_ct = ToCompilerType(func_qt);
+  uint32_t param_count =
+      llvm::cast<clang::FunctionProtoType>(func_qt)->getNumParams();
+  return CreateFunctionDecl(func_sid, func_name, func_ti, func_ct, param_count,
+                            clang::SC_None, true, parent);
+}
+
+clang::FunctionDecl *
+PdbAstBuilder::GetOrCreateFunctionDecl(PdbCompilandSymId func_id) {
+  if (clang::Decl *decl = TryGetDecl(func_id))
+    return llvm::dyn_cast<clang::FunctionDecl>(decl);
+
+  clang::DeclContext *parent = GetParentDeclContext(PdbSymUid(func_id));
+  std::string context_name;
+  if (clang::NamespaceDecl *ns = llvm::dyn_cast<clang::NamespaceDecl>(parent)) {
+    context_name = ns->getQualifiedNameAsString();
+  } else if (clang::TagDecl *tag = llvm::dyn_cast<clang::TagDecl>(parent)) {
+    context_name = tag->getQualifiedNameAsString();
   }
 
+  CVSymbol cvs = m_index.ReadSymbolRecord(func_id);
+  ProcSym proc(static_cast<SymbolRecordKind>(cvs.kind()));
+  llvm::cantFail(SymbolDeserializer::deserializeAs<ProcSym>(cvs, proc));
+
+  PdbTypeSymId type_id(proc.FunctionType);
+  clang::QualType qt = GetOrCreateType(type_id);
+  if (qt.isNull())
+    return nullptr;
+
+  clang::StorageClass storage = clang::SC_None;
+  if (proc.Kind == SymbolRecordKind::ProcSym)
+    storage = clang::SC_Static;
+
+  const clang::FunctionProtoType *func_type =
+      llvm::dyn_cast<clang::FunctionProtoType>(qt);
+
+  CompilerType func_ct = ToCompilerType(qt);
+
+  llvm::StringRef proc_name = proc.Name;
+  proc_name.consume_front(context_name);
+  proc_name.consume_front("::");
+
+  clang::FunctionDecl *function_decl =
+      CreateFunctionDecl(func_id, proc_name, proc.FunctionType, func_ct,
+                         func_type->getNumParams(), storage, false, parent);
+
   lldbassert(m_uid_to_decl.count(toOpaqueUid(func_id)) == 0);
   m_uid_to_decl[toOpaqueUid(func_id)] = function_decl;
   DeclStatus status;
@@ -1384,7 +1485,7 @@ static CVSymbolArray skipFunctionParameters(clang::Decl &decl,
 void PdbAstBuilder::ParseBlockChildren(PdbCompilandSymId block_id) {
   CVSymbol sym = m_index.ReadSymbolRecord(block_id);
   lldbassert(sym.kind() == S_GPROC32 || sym.kind() == S_LPROC32 ||
-             sym.kind() == S_BLOCK32);
+             sym.kind() == S_BLOCK32 || sym.kind() == S_INLINESITE);
   CompilandIndexItem &cii =
       m_index.compilands().GetOrCreateCompiland(block_id.modi);
   CVSymbolArray symbols =
@@ -1396,11 +1497,12 @@ void PdbAstBuilder::ParseBlockChildren(PdbCompilandSymId block_id) {
     symbols =
         skipFunctionParameters(*m_uid_to_decl[toOpaqueUid(block_id)], symbols);
 
+  symbols.drop_front();
   auto begin = symbols.begin();
   while (begin != symbols.end()) {
     PdbCompilandSymId child_sym_id(block_id.modi, begin.offset());
     GetOrCreateSymbolForId(child_sym_id);
-    if (begin->kind() == S_BLOCK32) {
+    if (begin->kind() == S_BLOCK32 || begin->kind() == S_INLINESITE) {
       ParseBlockChildren(child_sym_id);
       begin = symbols.at(getScopeEndOffset(*begin));
     }
index 73accf5..40425dd 100644 (file)
@@ -61,6 +61,8 @@ public:
   clang::DeclContext *GetParentDeclContext(PdbSymUid uid);
 
   clang::FunctionDecl *GetOrCreateFunctionDecl(PdbCompilandSymId func_id);
+  clang::FunctionDecl *
+  GetOrCreateInlinedFunctionDecl(PdbCompilandSymId inlinesite_id);
   clang::BlockDecl *GetOrCreateBlockDecl(PdbCompilandSymId block_id);
   clang::VarDecl *GetOrCreateVariableDecl(PdbCompilandSymId scope_id,
                                           PdbCompilandSymId var_id);
@@ -116,7 +118,13 @@ private:
 
   clang::NamespaceDecl *GetOrCreateNamespaceDecl(const char *name,
                                                  clang::DeclContext &context);
-
+  clang::FunctionDecl *CreateFunctionDeclFromId(PdbTypeSymId func_tid,
+                                                PdbCompilandSymId func_sid);
+  clang::FunctionDecl *
+  CreateFunctionDecl(PdbCompilandSymId func_id, llvm::StringRef func_name,
+                     TypeIndex func_ti, CompilerType func_ct,
+                     uint32_t param_count, clang::StorageClass func_storage,
+                     bool is_inline, clang::DeclContext *parent);
   void ParseAllNamespacesPlusChildrenOf(llvm::Optional<llvm::StringRef> parent);
   void ParseDeclsForSimpleContext(clang::DeclContext &context);
   void ParseBlockChildren(PdbCompilandSymId block_id);
index 5c184ce..54fc8d5 100644 (file)
@@ -39,10 +39,9 @@ MakeRangeList(const PdbIndex &index, const LocalVariableAddrRange &range,
   Variable::RangeList result;
   while (!gaps.empty()) {
     const LocalVariableAddrGap &gap = gaps.front();
-
-    lldb::addr_t size = gap.GapStartOffset - start;
-    result.Append(start, size);
-    start += gap.Range;
+    lldb::addr_t gap_start = start + gap.GapStartOffset;
+    result.Append(start, gap_start - start);
+    start = gap_start + gap.Range;
     gaps = gaps.drop_front();
   }
 
index 411c7d9..351c0bf 100644 (file)
@@ -372,7 +372,7 @@ Block &SymbolFileNativePDB::CreateBlock(PdbCompilandSymId block_id) {
     std::shared_ptr<InlineSite> inline_site = m_inline_sites[opaque_block_uid];
     Block &parent_block = GetOrCreateBlock(inline_site->parent_id);
     parent_block.AddChild(child_block);
-
+    m_ast->GetOrCreateInlinedFunctionDecl(block_id);
     // Copy ranges from InlineSite to Block.
     for (size_t i = 0; i < inline_site->ranges.GetSize(); ++i) {
       auto *entry = inline_site->ranges.GetEntryAtIndex(i);
@@ -1742,8 +1742,7 @@ size_t SymbolFileNativePDB::ParseVariablesForBlock(PdbCompilandSymId block_id) {
   case S_BLOCK32:
     break;
   case S_INLINESITE:
-    // TODO: Handle inline site case.
-    return 0;
+    break;
   default:
     lldbassert(false && "Symbol is not a block!");
     return 0;
@@ -1770,8 +1769,10 @@ size_t SymbolFileNativePDB::ParseVariablesForBlock(PdbCompilandSymId block_id) {
     PdbCompilandSymId child_sym_id(block_id.modi, record_offset);
     ++iter;
 
-    // If this is a block, recurse into its children and then skip it.
-    if (variable_cvs.kind() == S_BLOCK32) {
+    // If this is a block or inline site, recurse into its children and then
+    // skip it.
+    if (variable_cvs.kind() == S_BLOCK32 ||
+        variable_cvs.kind() == S_INLINESITE) {
       uint32_t block_end = getScopeEndOffset(variable_cvs);
       count += ParseVariablesForBlock(child_sym_id);
       iter = syms.at(block_end);
index 362e792..f30abbb 100644 (file)
@@ -1,17 +1,28 @@
 image dump line-table a.cpp -v
 
-b a.cpp:5
 b a.h:5
 b a.h:6
 b a.h:7
+b a.h:8
+b a.h:9
+b b.h:5
 b b.h:6
+b b.h:7
+b c.h:5
 b c.h:6
+b c.h:7
+b a.cpp:3
+b a.cpp:4
+b a.h:8
 
 image lookup -a 0x140001003 -v
 image lookup -a 0x140001004 -v
-image lookup -a 0x140001014 -v
-image lookup -a 0x14000101a -v
-image lookup -a 0x140001021 -v
-image lookup -a 0x140001028 -v
+image lookup -a 0x140001010 -v
+image lookup -a 0x14000101c -v
+image lookup -a 0x14000102a -v
+image lookup -a 0x140001039 -v
+image lookup -a 0x140001044 -v
+
+target modules dump ast
 
 quit
\ No newline at end of file
-# clang-format off
-# REQUIRES: lld, x86
-
-# RUN: llvm-mc -triple=x86_64-windows-msvc --filetype=obj %s > %t.obj
-# RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj  -out:%t.exe
-# RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
-# RUN:     %p/Inputs/inline_sites.lldbinit 2>&1 | FileCheck %s
-
-# Compiled from the following files, but replaced the call to abort with nop.
-# a.cpp:
-# #include "stdlib.h"
-# #include "a.h"
-# int main(int argc, char** argv) {
-#   Namespace1::foo(2);
-#   return 0;
-# }
-# a.h:
-# #include "b.h"
-# namespace Namespace1 {
-# inline void foo(int x) {
-#   static volatile int gv_foo;
-#   ++gv_foo;
-#   if (!gv_foo)
-#     abort();
-#   Class1::bar(x + 1);
-# }
-# }
-# b.h:
-# #include "c.h"
-# class Class1 {
-# public:
-#   inline static void bar(int x) {
-#     static volatile int gv_bar;
-#     ++gv_bar;
-#     Namespace2::Class2::func(x + 1);
-#   }
-# };
-# c.h:
-# namespace Namespace2{
-#   class Class2{
-#     public:
-#     inline static void func(int x) {
-#       static volatile int gv_func;
-#       gv_func += x;
-#     }
-#   };
-# }
-
-# CHECK:      (lldb) image dump line-table a.cpp -v
-# CHECK-NEXT: Line table for {{.*}}a.cpp in
-# CHECK-NEXT: 0x0000000140001000: {{.*}}a.cpp:3
-# CHECK-NEXT: 0x0000000140001004: {{.*}}a.h:5, is_start_of_statement = TRUE, is_prologue_end = TRUE
-# CHECK-NEXT: 0x000000014000100a: {{.*}}a.h:6
-# CHECK-NEXT: 0x0000000140001014: {{.*}}b.h:6, is_start_of_statement = TRUE, is_prologue_end = TRUE
-# CHECK-NEXT: 0x000000014000101a: {{.*}}c.h:6, is_start_of_statement = TRUE, is_prologue_end = TRUE
-# CHECK-NEXT: 0x0000000140001021: {{.*}}a.cpp:5
-# CHECK-NEXT: 0x0000000140001028: {{.*}}a.h:7, is_start_of_statement = TRUE
-# CHECK-NEXT: 0x000000014000102a: {{.*}}a.cpp:5, is_terminal_entry = TRUE
-
-# CEHCK: (lldb) b a.cpp:5
-# CHECK: Breakpoint 1: where = {{.*}}`main + 33 at a.cpp:5, address = 0x0000000140001021
-# CEHCK: (lldb) b a.h:5
-# CHECK: Breakpoint 2: where = {{.*}}`main + 4 [inlined] Namespace1::foo at a.h:5, address = 0x0000000140001004
-# CEHCK: (lldb) b a.h:6
-# CHECK: Breakpoint 3: where = {{.*}}`main + 10 [inlined] Namespace1::foo + 6 at a.h:6, address = 0x000000014000100a
-# CEHCK: (lldb) b a.h:7
-# CHECK: Breakpoint 4: where = {{.*}}`main + 40 [inlined] Namespace1::foo at a.h:7, address = 0x0000000140001028
-# CEHCK: (lldb) b b.h:6
-# CHECK: Breakpoint 5: where = {{.*}}`main + 20 [inlined] Class1::bar at b.h:6, address = 0x0000000140001014
-# CEHCK: (lldb) b c.h:6
-# CHECK: Breakpoint 6: where = {{.*}}`main + 26 [inlined] Namespace2::Class2::func at c.h:6, address = 0x000000014000101a
-
-# CEHCK-LABEL: (lldb) image lookup -a 0x140001003 -v
-# CHECK:      Summary: {{.*}}`main + 3 at a.cpp:3
-# CHECK:     Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x000000014000102a)
-# CHECK:       Blocks: id = {{.*}}, range = [0x140001000-0x14000102a)
-# CHECK:    LineEntry: [0x0000000140001000-0x0000000140001004): {{.*}}a.cpp:3
-
-# CEHCK-LABEL: (lldb) image lookup -a 0x140001004 -v
-# CHECK:      Summary: {{.*}}`main + 4 [inlined] Namespace1::foo at a.h:5
-# CHECK-NEXT:          {{.*}}`main + 4 at a.cpp:4
-# CHECK:     Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x000000014000102a)
-# CHECK:       Blocks: id = {{.*}}, range = [0x140001000-0x14000102a)
-# CHECK-NEXT:          id = {{.*}}, ranges = [0x140001004-0x140001021)[0x140001028-0x14000102a), name = "Namespace1::foo", decl = a.h:3
-# CHECK:    LineEntry: [0x0000000140001004-0x000000014000100a): {{.*}}a.h:5
-
-# CEHCK-LABEL: (lldb) image lookup -a 0x140001014 -v
-# CHECK:      Summary: {{.*}}`main + 20 [inlined] Class1::bar at b.h:6
-# CHECK-NEXT:          {{.*}}`main + 20 [inlined] Namespace1::foo + 16 at a.h:8
-# CHECK-NEXT:          {{.*}}`main + 4 at a.cpp:4
-# CHECK:     Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x000000014000102a)
-# CHECK:       Blocks: id = {{.*}}, range = [0x140001000-0x14000102a)
-# CHECK-NEXT:          id = {{.*}}, ranges = [0x140001004-0x140001021)[0x140001028-0x14000102a), name = "Namespace1::foo", decl = a.h:3
-# CHECK-NEXT:          id = {{.*}}, range = [0x140001014-0x140001021), name = "Class1::bar", decl = b.h:4
-# CHECK:    LineEntry: [0x0000000140001014-0x000000014000101a): {{.*}}b.h:6
-
-# CEHCK-LABEL: (lldb) image lookup -a 0x14000101a -v
-# CHECK:      Summary: {{.*}}`main + 26 [inlined] Namespace2::Class2::func at c.h:6
-# CHECK-NEXT:          {{.*}}`main + 26 [inlined] Class1::bar + 6 at b.h:7
-# CHECK-NEXT:          {{.*}}`main + 20 [inlined] Namespace1::foo + 16 at a.h:8
-# CHECK-NEXT:          {{.*}}`main + 4 at a.cpp:4
-# CHECK:     Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x000000014000102a)
-# CHECK:       Blocks: id = {{.*}}, range = [0x140001000-0x14000102a)
-# CHECK-NEXT:          id = {{.*}}, ranges = [0x140001004-0x140001021)[0x140001028-0x14000102a), name = "Namespace1::foo", decl = a.h:3
-# CHECK-NEXT:          id = {{.*}}, range = [0x140001014-0x140001021), name = "Class1::bar", decl = b.h:4
-# CHECK-NEXT:          id = {{.*}}, range = [0x14000101a-0x140001021), name = "Namespace2::Class2::func", decl = c.h:4
-# CHECK:    LineEntry: [0x000000014000101a-0x0000000140001021): {{.*}}c.h:6
-
-# CEHCK-LABEL: (lldb) image lookup -a 0x140001021 -v
-# CHECK:      Summary: {{.*}}`main + 33 at a.cpp:5
-# CHECK:     Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x000000014000102a)
-# CHECK:       Blocks: id = {{.*}}, range = [0x140001000-0x14000102a)
-# CHECK:    LineEntry: [0x0000000140001021-0x0000000140001028): {{.*}}a.cpp:5
-
-# CEHCK-LABEL: (lldb) image lookup -a 0x140001028 -v
-# CHECK:      Summary: {{.*}}`main + 40 [inlined] Namespace1::foo at a.h:7
-# CHECK-NEXT:          {{.*}}`main + 40 at a.cpp:4
-# CHECK:     Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x000000014000102a)
-# CHECK:       Blocks: id = {{.*}}, range = [0x140001000-0x14000102a)
-# CHECK-NEXT:          id = {{.*}}, ranges = [0x140001004-0x140001021)[0x140001028-0x14000102a), name = "Namespace1::foo", decl = a.h:3
-# CHECK:    LineEntry: [0x0000000140001028-0x000000014000102a): {{.*}}a.h:7
-
-       .text
-       .def     @feat.00;
-       .scl    3;
-       .type   0;
-       .endef
-       .globl  @feat.00
-.set @feat.00, 0
-       .intel_syntax noprefix
-       .file   "a.cpp"
-       .def     main;
-       .scl    2;
-       .type   32;
-       .endef
-       .section        .text,"xr",one_only,main
-       .globl  main                            # -- Begin function main
-main:                                   # @main
-.Lfunc_begin0:
-       .cv_func_id 0
-       .cv_file        1 "/tmp/a.cpp" "4ECCDD2814054DCF80EA72F4349036C4" 1
-       .cv_loc 0 1 3 0                         # a.cpp:3:0
-.seh_proc main
-# %bb.0:                                # %entry
-       #DEBUG_VALUE: main:argv <- $rdx
-       #DEBUG_VALUE: main:argc <- $ecx
-       #DEBUG_VALUE: foo:x <- 2
-       sub     rsp, 40
-       .seh_stackalloc 40
-       .seh_endprologue
-.Ltmp0:
-       .cv_file        2 "/tmp/./a.h" "9E656AFA1B1B681265C87EEA8BBE073E" 1
-       .cv_inline_site_id 1 within 0 inlined_at 1 4 0
-       .cv_loc 1 2 5 0                         # ./a.h:5:0
-       inc     dword ptr [rip + "?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC"]
-       .cv_loc 1 2 6 0                         # ./a.h:6:0
-       mov     eax, dword ptr [rip + "?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC"]
-       test    eax, eax
-       je      .LBB0_2
-.Ltmp1:
-# %bb.1:                                # %"?foo@Namespace1@@YAXH@Z.exit"
-       #DEBUG_VALUE: foo:x <- 2
-       #DEBUG_VALUE: main:argc <- $ecx
-       #DEBUG_VALUE: main:argv <- $rdx
-       #DEBUG_VALUE: bar:x <- [DW_OP_plus_uconst 1, DW_OP_stack_value] 2
-       .cv_file        3 "/tmp/./b.h" "BE52983EB17A3B0DA14E68A5CCBC4399" 1
-       .cv_inline_site_id 2 within 1 inlined_at 2 8 0
-       .cv_loc 2 3 6 0                         # ./b.h:6:0
-       inc     dword ptr [rip + "?gv_bar@?1??bar@Class1@@SAXH@Z@4HC"]
-.Ltmp2:
-       #DEBUG_VALUE: func:x <- 4
-       .cv_file        4 "/tmp/./c.h" "D1B76A1C2A54DBEA648F3A11496166B8" 1
-       .cv_inline_site_id 3 within 2 inlined_at 3 7 0
-       .cv_loc 3 4 6 0                         # ./c.h:6:0
-       add     dword ptr [rip + "?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC"], 4
-.Ltmp3:
-       .cv_loc 0 1 5 0                         # a.cpp:5:0
-       xor     eax, eax
-       add     rsp, 40
-       ret
-.Ltmp4:
-.LBB0_2:                                # %if.then.i
-       #DEBUG_VALUE: foo:x <- 2
-       #DEBUG_VALUE: main:argc <- $ecx
-       #DEBUG_VALUE: main:argv <- $rdx
-       .cv_loc 1 2 7 0                         # ./a.h:7:0
-       nop
-.Ltmp5:
-       int3
-.Ltmp6:
-       #DEBUG_VALUE: main:argv <- [DW_OP_LLVM_entry_value 1] $rdx
-       #DEBUG_VALUE: main:argc <- [DW_OP_LLVM_entry_value 1] $ecx
-.Lfunc_end0:
-       .seh_endproc
-                                        # -- End function
-       .section        .bss,"bw",discard,"?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC"
-       .globl  "?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC" # @"?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC"
-       .p2align        2
-"?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC":
-       .long   0                               # 0x0
-
-       .section        .bss,"bw",discard,"?gv_bar@?1??bar@Class1@@SAXH@Z@4HC"
-       .globl  "?gv_bar@?1??bar@Class1@@SAXH@Z@4HC" # @"?gv_bar@?1??bar@Class1@@SAXH@Z@4HC"
-       .p2align        2
-"?gv_bar@?1??bar@Class1@@SAXH@Z@4HC":
-       .long   0                               # 0x0
-
-       .section        .bss,"bw",discard,"?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC"
-       .globl  "?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC" # @"?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC"
-       .p2align        2
-"?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC":
-       .long   0                               # 0x0
-
-       .section        .drectve,"yn"
-       .ascii  " /DEFAULTLIB:libcmt.lib"
-       .ascii  " /DEFAULTLIB:oldnames.lib"
-       .section        .debug$S,"dr"
-       .p2align        2
-       .long   4                               # Debug section magic
-       .long   241
-       .long   .Ltmp8-.Ltmp7                   # Subsection size
-.Ltmp7:
-       .short  .Ltmp10-.Ltmp9                  # Record length
-.Ltmp9:
-       .short  4353                            # Record kind: S_OBJNAME
-       .long   0                               # Signature
-       .asciz  "/tmp/a-e5dd01.obj"             # Object name
-       .p2align        2
-.Ltmp10:
-       .short  .Ltmp12-.Ltmp11                 # Record length
-.Ltmp11:
-       .short  4412                            # Record kind: S_COMPILE3
-       .long   1                               # Flags and language
-       .short  208                             # CPUType
-       .short  14                              # Frontend version
-       .short  0
-       .short  0
-       .short  0
-       .short  14000                           # Backend version
-       .short  0
-       .short  0
-       .short  0
-       .asciz  "clang version 14.0.0"          # Null-terminated compiler version string
-       .p2align        2
-.Ltmp12:
-.Ltmp8:
-       .p2align        2
-       .long   246                             # Inlinee lines subsection
-       .long   .Ltmp14-.Ltmp13                 # Subsection size
-.Ltmp13:
-       .long   0                               # Inlinee lines signature
-
-                                        # Inlined function foo starts at ./a.h:3
-       .long   4099                            # Type index of inlined function
-       .cv_filechecksumoffset  2               # Offset into filechecksum table
-       .long   3                               # Starting line number
-
-                                        # Inlined function bar starts at ./b.h:4
-       .long   4106                            # Type index of inlined function
-       .cv_filechecksumoffset  3               # Offset into filechecksum table
-       .long   4                               # Starting line number
-
-                                        # Inlined function func starts at ./c.h:4
-       .long   4113                            # Type index of inlined function
-       .cv_filechecksumoffset  4               # Offset into filechecksum table
-       .long   4                               # Starting line number
-.Ltmp14:
-       .p2align        2
-       .section        .debug$S,"dr",associative,main
-       .p2align        2
-       .long   4                               # Debug section magic
-       .long   241                             # Symbol subsection for main
-       .long   .Ltmp16-.Ltmp15                 # Subsection size
-.Ltmp15:
-       .short  .Ltmp18-.Ltmp17                 # Record length
-.Ltmp17:
-       .short  4423                            # Record kind: S_GPROC32_ID
-       .long   0                               # PtrParent
-       .long   0                               # PtrEnd
-       .long   0                               # PtrNext
-       .long   .Lfunc_end0-main                # Code size
-       .long   0                               # Offset after prologue
-       .long   0                               # Offset before epilogue
-       .long   4117                            # Function type index
-       .secrel32       main                    # Function section relative address
-       .secidx main                            # Function section index
-       .byte   0                               # Flags
-       .asciz  "main"                          # Function name
-       .p2align        2
-.Ltmp18:
-       .short  .Ltmp20-.Ltmp19                 # Record length
-.Ltmp19:
-       .short  4114                            # Record kind: S_FRAMEPROC
-       .long   40                              # FrameSize
-       .long   0                               # Padding
-       .long   0                               # Offset of padding
-       .long   0                               # Bytes of callee saved registers
-       .long   0                               # Exception handler offset
-       .short  0                               # Exception handler section
-       .long   81920                           # Flags (defines frame register)
-       .p2align        2
-.Ltmp20:
-       .short  .Ltmp22-.Ltmp21                 # Record length
-.Ltmp21:
-       .short  4414                            # Record kind: S_LOCAL
-       .long   116                             # TypeIndex
-       .short  1                               # Flags
-       .asciz  "argc"
-       .p2align        2
-.Ltmp22:
-       .cv_def_range    .Lfunc_begin0 .Ltmp5, reg, 18
-       .short  .Ltmp24-.Ltmp23                 # Record length
-.Ltmp23:
-       .short  4414                            # Record kind: S_LOCAL
-       .long   4114                            # TypeIndex
-       .short  1                               # Flags
-       .asciz  "argv"
-       .p2align        2
-.Ltmp24:
-       .cv_def_range    .Lfunc_begin0 .Ltmp5, reg, 331
-       .short  .Ltmp26-.Ltmp25                 # Record length
-.Ltmp25:
-       .short  4365                            # Record kind: S_GDATA32
-       .long   4118                            # Type
-       .secrel32       "?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC" # DataOffset
-       .secidx "?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC" # Segment
-       .asciz  "Namespace1::foo::gv_foo"       # Name
-       .p2align        2
-.Ltmp26:
-       .short  .Ltmp28-.Ltmp27                 # Record length
-.Ltmp27:
-       .short  4365                            # Record kind: S_GDATA32
-       .long   4118                            # Type
-       .secrel32       "?gv_bar@?1??bar@Class1@@SAXH@Z@4HC" # DataOffset
-       .secidx "?gv_bar@?1??bar@Class1@@SAXH@Z@4HC" # Segment
-       .asciz  "Class1::bar::gv_bar"           # Name
-       .p2align        2
-.Ltmp28:
-       .short  .Ltmp30-.Ltmp29                 # Record length
-.Ltmp29:
-       .short  4365                            # Record kind: S_GDATA32
-       .long   4118                            # Type
-       .secrel32       "?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC" # DataOffset
-       .secidx "?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC" # Segment
-       .asciz  "Namespace2::Class2::func::gv_func" # Name
-       .p2align        2
-.Ltmp30:
-       .short  .Ltmp32-.Ltmp31                 # Record length
-.Ltmp31:
-       .short  4429                            # Record kind: S_INLINESITE
-       .long   0                               # PtrParent
-       .long   0                               # PtrEnd
-       .long   4099                            # Inlinee type index
-       .cv_inline_linetable    1 2 3 .Lfunc_begin0 .Lfunc_end0
-       .p2align        2
-.Ltmp32:
-       .short  .Ltmp34-.Ltmp33                 # Record length
-.Ltmp33:
-       .short  4414                            # Record kind: S_LOCAL
-       .long   116                             # TypeIndex
-       .short  257                             # Flags
-       .asciz  "x"
-       .p2align        2
-.Ltmp34:
-       .short  .Ltmp36-.Ltmp35                 # Record length
-.Ltmp35:
-       .short  4429                            # Record kind: S_INLINESITE
-       .long   0                               # PtrParent
-       .long   0                               # PtrEnd
-       .long   4106                            # Inlinee type index
-       .cv_inline_linetable    2 3 4 .Lfunc_begin0 .Lfunc_end0
-       .p2align        2
-.Ltmp36:
-       .short  .Ltmp38-.Ltmp37                 # Record length
-.Ltmp37:
-       .short  4414                            # Record kind: S_LOCAL
-       .long   116                             # TypeIndex
-       .short  257                             # Flags
-       .asciz  "x"
-       .p2align        2
-.Ltmp38:
-       .short  .Ltmp40-.Ltmp39                 # Record length
-.Ltmp39:
-       .short  4429                            # Record kind: S_INLINESITE
-       .long   0                               # PtrParent
-       .long   0                               # PtrEnd
-       .long   4113                            # Inlinee type index
-       .cv_inline_linetable    3 4 4 .Lfunc_begin0 .Lfunc_end0
-       .p2align        2
-.Ltmp40:
-       .short  .Ltmp42-.Ltmp41                 # Record length
-.Ltmp41:
-       .short  4414                            # Record kind: S_LOCAL
-       .long   116                             # TypeIndex
-       .short  257                             # Flags
-       .asciz  "x"
-       .p2align        2
-.Ltmp42:
-       .short  2                               # Record length
-       .short  4430                            # Record kind: S_INLINESITE_END
-       .short  2                               # Record length
-       .short  4430                            # Record kind: S_INLINESITE_END
-       .short  2                               # Record length
-       .short  4430                            # Record kind: S_INLINESITE_END
-       .short  2                               # Record length
-       .short  4431                            # Record kind: S_PROC_ID_END
-.Ltmp16:
-       .p2align        2
-       .cv_linetable   0, main, .Lfunc_end0
-       .section        .debug$S,"dr"
-       .long   241
-       .long   .Ltmp44-.Ltmp43                 # Subsection size
-.Ltmp43:
-       .short  .Ltmp46-.Ltmp45                 # Record length
-.Ltmp45:
-       .short  4360                            # Record kind: S_UDT
-       .long   4103                            # Type
-       .asciz  "Class1"
-       .p2align        2
-.Ltmp46:
-       .short  .Ltmp48-.Ltmp47                 # Record length
-.Ltmp47:
-       .short  4360                            # Record kind: S_UDT
-       .long   4110                            # Type
-       .asciz  "Namespace2::Class2"
-       .p2align        2
-.Ltmp48:
-.Ltmp44:
-       .p2align        2
-       .cv_filechecksums                       # File index to string table offset subsection
-       .cv_stringtable                         # String table
-       .long   241
-       .long   .Ltmp50-.Ltmp49                 # Subsection size
-.Ltmp49:
-       .short  .Ltmp52-.Ltmp51                 # Record length
-.Ltmp51:
-       .short  4428                            # Record kind: S_BUILDINFO
-       .long   4121                            # LF_BUILDINFO index
-       .p2align        2
-.Ltmp52:
-.Ltmp50:
-       .p2align        2
-       .section        .debug$T,"dr"
-       .p2align        2
-       .long   4                               # Debug section magic
-       # StringId (0x1000)
-       .short  0x12                            # Record length
-       .short  0x1605                          # Record kind: LF_STRING_ID
-       .long   0x0                             # Id
-       .asciz  "Namespace1"                    # StringData
-       .byte   241
-       # ArgList (0x1001)
-       .short  0xa                             # Record length
-       .short  0x1201                          # Record kind: LF_ARGLIST
-       .long   0x1                             # NumArgs
-       .long   0x74                            # Argument: int
-       # Procedure (0x1002)
-       .short  0xe                             # Record length
-       .short  0x1008                          # Record kind: LF_PROCEDURE
-       .long   0x3                             # ReturnType: void
-       .byte   0x0                             # CallingConvention: NearC
-       .byte   0x0                             # FunctionOptions
-       .short  0x1                             # NumParameters
-       .long   0x1001                          # ArgListType: (int)
-       # FuncId (0x1003)
-       .short  0xe                             # Record length
-       .short  0x1601                          # Record kind: LF_FUNC_ID
-       .long   0x1000                          # ParentScope: Namespace1
-       .long   0x1002                          # FunctionType: void (int)
-       .asciz  "foo"                           # Name
-       # Class (0x1004)
-       .short  0x2a                            # Record length
-       .short  0x1504                          # Record kind: LF_CLASS
-       .short  0x0                             # MemberCount
-       .short  0x280                           # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
-       .long   0x0                             # FieldList
-       .long   0x0                             # DerivedFrom
-       .long   0x0                             # VShape
-       .short  0x0                             # SizeOf
-       .asciz  "Class1"                        # Name
-       .asciz  ".?AVClass1@@"                  # LinkageName
-       .byte   242
-       .byte   241
-       # MemberFunction (0x1005)
-       .short  0x1a                            # Record length
-       .short  0x1009                          # Record kind: LF_MFUNCTION
-       .long   0x3                             # ReturnType: void
-       .long   0x1004                          # ClassType: Class1
-       .long   0x0                             # ThisType
-       .byte   0x0                             # CallingConvention: NearC
-       .byte   0x0                             # FunctionOptions
-       .short  0x1                             # NumParameters
-       .long   0x1001                          # ArgListType: (int)
-       .long   0x0                             # ThisAdjustment
-       # FieldList (0x1006)
-       .short  0xe                             # Record length
-       .short  0x1203                          # Record kind: LF_FIELDLIST
-       .short  0x1511                          # Member kind: OneMethod ( LF_ONEMETHOD )
-       .short  0xb                             # Attrs: Public, Static
-       .long   0x1005                          # Type: void Class1::(int)
-       .asciz  "bar"                           # Name
-       # Class (0x1007)
-       .short  0x2a                            # Record length
-       .short  0x1504                          # Record kind: LF_CLASS
-       .short  0x1                             # MemberCount
-       .short  0x200                           # Properties ( HasUniqueName (0x200) )
-       .long   0x1006                          # FieldList: <field list>
-       .long   0x0                             # DerivedFrom
-       .long   0x0                             # VShape
-       .short  0x1                             # SizeOf
-       .asciz  "Class1"                        # Name
-       .asciz  ".?AVClass1@@"                  # LinkageName
-       .byte   242
-       .byte   241
-       # StringId (0x1008)
-       .short  0x12                            # Record length
-       .short  0x1605                          # Record kind: LF_STRING_ID
-       .long   0x0                             # Id
-       .asciz  "/tmp/./b.h"                    # StringData
-       .byte   241
-       # UdtSourceLine (0x1009)
-       .short  0xe                             # Record length
-       .short  0x1606                          # Record kind: LF_UDT_SRC_LINE
-       .long   0x1007                          # UDT: Class1
-       .long   0x1008                          # SourceFile: /tmp/./b.h
-       .long   0x2                             # LineNumber
-       # MemberFuncId (0x100A)
-       .short  0xe                             # Record length
-       .short  0x1602                          # Record kind: LF_MFUNC_ID
-       .long   0x1004                          # ClassType: Class1
-       .long   0x1005                          # FunctionType: void Class1::(int)
-       .asciz  "bar"                           # Name
-       # Class (0x100B)
-       .short  0x42                            # Record length
-       .short  0x1504                          # Record kind: LF_CLASS
-       .short  0x0                             # MemberCount
-       .short  0x280                           # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
-       .long   0x0                             # FieldList
-       .long   0x0                             # DerivedFrom
-       .long   0x0                             # VShape
-       .short  0x0                             # SizeOf
-       .asciz  "Namespace2::Class2"            # Name
-       .asciz  ".?AVClass2@Namespace2@@"       # LinkageName
-       .byte   243
-       .byte   242
-       .byte   241
-       # MemberFunction (0x100C)
-       .short  0x1a                            # Record length
-       .short  0x1009                          # Record kind: LF_MFUNCTION
-       .long   0x3                             # ReturnType: void
-       .long   0x100b                          # ClassType: Namespace2::Class2
-       .long   0x0                             # ThisType
-       .byte   0x0                             # CallingConvention: NearC
-       .byte   0x0                             # FunctionOptions
-       .short  0x1                             # NumParameters
-       .long   0x1001                          # ArgListType: (int)
-       .long   0x0                             # ThisAdjustment
-       # FieldList (0x100D)
-       .short  0x12                            # Record length
-       .short  0x1203                          # Record kind: LF_FIELDLIST
-       .short  0x1511                          # Member kind: OneMethod ( LF_ONEMETHOD )
-       .short  0xb                             # Attrs: Public, Static
-       .long   0x100c                          # Type: void Namespace2::Class2::(int)
-       .asciz  "func"                          # Name
-       .byte   243
-       .byte   242
-       .byte   241
-       # Class (0x100E)
-       .short  0x42                            # Record length
-       .short  0x1504                          # Record kind: LF_CLASS
-       .short  0x1                             # MemberCount
-       .short  0x200                           # Properties ( HasUniqueName (0x200) )
-       .long   0x100d                          # FieldList: <field list>
-       .long   0x0                             # DerivedFrom
-       .long   0x0                             # VShape
-       .short  0x1                             # SizeOf
-       .asciz  "Namespace2::Class2"            # Name
-       .asciz  ".?AVClass2@Namespace2@@"       # LinkageName
-       .byte   243
-       .byte   242
-       .byte   241
-       # StringId (0x100F)
-       .short  0x12                            # Record length
-       .short  0x1605                          # Record kind: LF_STRING_ID
-       .long   0x0                             # Id
-       .asciz  "/tmp/./c.h"                    # StringData
-       .byte   241
-       # UdtSourceLine (0x1010)
-       .short  0xe                             # Record length
-       .short  0x1606                          # Record kind: LF_UDT_SRC_LINE
-       .long   0x100e                          # UDT: Namespace2::Class2
-       .long   0x100f                          # SourceFile: /tmp/./c.h
-       .long   0x2                             # LineNumber
-       # MemberFuncId (0x1011)
-       .short  0x12                            # Record length
-       .short  0x1602                          # Record kind: LF_MFUNC_ID
-       .long   0x100b                          # ClassType: Namespace2::Class2
-       .long   0x100c                          # FunctionType: void Namespace2::Class2::(int)
-       .asciz  "func"                          # Name
-       .byte   243
-       .byte   242
-       .byte   241
-       # Pointer (0x1012)
-       .short  0xa                             # Record length
-       .short  0x1002                          # Record kind: LF_POINTER
-       .long   0x670                           # PointeeType: char*
-       .long   0x1000c                         # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
-       # ArgList (0x1013)
-       .short  0xe                             # Record length
-       .short  0x1201                          # Record kind: LF_ARGLIST
-       .long   0x2                             # NumArgs
-       .long   0x74                            # Argument: int
-       .long   0x1012                          # Argument: char**
-       # Procedure (0x1014)
-       .short  0xe                             # Record length
-       .short  0x1008                          # Record kind: LF_PROCEDURE
-       .long   0x74                            # ReturnType: int
-       .byte   0x0                             # CallingConvention: NearC
-       .byte   0x0                             # FunctionOptions
-       .short  0x2                             # NumParameters
-       .long   0x1013                          # ArgListType: (int, char**)
-       # FuncId (0x1015)
-       .short  0x12                            # Record length
-       .short  0x1601                          # Record kind: LF_FUNC_ID
-       .long   0x0                             # ParentScope
-       .long   0x1014                          # FunctionType: int (int, char**)
-       .asciz  "main"                          # Name
-       .byte   243
-       .byte   242
-       .byte   241
-       # Modifier (0x1016)
-       .short  0xa                             # Record length
-       .short  0x1001                          # Record kind: LF_MODIFIER
-       .long   0x74                            # ModifiedType: int
-       .short  0x2                             # Modifiers ( Volatile (0x2) )
-       .byte   242
-       .byte   241
-       # StringId (0x1017)
-       .short  0xe                             # Record length
-       .short  0x1605                          # Record kind: LF_STRING_ID
-       .long   0x0                             # Id
-       .asciz  "/tmp"                          # StringData
-       .byte   243
-       .byte   242
-       .byte   241
-       # StringId (0x1018)
-       .short  0xe                             # Record length
-       .short  0x1605                          # Record kind: LF_STRING_ID
-       .long   0x0                             # Id
-       .asciz  "a.cpp"                         # StringData
-       .byte   242
-       .byte   241
-       # BuildInfo (0x1019)
-       .short  0x1a                            # Record length
-       .short  0x1603                          # Record kind: LF_BUILDINFO
-       .short  0x5                             # NumArgs
-       .long   0x1017                          # Argument: /tmp
-       .long   0x0                             # Argument
-       .long   0x1018                          # Argument: a.cpp
-       .long   0x0                             # Argument
-       .long   0x0                             # Argument
-       .byte   242
-       .byte   241
-       .addrsig
-       .addrsig_sym "?gv_foo@?1??foo@Namespace1@@YAXH@Z@4HC"
-       .addrsig_sym "?gv_bar@?1??bar@Class1@@SAXH@Z@4HC"
-       .addrsig_sym "?gv_func@?1??func@Class2@Namespace2@@SAXH@Z@4HC"
+# Compiled from the following files, but replaced the call to abort with nop.\r
+# clang-cl -fuse-ld=lld-link /Z7 /O1 /Faa.asm /winsysroot~/win_toolchain a.cpp\r
+# a.cpp:\r
+# #include "a.h"\r
+# int main(int argc, char** argv) {\r
+#   volatile int main_local = Namespace1::foo(2);\r
+#   return 0;\r
+# }\r
+# a.h:\r
+# #include <stdlib.h>\r
+# #include "b.h"\r
+# namespace Namespace1 {\r
+# inline int foo(int x) {\r
+#   volatile int foo_local = x + 1;\r
+#   ++foo_local;\r
+#   if (!foo_local)\r
+#     abort();\r
+#   return Class1::bar(foo_local);\r
+# }\r
+# } // namespace Namespace1\r
+# b.h:\r
+# #include "c.h"\r
+# class Class1 {\r
+# public:\r
+#   inline static int bar(int x) {\r
+#     volatile int bar_local = x + 1;\r
+#     ++bar_local;\r
+#     return Namespace2::Class2::func(bar_local);\r
+#   }\r
+# };\r
+# c.h:\r
+# namespace Namespace2 {\r
+# class Class2 {\r
+# public:\r
+#   inline static int func(int x) {\r
+#     volatile int func_local = x + 1;\r
+#     func_local += x;\r
+#     return func_local;\r
+#   }\r
+# };\r
+# } // namespace Namespace2\r
+\r
+       .text\r
+       .def    @feat.00;\r
+       .scl    3;\r
+       .type   0;\r
+       .endef\r
+       .globl  @feat.00\r
+.set @feat.00, 0\r
+       .intel_syntax noprefix\r
+       .file   "a.cpp"\r
+       .def    main;\r
+       .scl    2;\r
+       .type   32;\r
+       .endef\r
+       .section        .text,"xr",one_only,main\r
+       .globl  main                            # -- Begin function main\r
+main:                                   # @main\r
+.Lfunc_begin0:\r
+       .cv_func_id 0\r
+       .cv_file        1 "/tmp/a.cpp" "4FFB96E5DF1A95CE7DB9732CFFE001D7" 1\r
+       .cv_loc 0 1 2 0                         # a.cpp:2:0\r
+.seh_proc main\r
+# %bb.0:\r
+       #DEBUG_VALUE: main:argv <- $rdx\r
+       #DEBUG_VALUE: main:argc <- $ecx\r
+       #DEBUG_VALUE: foo:x <- 2\r
+       sub     rsp, 56\r
+       .seh_stackalloc 56\r
+       .seh_endprologue\r
+.Ltmp0:\r
+       .cv_file        2 "/tmp/./a.h" "BBFED90EF093E9C1D032CC9B05B5D167" 1\r
+       .cv_inline_site_id 1 within 0 inlined_at 1 3 0\r
+       .cv_loc 1 2 5 0                         # ./a.h:5:0\r
+       mov     dword ptr [rsp + 44], 3\r
+       .cv_loc 1 2 6 0                         # ./a.h:6:0\r
+       inc     dword ptr [rsp + 44]\r
+       .cv_loc 1 2 7 0                         # ./a.h:7:0\r
+       mov     eax, dword ptr [rsp + 44]\r
+       test    eax, eax\r
+       je      .LBB0_2\r
+.Ltmp1:\r
+# %bb.1:\r
+       #DEBUG_VALUE: main:argv <- $rdx\r
+       #DEBUG_VALUE: main:argc <- $ecx\r
+       #DEBUG_VALUE: foo:x <- 2\r
+       .cv_loc 1 2 9 0                         # ./a.h:9:0\r
+       mov     eax, dword ptr [rsp + 44]\r
+.Ltmp2:\r
+       #DEBUG_VALUE: bar:x <- $eax\r
+       .cv_file        3 "/tmp/./b.h" "A26CC743A260115F33AF91AB11F95877" 1\r
+       .cv_inline_site_id 2 within 1 inlined_at 2 9 0\r
+       .cv_loc 2 3 5 0                         # ./b.h:5:0\r
+       inc     eax\r
+.Ltmp3:\r
+       mov     dword ptr [rsp + 52], eax\r
+       .cv_loc 2 3 6 0                         # ./b.h:6:0\r
+       inc     dword ptr [rsp + 52]\r
+       .cv_loc 2 3 7 0                         # ./b.h:7:0\r
+       mov     eax, dword ptr [rsp + 52]\r
+.Ltmp4:\r
+       #DEBUG_VALUE: func:x <- $eax\r
+       .cv_file        4 "/tmp/./c.h" "8AF4613F78624BBE96D1C408ABA39B2D" 1\r
+       .cv_inline_site_id 3 within 2 inlined_at 3 7 0\r
+       .cv_loc 3 4 5 0                         # ./c.h:5:0\r
+       lea     ecx, [rax + 1]\r
+.Ltmp5:\r
+       #DEBUG_VALUE: main:argc <- [DW_OP_LLVM_entry_value 1] $ecx\r
+       mov     dword ptr [rsp + 48], ecx\r
+       .cv_loc 3 4 6 0                         # ./c.h:6:0\r
+       add     dword ptr [rsp + 48], eax\r
+       .cv_loc 3 4 7 0                         # ./c.h:7:0\r
+       mov     eax, dword ptr [rsp + 48]\r
+.Ltmp6:\r
+       .cv_loc 0 1 3 0                         # a.cpp:3:0\r
+       mov     dword ptr [rsp + 48], eax\r
+       .cv_loc 0 1 4 0                         # a.cpp:4:0\r
+       xor     eax, eax\r
+       add     rsp, 56\r
+       ret\r
+.Ltmp7:\r
+.LBB0_2:\r
+       #DEBUG_VALUE: main:argv <- $rdx\r
+       #DEBUG_VALUE: main:argc <- $ecx\r
+       #DEBUG_VALUE: foo:x <- 2\r
+       .cv_loc 1 2 8 0                         # ./a.h:8:0\r
+       nop\r
+.Ltmp8:\r
+       int3\r
+.Ltmp9:\r
+       #DEBUG_VALUE: main:argc <- [DW_OP_LLVM_entry_value 1] $ecx\r
+       #DEBUG_VALUE: main:argv <- [DW_OP_LLVM_entry_value 1] $rdx\r
+.Lfunc_end0:\r
+       .seh_endproc\r
+                                        # -- End function\r
+       .section        .drectve,"yn"\r
+       .ascii  " /DEFAULTLIB:libcmt.lib"\r
+       .ascii  " /DEFAULTLIB:oldnames.lib"\r
+       .section        .debug$S,"dr"\r
+       .p2align        2\r
+       .long   4                               # Debug section magic\r
+       .long   241\r
+       .long   .Ltmp11-.Ltmp10                 # Subsection size\r
+.Ltmp10:\r
+       .short  .Ltmp13-.Ltmp12                 # Record length\r
+.Ltmp12:\r
+       .short  4353                            # Record kind: S_OBJNAME\r
+       .long   0                               # Signature\r
+       .asciz  "/tmp/a-2b2ba0.obj"             # Object name\r
+       .p2align        2\r
+.Ltmp13:\r
+       .short  .Ltmp15-.Ltmp14                 # Record length\r
+.Ltmp14:\r
+       .short  4412                            # Record kind: S_COMPILE3\r
+       .long   1                               # Flags and language\r
+       .short  208                             # CPUType\r
+       .short  15                              # Frontend version\r
+       .short  0\r
+       .short  0\r
+       .short  0\r
+       .short  15000                           # Backend version\r
+       .short  0\r
+       .short  0\r
+       .short  0\r
+       .asciz  "clang version 15.0.0"          # Null-terminated compiler version string\r
+       .p2align        2\r
+.Ltmp15:\r
+.Ltmp11:\r
+       .p2align        2\r
+       .long   246                             # Inlinee lines subsection\r
+       .long   .Ltmp17-.Ltmp16                 # Subsection size\r
+.Ltmp16:\r
+       .long   0                               # Inlinee lines signature\r
+\r
+                                        # Inlined function foo starts at ./a.h:4\r
+       .long   4099                            # Type index of inlined function\r
+       .cv_filechecksumoffset  2               # Offset into filechecksum table\r
+       .long   4                               # Starting line number\r
+\r
+                                        # Inlined function bar starts at ./b.h:4\r
+       .long   4106                            # Type index of inlined function\r
+       .cv_filechecksumoffset  3               # Offset into filechecksum table\r
+       .long   4                               # Starting line number\r
+\r
+                                        # Inlined function func starts at ./c.h:4\r
+       .long   4113                            # Type index of inlined function\r
+       .cv_filechecksumoffset  4               # Offset into filechecksum table\r
+       .long   4                               # Starting line number\r
+.Ltmp17:\r
+       .p2align        2\r
+       .section        .debug$S,"dr",associative,main\r
+       .p2align        2\r
+       .long   4                               # Debug section magic\r
+       .long   241                             # Symbol subsection for main\r
+       .long   .Ltmp19-.Ltmp18                 # Subsection size\r
+.Ltmp18:\r
+       .short  .Ltmp21-.Ltmp20                 # Record length\r
+.Ltmp20:\r
+       .short  4423                            # Record kind: S_GPROC32_ID\r
+       .long   0                               # PtrParent\r
+       .long   0                               # PtrEnd\r
+       .long   0                               # PtrNext\r
+       .long   .Lfunc_end0-main                # Code size\r
+       .long   0                               # Offset after prologue\r
+       .long   0                               # Offset before epilogue\r
+       .long   4117                            # Function type index\r
+       .secrel32       main                    # Function section relative address\r
+       .secidx main                            # Function section index\r
+       .byte   0                               # Flags\r
+       .asciz  "main"                          # Function name\r
+       .p2align        2\r
+.Ltmp21:\r
+       .short  .Ltmp23-.Ltmp22                 # Record length\r
+.Ltmp22:\r
+       .short  4114                            # Record kind: S_FRAMEPROC\r
+       .long   56                              # FrameSize\r
+       .long   0                               # Padding\r
+       .long   0                               # Offset of padding\r
+       .long   0                               # Bytes of callee saved registers\r
+       .long   0                               # Exception handler offset\r
+       .short  0                               # Exception handler section\r
+       .long   81920                           # Flags (defines frame register)\r
+       .p2align        2\r
+.Ltmp23:\r
+       .short  .Ltmp25-.Ltmp24                 # Record length\r
+.Ltmp24:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   116                             # TypeIndex\r
+       .short  1                               # Flags\r
+       .asciz  "argc"\r
+       .p2align        2\r
+.Ltmp25:\r
+       .cv_def_range    .Lfunc_begin0 .Ltmp5 .Ltmp7 .Ltmp8, reg, 18\r
+       .short  .Ltmp27-.Ltmp26                 # Record length\r
+.Ltmp26:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   4114                            # TypeIndex\r
+       .short  1                               # Flags\r
+       .asciz  "argv"\r
+       .p2align        2\r
+.Ltmp27:\r
+       .cv_def_range    .Lfunc_begin0 .Ltmp8, reg, 331\r
+       .short  .Ltmp29-.Ltmp28                 # Record length\r
+.Ltmp28:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   4118                            # TypeIndex\r
+       .short  0                               # Flags\r
+       .asciz  "main_local"\r
+       .p2align        2\r
+.Ltmp29:\r
+       .cv_def_range    .Ltmp0 .Ltmp9, frame_ptr_rel, 48\r
+       .short  .Ltmp31-.Ltmp30                 # Record length\r
+.Ltmp30:\r
+       .short  4429                            # Record kind: S_INLINESITE\r
+       .long   0                               # PtrParent\r
+       .long   0                               # PtrEnd\r
+       .long   4099                            # Inlinee type index\r
+       .cv_inline_linetable    1 2 4 .Lfunc_begin0 .Lfunc_end0\r
+       .p2align        2\r
+.Ltmp31:\r
+       .short  .Ltmp33-.Ltmp32                 # Record length\r
+.Ltmp32:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   116                             # TypeIndex\r
+       .short  257                             # Flags\r
+       .asciz  "x"\r
+       .p2align        2\r
+.Ltmp33:\r
+       .short  .Ltmp35-.Ltmp34                 # Record length\r
+.Ltmp34:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   4118                            # TypeIndex\r
+       .short  0                               # Flags\r
+       .asciz  "foo_local"\r
+       .p2align        2\r
+.Ltmp35:\r
+       .cv_def_range    .Ltmp0 .Ltmp6 .Ltmp7 .Ltmp9, frame_ptr_rel, 44\r
+       .short  .Ltmp37-.Ltmp36                 # Record length\r
+.Ltmp36:\r
+       .short  4429                            # Record kind: S_INLINESITE\r
+       .long   0                               # PtrParent\r
+       .long   0                               # PtrEnd\r
+       .long   4106                            # Inlinee type index\r
+       .cv_inline_linetable    2 3 4 .Lfunc_begin0 .Lfunc_end0\r
+       .p2align        2\r
+.Ltmp37:\r
+       .short  .Ltmp39-.Ltmp38                 # Record length\r
+.Ltmp38:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   116                             # TypeIndex\r
+       .short  1                               # Flags\r
+       .asciz  "x"\r
+       .p2align        2\r
+.Ltmp39:\r
+       .cv_def_range    .Ltmp2 .Ltmp3, reg, 17\r
+       .short  .Ltmp41-.Ltmp40                 # Record length\r
+.Ltmp40:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   4118                            # TypeIndex\r
+       .short  0                               # Flags\r
+       .asciz  "bar_local"\r
+       .p2align        2\r
+.Ltmp41:\r
+       .cv_def_range    .Ltmp2 .Ltmp6, frame_ptr_rel, 52\r
+       .short  .Ltmp43-.Ltmp42                 # Record length\r
+.Ltmp42:\r
+       .short  4429                            # Record kind: S_INLINESITE\r
+       .long   0                               # PtrParent\r
+       .long   0                               # PtrEnd\r
+       .long   4113                            # Inlinee type index\r
+       .cv_inline_linetable    3 4 4 .Lfunc_begin0 .Lfunc_end0\r
+       .p2align        2\r
+.Ltmp43:\r
+       .short  .Ltmp45-.Ltmp44                 # Record length\r
+.Ltmp44:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   116                             # TypeIndex\r
+       .short  1                               # Flags\r
+       .asciz  "x"\r
+       .p2align        2\r
+.Ltmp45:\r
+       .cv_def_range    .Ltmp4 .Ltmp6, reg, 17\r
+       .short  .Ltmp47-.Ltmp46                 # Record length\r
+.Ltmp46:\r
+       .short  4414                            # Record kind: S_LOCAL\r
+       .long   4118                            # TypeIndex\r
+       .short  0                               # Flags\r
+       .asciz  "func_local"\r
+       .p2align        2\r
+.Ltmp47:\r
+       .cv_def_range    .Ltmp4 .Ltmp6, frame_ptr_rel, 48\r
+       .short  2                               # Record length\r
+       .short  4430                            # Record kind: S_INLINESITE_END\r
+       .short  2                               # Record length\r
+       .short  4430                            # Record kind: S_INLINESITE_END\r
+       .short  2                               # Record length\r
+       .short  4430                            # Record kind: S_INLINESITE_END\r
+       .short  2                               # Record length\r
+       .short  4431                            # Record kind: S_PROC_ID_END\r
+.Ltmp19:\r
+       .p2align        2\r
+       .cv_linetable   0, main, .Lfunc_end0\r
+       .section        .debug$S,"dr"\r
+       .long   241\r
+       .long   .Ltmp49-.Ltmp48                 # Subsection size\r
+.Ltmp48:\r
+       .short  .Ltmp51-.Ltmp50                 # Record length\r
+.Ltmp50:\r
+       .short  4360                            # Record kind: S_UDT\r
+       .long   4103                            # Type\r
+       .asciz  "Class1"\r
+       .p2align        2\r
+.Ltmp51:\r
+       .short  .Ltmp53-.Ltmp52                 # Record length\r
+.Ltmp52:\r
+       .short  4360                            # Record kind: S_UDT\r
+       .long   4110                            # Type\r
+       .asciz  "Namespace2::Class2"\r
+       .p2align        2\r
+.Ltmp53:\r
+.Ltmp49:\r
+       .p2align        2\r
+       .cv_filechecksums                       # File index to string table offset subsection\r
+       .cv_stringtable                         # String table\r
+       .long   241\r
+       .long   .Ltmp55-.Ltmp54                 # Subsection size\r
+.Ltmp54:\r
+       .short  .Ltmp57-.Ltmp56                 # Record length\r
+.Ltmp56:\r
+       .short  4428                            # Record kind: S_BUILDINFO\r
+       .long   4124                            # LF_BUILDINFO index\r
+       .p2align        2\r
+.Ltmp57:\r
+.Ltmp55:\r
+       .p2align        2\r
+       .section        .debug$T,"dr"\r
+       .p2align        2\r
+       .long   4                               # Debug section magic\r
+       # StringId (0x1000)\r
+       .short  0x12                            # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .asciz  "Namespace1"                    # StringData\r
+       .byte   241\r
+       # ArgList (0x1001)\r
+       .short  0xa                             # Record length\r
+       .short  0x1201                          # Record kind: LF_ARGLIST\r
+       .long   0x1                             # NumArgs\r
+       .long   0x74                            # Argument: int\r
+       # Procedure (0x1002)\r
+       .short  0xe                             # Record length\r
+       .short  0x1008                          # Record kind: LF_PROCEDURE\r
+       .long   0x74                            # ReturnType: int\r
+       .byte   0x0                             # CallingConvention: NearC\r
+       .byte   0x0                             # FunctionOptions\r
+       .short  0x1                             # NumParameters\r
+       .long   0x1001                          # ArgListType: (int)\r
+       # FuncId (0x1003)\r
+       .short  0xe                             # Record length\r
+       .short  0x1601                          # Record kind: LF_FUNC_ID\r
+       .long   0x1000                          # ParentScope: Namespace1\r
+       .long   0x1002                          # FunctionType: int (int)\r
+       .asciz  "foo"                           # Name\r
+       # Class (0x1004)\r
+       .short  0x2a                            # Record length\r
+       .short  0x1504                          # Record kind: LF_CLASS\r
+       .short  0x0                             # MemberCount\r
+       .short  0x280                           # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )\r
+       .long   0x0                             # FieldList\r
+       .long   0x0                             # DerivedFrom\r
+       .long   0x0                             # VShape\r
+       .short  0x0                             # SizeOf\r
+       .asciz  "Class1"                        # Name\r
+       .asciz  ".?AVClass1@@"                  # LinkageName\r
+       .byte   242\r
+       .byte   241\r
+       # MemberFunction (0x1005)\r
+       .short  0x1a                            # Record length\r
+       .short  0x1009                          # Record kind: LF_MFUNCTION\r
+       .long   0x74                            # ReturnType: int\r
+       .long   0x1004                          # ClassType: Class1\r
+       .long   0x0                             # ThisType\r
+       .byte   0x0                             # CallingConvention: NearC\r
+       .byte   0x0                             # FunctionOptions\r
+       .short  0x1                             # NumParameters\r
+       .long   0x1001                          # ArgListType: (int)\r
+       .long   0x0                             # ThisAdjustment\r
+       # FieldList (0x1006)\r
+       .short  0xe                             # Record length\r
+       .short  0x1203                          # Record kind: LF_FIELDLIST\r
+       .short  0x1511                          # Member kind: OneMethod ( LF_ONEMETHOD )\r
+       .short  0xb                             # Attrs: Public, Static\r
+       .long   0x1005                          # Type: int Class1::(int)\r
+       .asciz  "bar"                           # Name\r
+       # Class (0x1007)\r
+       .short  0x2a                            # Record length\r
+       .short  0x1504                          # Record kind: LF_CLASS\r
+       .short  0x1                             # MemberCount\r
+       .short  0x200                           # Properties ( HasUniqueName (0x200) )\r
+       .long   0x1006                          # FieldList: <field list>\r
+       .long   0x0                             # DerivedFrom\r
+       .long   0x0                             # VShape\r
+       .short  0x1                             # SizeOf\r
+       .asciz  "Class1"                        # Name\r
+       .asciz  ".?AVClass1@@"                  # LinkageName\r
+       .byte   242\r
+       .byte   241\r
+       # StringId (0x1008)\r
+       .short  0x12                            # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .asciz  "/tmp/./b.h"                    # StringData\r
+       .byte   241\r
+       # UdtSourceLine (0x1009)\r
+       .short  0xe                             # Record length\r
+       .short  0x1606                          # Record kind: LF_UDT_SRC_LINE\r
+       .long   0x1007                          # UDT: Class1\r
+       .long   0x1008                          # SourceFile: /tmp/./b.h\r
+       .long   0x2                             # LineNumber\r
+       # MemberFuncId (0x100A)\r
+       .short  0xe                             # Record length\r
+       .short  0x1602                          # Record kind: LF_MFUNC_ID\r
+       .long   0x1004                          # ClassType: Class1\r
+       .long   0x1005                          # FunctionType: int Class1::(int)\r
+       .asciz  "bar"                           # Name\r
+       # Class (0x100B)\r
+       .short  0x42                            # Record length\r
+       .short  0x1504                          # Record kind: LF_CLASS\r
+       .short  0x0                             # MemberCount\r
+       .short  0x280                           # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )\r
+       .long   0x0                             # FieldList\r
+       .long   0x0                             # DerivedFrom\r
+       .long   0x0                             # VShape\r
+       .short  0x0                             # SizeOf\r
+       .asciz  "Namespace2::Class2"            # Name\r
+       .asciz  ".?AVClass2@Namespace2@@"       # LinkageName\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # MemberFunction (0x100C)\r
+       .short  0x1a                            # Record length\r
+       .short  0x1009                          # Record kind: LF_MFUNCTION\r
+       .long   0x74                            # ReturnType: int\r
+       .long   0x100b                          # ClassType: Namespace2::Class2\r
+       .long   0x0                             # ThisType\r
+       .byte   0x0                             # CallingConvention: NearC\r
+       .byte   0x0                             # FunctionOptions\r
+       .short  0x1                             # NumParameters\r
+       .long   0x1001                          # ArgListType: (int)\r
+       .long   0x0                             # ThisAdjustment\r
+       # FieldList (0x100D)\r
+       .short  0x12                            # Record length\r
+       .short  0x1203                          # Record kind: LF_FIELDLIST\r
+       .short  0x1511                          # Member kind: OneMethod ( LF_ONEMETHOD )\r
+       .short  0xb                             # Attrs: Public, Static\r
+       .long   0x100c                          # Type: int Namespace2::Class2::(int)\r
+       .asciz  "func"                          # Name\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # Class (0x100E)\r
+       .short  0x42                            # Record length\r
+       .short  0x1504                          # Record kind: LF_CLASS\r
+       .short  0x1                             # MemberCount\r
+       .short  0x200                           # Properties ( HasUniqueName (0x200) )\r
+       .long   0x100d                          # FieldList: <field list>\r
+       .long   0x0                             # DerivedFrom\r
+       .long   0x0                             # VShape\r
+       .short  0x1                             # SizeOf\r
+       .asciz  "Namespace2::Class2"            # Name\r
+       .asciz  ".?AVClass2@Namespace2@@"       # LinkageName\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # StringId (0x100F)\r
+       .short  0x12                            # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .asciz  "/tmp/./c.h"                    # StringData\r
+       .byte   241\r
+       # UdtSourceLine (0x1010)\r
+       .short  0xe                             # Record length\r
+       .short  0x1606                          # Record kind: LF_UDT_SRC_LINE\r
+       .long   0x100e                          # UDT: Namespace2::Class2\r
+       .long   0x100f                          # SourceFile: /tmp/./c.h\r
+       .long   0x2                             # LineNumber\r
+       # MemberFuncId (0x1011)\r
+       .short  0x12                            # Record length\r
+       .short  0x1602                          # Record kind: LF_MFUNC_ID\r
+       .long   0x100b                          # ClassType: Namespace2::Class2\r
+       .long   0x100c                          # FunctionType: int Namespace2::Class2::(int)\r
+       .asciz  "func"                          # Name\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # Pointer (0x1012)\r
+       .short  0xa                             # Record length\r
+       .short  0x1002                          # Record kind: LF_POINTER\r
+       .long   0x670                           # PointeeType: char*\r
+       .long   0x1000c                         # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]\r
+       # ArgList (0x1013)\r
+       .short  0xe                             # Record length\r
+       .short  0x1201                          # Record kind: LF_ARGLIST\r
+       .long   0x2                             # NumArgs\r
+       .long   0x74                            # Argument: int\r
+       .long   0x1012                          # Argument: char**\r
+       # Procedure (0x1014)\r
+       .short  0xe                             # Record length\r
+       .short  0x1008                          # Record kind: LF_PROCEDURE\r
+       .long   0x74                            # ReturnType: int\r
+       .byte   0x0                             # CallingConvention: NearC\r
+       .byte   0x0                             # FunctionOptions\r
+       .short  0x2                             # NumParameters\r
+       .long   0x1013                          # ArgListType: (int, char**)\r
+       # FuncId (0x1015)\r
+       .short  0x12                            # Record length\r
+       .short  0x1601                          # Record kind: LF_FUNC_ID\r
+       .long   0x0                             # ParentScope\r
+       .long   0x1014                          # FunctionType: int (int, char**)\r
+       .asciz  "main"                          # Name\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # Modifier (0x1016)\r
+       .short  0xa                             # Record length\r
+       .short  0x1001                          # Record kind: LF_MODIFIER\r
+       .long   0x74                            # ModifiedType: int\r
+       .short  0x2                             # Modifiers ( Volatile (0x2) )\r
+       .byte   242\r
+       .byte   241\r
+       # StringId (0x1017)\r
+       .short  0xe                             # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .asciz  "/tmp"                          # StringData\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # StringId (0x1018)\r
+       .short  0xe                             # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .asciz  "a.cpp"                         # StringData\r
+       .byte   242\r
+       .byte   241\r
+       # StringId (0x1019)\r
+       .short  0xa                             # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .byte   0                               # StringData\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # StringId (0x101A)\r
+       .short  0x4e                            # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .asciz  "/usr/local/google/home/zequanwu/llvm-project/build/release/bin/clang" # StringData\r
+       .byte   243\r
+       .byte   242\r
+       .byte   241\r
+       # StringId (0x101B)\r
+       .short  0x9f6                           # Record length\r
+       .short  0x1605                          # Record kind: LF_STRING_ID\r
+       .long   0x0                             # Id\r
+       .asciz  "\"-cc1\" \"-triple\" \"x86_64-pc-windows-msvc19.20.0\" \"-S\" \"-disable-free\" \"-clear-ast-before-backend\" \"-disable-llvm-verifier\" \"-discard-value-names\" \"-mrelocation-model\" \"pic\" \"-pic-level\" \"2\" \"-mframe-pointer=none\" \"-relaxed-aliasing\" \"-fmath-errno\" \"-ffp-contract=on\" \"-fno-rounding-math\" \"-mconstructor-aliases\" \"-funwind-tables=2\" \"-target-cpu\" \"x86-64\" \"-mllvm\" \"-x86-asm-syntax=intel\" \"-tune-cpu\" \"generic\" \"-mllvm\" \"-treat-scalable-fixed-error-as-warning\" \"-D_MT\" \"-flto-visibility-public-std\" \"--dependent-lib=libcmt\" \"--dependent-lib=oldnames\" \"-stack-protector\" \"2\" \"-fms-volatile\" \"-fdiagnostics-format\" \"msvc\" \"-gno-column-info\" \"-gcodeview\" \"-debug-info-kind=constructor\" \"-ffunction-sections\" \"-fcoverage-compilation-dir=/tmp\" \"-resource-dir\" \"/usr/local/google/home/zequanwu/llvm-project/build/release/lib/clang/15.0.0\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/llvm-project/build/release/lib/clang/15.0.0/include\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/DIA SDK/include\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/VC/Tools/MSVC/14.26.28801/include\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/VC/Tools/MSVC/14.26.28801/atlmfc/include\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/ucrt\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/shared\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/um\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/winrt\" \"-internal-isystem\" \"/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/cppwinrt\" \"-Os\" \"-fdeprecated-macro\" \"-fdebug-compilation-dir=/tmp\" \"-ferror-limit\" \"19\" \"-fno-use-cxa-atexit\" \"-fms-extensions\" \"-fms-compatibility\" \"-fms-compatibility-version=19.20\" \"-std=c++14\" \"-fdelayed-template-parsing\" \"-fcolor-diagnostics\" \"-vectorize-loops\" \"-vectorize-slp\" \"-faddrsig\" \"-x\" \"c++\"" # StringData\r
+       .byte   242\r
+       .byte   241\r
+       # BuildInfo (0x101C)\r
+       .short  0x1a                            # Record length\r
+       .short  0x1603                          # Record kind: LF_BUILDINFO\r
+       .short  0x5                             # NumArgs\r
+       .long   0x1017                          # Argument: /tmp\r
+       .long   0x101a                          # Argument: /usr/local/google/home/zequanwu/llvm-project/build/release/bin/clang\r
+       .long   0x1018                          # Argument: a.cpp\r
+       .long   0x1019                          # Argument\r
+       .long   0x101b                          # Argument: "-cc1" "-triple" "x86_64-pc-windows-msvc19.20.0" "-S" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=none" "-relaxed-aliasing" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-mllvm" "-x86-asm-syntax=intel" "-tune-cpu" "generic" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-D_MT" "-flto-visibility-public-std" "--dependent-lib=libcmt" "--dependent-lib=oldnames" "-stack-protector" "2" "-fms-volatile" "-fdiagnostics-format" "msvc" "-gno-column-info" "-gcodeview" "-debug-info-kind=constructor" "-ffunction-sections" "-fcoverage-compilation-dir=/tmp" "-resource-dir" "/usr/local/google/home/zequanwu/llvm-project/build/release/lib/clang/15.0.0" "-internal-isystem" "/usr/local/google/home/zequanwu/llvm-project/build/release/lib/clang/15.0.0/include" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/DIA SDK/include" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/VC/Tools/MSVC/14.26.28801/include" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/VC/Tools/MSVC/14.26.28801/atlmfc/include" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/ucrt" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/shared" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/um" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/winrt" "-internal-isystem" "/usr/local/google/home/zequanwu/chromium/src/third_party/depot_tools/win_toolchain/vs_files/3bda71a11e/Windows Kits/10/Include/10.0.19041.0/cppwinrt" "-Os" "-fdeprecated-macro" "-fdebug-compilation-dir=/tmp" "-ferror-limit" "19" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.20" "-std=c++14" "-fdelayed-template-parsing" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-faddrsig" "-x" "c++"\r
+       .byte   242\r
+       .byte   241\r
+       .addrsig\r
diff --git a/lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites_live.lldbinit b/lldb/test/Shell/SymbolFile/NativePDB/Inputs/inline_sites_live.lldbinit
new file mode 100644 (file)
index 0000000..584d835
--- /dev/null
@@ -0,0 +1,7 @@
+br set -p BP_bar -f inline_sites_live.cpp\r
+br set -p BP_foo -f inline_sites_live.cpp\r
+run\r
+p param\r
+continue\r
+p param\r
+p local\r
diff --git a/lldb/test/Shell/SymbolFile/NativePDB/inline_sites.test b/lldb/test/Shell/SymbolFile/NativePDB/inline_sites.test
new file mode 100644 (file)
index 0000000..65e292e
--- /dev/null
@@ -0,0 +1,160 @@
+# clang-format off
+# REQUIRES: lld
+
+# RUN: llvm-mc -triple=x86_64-windows-msvc --filetype=obj %p/Inputs/inline_sites.s > %t.obj
+# RUN: lld-link -debug:full -nodefaultlib -entry:main -base:0x140000000 %t.obj -out:%t.exe
+# RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
+# RUN:     %p/Inputs/inline_sites.lldbinit 2>&1 | FileCheck %s
+
+# CHECK:      (lldb) image dump line-table a.cpp -v
+# CHECK-NEXT: Line table
+# CHECK-NEXT: 0x0000000140001000: /tmp/a.cpp:2
+# CHECK-NEXT: 0x0000000140001004: /tmp/a.h:5, is_start_of_statement = TRUE, is_prologue_end = TRUE
+# CHECK-NEXT: 0x000000014000100c: /tmp/a.h:6
+# CHECK-NEXT: 0x0000000140001010: /tmp/a.h:7
+# CHECK-NEXT: 0x0000000140001018: /tmp/a.h:9
+# CHECK-NEXT: 0x000000014000101c: /tmp/b.h:5, is_start_of_statement = TRUE, is_prologue_end = TRUE
+# CHECK-NEXT: 0x0000000140001022: /tmp/b.h:6
+# CHECK-NEXT: 0x0000000140001026: /tmp/b.h:7
+# CHECK-NEXT: 0x000000014000102a: /tmp/c.h:5, is_start_of_statement = TRUE, is_prologue_end = TRUE
+# CHECK-NEXT: 0x0000000140001031: /tmp/c.h:6
+# CHECK-NEXT: 0x0000000140001035: /tmp/c.h:7
+# CHECK-NEXT: 0x0000000140001039: /tmp/a.cpp:3
+# CHECK-NEXT: 0x000000014000103d: /tmp/a.cpp:4
+# CHECK-NEXT: 0x0000000140001044: /tmp/a.h:8, is_start_of_statement = TRUE
+# CHECK-NEXT: 0x0000000140001046: /tmp/a.cpp:4, is_terminal_entry = TRUE
+
+#CHECK: (lldb) b a.h:5
+#CHECK: Breakpoint 1: where = {{.*}}`main + 4 [inlined] Namespace1::foo at a.h:5, address = 0x0000000140001004
+#CHECK: (lldb) b a.h:6
+#CHECK: Breakpoint 2: where = {{.*}}`main + 12 [inlined] Namespace1::foo + 8 at a.h:6, address = 0x000000014000100c
+#CHECK: (lldb) b a.h:7
+#CHECK: Breakpoint 3: where = {{.*}}`main + 16 [inlined] Namespace1::foo + 12 at a.h:7, address = 0x0000000140001010
+#CHECK: (lldb) b a.h:8
+#CHECK: Breakpoint 4: where = {{.*}}`main + 68 [inlined] Namespace1::foo at a.h:8, address = 0x0000000140001044
+#CHECK: (lldb) b a.h:9
+#CHECK: Breakpoint 5: where = {{.*}}`main + 24 [inlined] Namespace1::foo + 20 at a.h:9, address = 0x0000000140001018
+#CHECK: (lldb) b b.h:5
+#CHECK: Breakpoint 6: where = {{.*}}`main + 28 [inlined] Class1::bar at b.h:5, address = 0x000000014000101c
+#CHECK: (lldb) b b.h:6
+#CHECK: Breakpoint 7: where = {{.*}}`main + 34 [inlined] Class1::bar + 6 at b.h:6, address = 0x0000000140001022
+#CHECK: (lldb) b b.h:7
+#CHECK: Breakpoint 8: where = {{.*}}`main + 38 [inlined] Class1::bar + 10 at b.h:7, address = 0x0000000140001026
+#CHECK: (lldb) b c.h:5
+#CHECK: Breakpoint 9: where = {{.*}}`main + 42 [inlined] Namespace2::Class2::func at c.h:5, address = 0x000000014000102a
+#CHECK: (lldb) b c.h:6
+#CHECK: Breakpoint 10: where = {{.*}}`main + 49 [inlined] Namespace2::Class2::func + 7 at c.h:6, address = 0x0000000140001031
+#CHECK: (lldb) b c.h:7
+#CHECK: Breakpoint 11: where = {{.*}}`main + 53 [inlined] Namespace2::Class2::func + 11 at c.h:7, address = 0x0000000140001035
+#CHECK: (lldb) b a.cpp:3
+#CHECK: Breakpoint 12: where = {{.*}}`main + 57 at a.cpp:3, address = 0x0000000140001039
+#CHECK: (lldb) b a.cpp:4
+#CHECK: Breakpoint 13: where = {{.*}}`main + 61 at a.cpp:4, address = 0x000000014000103d
+#CHECK: (lldb) b a.h:8
+#CHECK: Breakpoint 14: where = {{.*}}`main + 68 [inlined] Namespace1::foo at a.h:8, address = 0x0000000140001044
+
+# CEHCK-LABEL: (lldb) image lookup -a 0x140001003 -v
+# CHECK:       Summary: {{.*}}`main + 3 at a.cpp:2
+# CHECK:       Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x0000000140001046)
+# CHECK:       Blocks: id = {{.*}}, range = [0x140001000-0x140001046)
+# CHECK:       LineEntry: [0x0000000140001000-0x0000000140001004): /tmp/a.cpp:2
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argc", type = "int", valid ranges = [0x0000000140001000-0x000000014000102d)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argv", type = "char **", valid ranges = [0x0000000140001000-0x0000000140001045)
+
+# CEHCK-LABEL: (lldb) image lookup -a 0x140001004 -v
+# CHECK:       Summary: {{.*}}`main + 4 [inlined] Namespace1::foo at a.h:5
+# CHECK-NEXT:           {{.*}}`main + 4 at a.cpp:3
+# CHECK:       Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x0000000140001046)
+# CHECK:         Blocks: id = {{.*}}, range = [0x140001000-0x140001046)
+# CHECK-NEXT:            id = {{.*}}, ranges = [0x140001004-0x140001039)[0x140001044-0x140001046), name = "Namespace1::foo", decl = a.h:4
+# CHECK:       LineEntry: [0x0000000140001004-0x000000014000100c): /tmp/a.h:5
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "foo_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argc", type = "int", valid ranges = [0x0000000140001000-0x000000014000102d)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argv", type = "char **", valid ranges = [0x0000000140001000-0x0000000140001045)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "main_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001046)
+
+# CEHCK-LABEL: (lldb) image lookup -a 0x140001010 -v
+# CHECK:       Summary: {{.*}}`main + 16 [inlined] Namespace1::foo + 12 at a.h:7
+# CHECK-NEXT:           {{.*}}`main + 4 at a.cpp:3
+# CHECK:       Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x0000000140001046)
+# CHECK:         Blocks: id = {{.*}}, range = [0x140001000-0x140001046)
+# CHECK-NEXT:            id = {{.*}}, ranges = [0x140001004-0x140001039)[0x140001044-0x140001046), name = "Namespace1::foo", decl = a.h:4
+# CHECK:       LineEntry: [0x0000000140001010-0x0000000140001018): /tmp/a.h:7
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "foo_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argc", type = "int", valid ranges = [0x0000000140001000-0x000000014000102d)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argv", type = "char **", valid ranges = [0x0000000140001000-0x0000000140001045)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "main_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001046)
+
+# CEHCK-LABEL: (lldb) image lookup -a 0x14000101c -v
+# CHECK:       Summary: {{.*}}`main + 28 [inlined] Class1::bar at b.h:5
+# CHECK-NEXT:           {{.*}}`main + 28 [inlined] Namespace1::foo + 24 at a.h:9
+# CHECK-NEXT:           {{.*}}`main + 4 at a.cpp:3
+# CHECK:       Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x0000000140001046)
+# CHECK:         Blocks: id = {{.*}}, range = [0x140001000-0x140001046)
+# CHECK-NEXT:            id = {{.*}}, ranges = [0x140001004-0x140001039)[0x140001044-0x140001046), name = "Namespace1::foo", decl = a.h:4
+# CHECK-NEXT:            id = {{.*}}, range = [0x14000101c-0x140001039), name = "Class1::bar", decl = b.h:4
+# CHECK:       LineEntry: [0x000000014000101c-0x0000000140001022): /tmp/b.h:5
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "x", type = "int", valid ranges = [0x000000014000101c-0x000000014000101e)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "bar_local", type = "int", valid ranges = [0x000000014000101c-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "foo_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argc", type = "int", valid ranges = [0x0000000140001000-0x000000014000102d)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argv", type = "char **", valid ranges = [0x0000000140001000-0x0000000140001045)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "main_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001046)
+
+# CEHCK-LABEL: (lldb) image lookup -a 0x14000102a -v
+# CHECK:       Summary: {{.*}}`main + 42 [inlined] Namespace2::Class2::func at c.h:5
+# CHECK-NEXT:           {{.*}}`main + 42 [inlined] Class1::bar + 14 at b.h:7
+# CHECK-NEXT:           {{.*}}`main + 28 [inlined] Namespace1::foo + 24 at a.h:9
+# CHECK-NEXT:           {{.*}}`main + 4 at a.cpp:3
+# CHECK:       Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x0000000140001046)
+# CHECK:         Blocks: id = {{.*}}, range = [0x140001000-0x140001046)
+# CHECK-NEXT:            id = {{.*}}, ranges = [0x140001004-0x140001039)[0x140001044-0x140001046), name = "Namespace1::foo", decl = a.h:4
+# CHECK-NEXT:            id = {{.*}}, range = [0x14000101c-0x140001039), name = "Class1::bar", decl = b.h:4
+# CHECK-NEXT:            id = {{.*}}, range = [0x14000102a-0x140001039), name = "Namespace2::Class2::func", decl = c.h:4
+# CHECK:       LineEntry: [0x000000014000102a-0x0000000140001031): /tmp/c.h:5
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "x", type = "int", valid ranges = [0x000000014000102a-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "func_local", type = "int", valid ranges = [0x000000014000102a-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "bar_local", type = "int", valid ranges = [0x000000014000101c-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "foo_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001039)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argc", type = "int", valid ranges = [0x0000000140001000-0x000000014000102d)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argv", type = "char **", valid ranges = [0x0000000140001000-0x0000000140001045)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "main_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001046)
+
+# CEHCK-LABEL: (lldb) image lookup -a 0x140001039 -v
+# CHECK:       Summary: {{.*}}`main + 57 at a.cpp:3
+# CHECK:       Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x0000000140001046)
+# CHECK:         Blocks: id = {{.*}}, range = [0x140001000-0x140001046)
+# CHECK:       LineEntry: [0x0000000140001039-0x000000014000103d): /tmp/a.cpp:3
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argv", type = "char **", valid ranges = [0x0000000140001000-0x0000000140001045)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "main_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001046)
+
+# CEHCK-LABEL: (lldb) image lookup -a 0x140001044 -v
+# CHECK:       Summary: {{.*}}`main + 68 [inlined] Namespace1::foo at a.h:8
+# CHECK-NEXT:           {{.*}}`main + 68 at a.cpp:3
+# CHECK:       Function: id = {{.*}}, name = "main", range = [0x0000000140001000-0x0000000140001046)
+# CHECK:         Blocks: id = {{.*}}, range = [0x140001000-0x140001046)
+# CHECK-NEXT:            id = {{.*}}, ranges = [0x140001004-0x140001039)[0x140001044-0x140001046), name = "Namespace1::foo", decl = a.h:4
+# CHECK:       LineEntry: [0x0000000140001044-0x0000000140001046): /tmp/a.h:8
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "foo_local", type = "int", valid ranges = [0x0000000140001044-0x0000000140001046)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argc", type = "int", valid ranges = [0x0000000140001044-0x0000000140001045)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "argv", type = "char **", valid ranges = [0x0000000140001000-0x0000000140001045)
+# CHECK-NEXT:  Variable: id = {{.*}}, name = "main_local", type = "int", valid ranges = [0x0000000140001004-0x0000000140001046)
+
+# CHECK-LABEL: (lldb) target modules dump ast
+# CHECK-NEXT:  Dumping clang ast for 1 modules.
+# CHECK-NEXT:  TranslationUnitDecl {{.*}} <undeserialized declarations>
+# CHECK-NEXT:  |-FunctionDecl {{.*}} main 'int (int, char **)'
+# CHECK-NEXT:  | |-ParmVarDecl {{.*}} argc 'int'
+# CHECK-NEXT:  | `-ParmVarDecl {{.*}} argv 'char **'
+# CHECK-NEXT:  |-NamespaceDecl {{.*}} Namespace1
+# CHECK-NEXT:  | `-FunctionDecl {{.*}} foo 'int (int)' inline
+# CHECK-NEXT:  |   `-ParmVarDecl {{.*}} x 'int'
+# CHECK-NEXT:  |-CXXRecordDecl {{.*}} <undeserialized declarations> class Class1
+# CHECK-NEXT:  | |-AccessSpecDecl {{.*}} public
+# CHECK-NEXT:  | `-CXXMethodDecl {{.*}} bar 'int (int)' static
+# CHECK-NEXT:  |   `-ParmVarDecl {{.*}} 'int'
+# CHECK-NEXT:  `-NamespaceDecl {{.*}} Namespace2
+# CHECK-NEXT:    `-CXXRecordDecl {{.*}} <undeserialized declarations> class Class2
+# CHECK-NEXT:      |-AccessSpecDecl {{.*}} public
+# CHECK-NEXT:      `-CXXMethodDecl {{.*}} func 'int (int)' static
+# CHECK-NEXT:        `-ParmVarDecl {{.*}} 'int'
diff --git a/lldb/test/Shell/SymbolFile/NativePDB/inline_sites_live.cpp b/lldb/test/Shell/SymbolFile/NativePDB/inline_sites_live.cpp
new file mode 100644 (file)
index 0000000..bd3f80a
--- /dev/null
@@ -0,0 +1,34 @@
+// clang-format off\r
+// REQUIRES: system-windows\r
+\r
+// RUN: %build -o %t.exe -- %s\r
+// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \\r
+// RUN:     %p/Inputs/inline_sites_live.lldbinit 2>&1 | FileCheck %s\r
+\r
+void use(int) {}\r
+\r
+void __attribute__((always_inline)) bar(int param) {\r
+  use(param); // BP_bar\r
+}\r
+\r
+void __attribute__((always_inline)) foo(int param) {\r
+  int local = param+1;\r
+  bar(local);\r
+  use(param);\r
+  use(local); // BP_foo\r
+}\r
+\r
+int main(int argc, char** argv) {\r
+  foo(argc);\r
+}\r
+\r
+// CHECK:      * thread #1, stop reason = breakpoint 1\r
+// CHECK-NEXT:    frame #0: {{.*}}`main [inlined] bar(param=2)\r
+// CHECK:      (lldb) p param\r
+// CHECK-NEXT: (int) $0 = 2\r
+// CHECK:      * thread #1, stop reason = breakpoint 2\r
+// CHECK-NEXT:    frame #0: {{.*}}`main [inlined] foo(param=1)\r
+// CHECK:      (lldb) p param\r
+// CHECK-NEXT: (int) $1 = 1\r
+// CHECK-NEXT: (lldb) p local\r
+// CHECK-NEXT: (int) $2 = 2\r
index 3cf5e0a..68b23d4 100644 (file)
@@ -157,6 +157,7 @@ int main(int argc, char **argv) {
 // CHECK-NEXT: | |-ParmVarDecl {{.*}} argc 'int'
 // CHECK-NEXT: | `-ParmVarDecl {{.*}} argv 'char **'
 // CHECK-NEXT: |-FunctionDecl {{.*}} __scrt_common_main_seh 'int ()' static 
+// CHECK-NEXT: |-FunctionDecl {{.*}} invoke_main 'int ()' inline
 // CHECK-NEXT: `-FunctionDecl {{.*}} Function 'int (int, char)'
 // CHECK-NEXT:   |-ParmVarDecl {{.*}} Param1 'int'
 // CHECK-NEXT:   `-ParmVarDecl {{.*}} Param2 'char'