mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
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
This commit is contained in:
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user