aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/DIContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo/DIContext.h')
-rw-r--r--include/llvm/DebugInfo/DIContext.h46
1 files changed, 32 insertions, 14 deletions
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h
index 85e96402a246..d2a5318179eb 100644
--- a/include/llvm/DebugInfo/DIContext.h
+++ b/include/llvm/DebugInfo/DIContext.h
@@ -1,9 +1,8 @@
//===- DIContext.h ----------------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -98,11 +97,10 @@ public:
void addFrame(const DILineInfo &Frame) {
Frames.push_back(Frame);
}
-
+
void resize(unsigned i) {
Frames.resize(i);
}
-
};
/// Container for description of a global variable.
@@ -114,6 +112,16 @@ struct DIGlobal {
DIGlobal() : Name("<invalid>") {}
};
+struct DILocal {
+ std::string FunctionName;
+ std::string Name;
+ std::string DeclFile;
+ uint64_t DeclLine = 0;
+ Optional<int64_t> FrameOffset;
+ Optional<uint64_t> Size;
+ Optional<uint64_t> TagOffset;
+};
+
/// A DINameKind is passed to name search methods to specify a
/// preference regarding the type of name resolution the caller wants.
enum class DINameKind { None, ShortName, LinkageName };
@@ -158,7 +166,8 @@ enum DIDumpType : unsigned {
/// dumped.
struct DIDumpOptions {
unsigned DumpType = DIDT_All;
- unsigned RecurseDepth = -1U;
+ unsigned ChildRecurseDepth = -1U;
+ unsigned ParentRecurseDepth = -1U;
uint16_t Version = 0; // DWARF version to assume when extracting.
uint8_t AddrSize = 4; // Address byte size to assume when extracting.
bool ShowAddresses = true;
@@ -172,15 +181,18 @@ struct DIDumpOptions {
/// Return default option set for printing a single DIE without children.
static DIDumpOptions getForSingleDIE() {
DIDumpOptions Opts;
- Opts.RecurseDepth = 0;
+ Opts.ChildRecurseDepth = 0;
+ Opts.ParentRecurseDepth = 0;
return Opts;
}
/// Return the options with RecurseDepth set to 0 unless explicitly required.
DIDumpOptions noImplicitRecursion() const {
DIDumpOptions Opts = *this;
- if (RecurseDepth == -1U && !ShowChildren)
- Opts.RecurseDepth = 0;
+ if (ChildRecurseDepth == -1U && !ShowChildren)
+ Opts.ChildRecurseDepth = 0;
+ if (ParentRecurseDepth == -1U && !ShowParents)
+ Opts.ParentRecurseDepth = 0;
return Opts;
}
};
@@ -204,12 +216,18 @@ public:
return true;
}
- virtual DILineInfo getLineInfoForAddress(uint64_t Address,
+ virtual DILineInfo getLineInfoForAddress(
+ object::SectionedAddress Address,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
- virtual DILineInfoTable getLineInfoForAddressRange(uint64_t Address,
- uint64_t Size, DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
- virtual DIInliningInfo getInliningInfoForAddress(uint64_t Address,
+ virtual DILineInfoTable getLineInfoForAddressRange(
+ object::SectionedAddress Address, uint64_t Size,
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
+ virtual DIInliningInfo getInliningInfoForAddress(
+ object::SectionedAddress Address,
+ DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0;
+
+ virtual std::vector<DILocal>
+ getLocalsForAddress(object::SectionedAddress Address) = 0;
private:
const DIContextKind Kind;