diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-09-04 08:12:33 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-09-04 08:12:33 +0000 |
commit | 5eae90d727c64ca5b4b43b110521b38dcd9f0de6 (patch) | |
tree | b932b5a23ada1047a06817c055c1e97a469f39a9 /include/llvm/DebugInfo | |
parent | 2d5c28da0d14883cd0cd6fcf38d7e28040b634c0 (diff) | |
download | external_llvm-5eae90d727c64ca5b4b43b110521b38dcd9f0de6.zip external_llvm-5eae90d727c64ca5b4b43b110521b38dcd9f0de6.tar.gz external_llvm-5eae90d727c64ca5b4b43b110521b38dcd9f0de6.tar.bz2 |
Add support for fetching inlining context (stack of source code locations)
by instruction address from DWARF.
Add --inlining flag to llvm-dwarfdump to demonstrate and test this functionality,
so that "llvm-dwarfdump --inlining --address=0x..." now works much like
"addr2line -i 0x...", provided that the binary has debug info
(Clang's -gline-tables-only *is* enough).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DebugInfo')
-rw-r--r-- | include/llvm/DebugInfo/DIContext.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h index d859b39..8d6054a 100644 --- a/include/llvm/DebugInfo/DIContext.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -15,6 +15,7 @@ #ifndef LLVM_DEBUGINFO_DICONTEXT_H #define LLVM_DEBUGINFO_DICONTEXT_H +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" @@ -54,6 +55,23 @@ public: } }; +/// DIInliningInfo - a format-neutral container for inlined code description. +class DIInliningInfo { + SmallVector<DILineInfo, 4> Frames; + public: + DIInliningInfo() {} + DILineInfo getFrame(unsigned Index) const { + assert(Index < Frames.size()); + return Frames[Index]; + } + uint32_t getNumberOfFrames() const { + return Frames.size(); + } + void addFrame(const DILineInfo &Frame) { + Frames.push_back(Frame); + } +}; + /// DILineInfoSpecifier - controls which fields of DILineInfo container /// should be filled with data. class DILineInfoSpecifier { @@ -86,8 +104,10 @@ public: virtual void dump(raw_ostream &OS) = 0; - virtual DILineInfo getLineInfoForAddress(uint64_t address, - DILineInfoSpecifier specifier = DILineInfoSpecifier()) = 0; + virtual DILineInfo getLineInfoForAddress(uint64_t Address, + DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0; + virtual DIInliningInfo getInliningInfoForAddress(uint64_t Address, + DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0; }; } |