mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 19:49:36 +00:00
Rename one of the getOffset methods.
It is sufficiently different in that it returns an offset in the input file, not the output section. llvm-svn: 297290
This commit is contained in:
parent
373c182a07
commit
35ae65ee2b
@ -107,7 +107,7 @@ std::string elf::ObjectFile<ELFT>::getLineInfo(InputSectionBase *S,
|
||||
// section. See comments for ObjectInfo class.
|
||||
DILineInfo Info;
|
||||
Tbl->getFileLineInfoForAddress(
|
||||
S->getOffset() + Offset, nullptr,
|
||||
S->getOffsetInFile() + Offset, nullptr,
|
||||
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info);
|
||||
if (Info.Line == 0)
|
||||
return "";
|
||||
|
@ -93,7 +93,7 @@ size_t InputSectionBase::getSize() const {
|
||||
return Data.size();
|
||||
}
|
||||
|
||||
uint64_t InputSectionBase::getOffset() const {
|
||||
uint64_t InputSectionBase::getOffsetInFile() const {
|
||||
const uint8_t *FileStart = (const uint8_t *)File->MB.getBufferStart();
|
||||
const uint8_t *SecStart = Data.begin();
|
||||
return SecStart - FileStart;
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
uint32_t Link;
|
||||
uint32_t Info;
|
||||
|
||||
uint64_t getOffset() const;
|
||||
uint64_t getOffsetInFile() const;
|
||||
|
||||
static InputSectionBase Discarded;
|
||||
|
||||
|
@ -1733,7 +1733,8 @@ static InputSectionBase *findSection(ArrayRef<InputSectionBase *> Arr,
|
||||
uint64_t Offset) {
|
||||
for (InputSectionBase *S : Arr)
|
||||
if (S && S != &InputSection::Discarded)
|
||||
if (Offset >= S->getOffset() && Offset < S->getOffset() + S->getSize())
|
||||
if (Offset >= S->getOffsetInFile() &&
|
||||
Offset < S->getOffsetInFile() + S->getSize())
|
||||
return S;
|
||||
return nullptr;
|
||||
}
|
||||
@ -1752,8 +1753,8 @@ readAddressArea(DWARFContext &Dwarf, InputSection *Sec, size_t CurrentCU) {
|
||||
|
||||
for (std::pair<uint64_t, uint64_t> &R : Ranges)
|
||||
if (InputSectionBase *S = findSection<ELFT>(Sections, R.first))
|
||||
Ret.push_back({S, R.first - S->getOffset(), R.second - S->getOffset(),
|
||||
CurrentCU});
|
||||
Ret.push_back({S, R.first - S->getOffsetInFile(),
|
||||
R.second - S->getOffsetInFile(), CurrentCU});
|
||||
++CurrentCU;
|
||||
}
|
||||
return Ret;
|
||||
|
Loading…
Reference in New Issue
Block a user