diff --git a/src/apps/debugger/dwarf/BaseUnit.cpp b/src/apps/debugger/dwarf/BaseUnit.cpp index f0bb2da8cb..76c561061b 100644 --- a/src/apps/debugger/dwarf/BaseUnit.cpp +++ b/src/apps/debugger/dwarf/BaseUnit.cpp @@ -53,6 +53,13 @@ BaseUnit::AddDebugInfoEntry(DebugInfoEntry* entry, off_t offset) } +bool +BaseUnit::ContainsAbsoluteOffset(off_t offset) const +{ + return fHeaderOffset <= offset && fHeaderOffset + fTotalSize > offset; +} + + void BaseUnit::SetSourceLanguage(const SourceLanguageInfo* language) { diff --git a/src/apps/debugger/dwarf/BaseUnit.h b/src/apps/debugger/dwarf/BaseUnit.h index 985573d4be..0f8e77be4f 100644 --- a/src/apps/debugger/dwarf/BaseUnit.h +++ b/src/apps/debugger/dwarf/BaseUnit.h @@ -45,6 +45,8 @@ public: off_t AbbreviationOffset() const { return fAbbreviationOffset; } + bool ContainsAbsoluteOffset(off_t offset) const; + uint8 AddressSize() const { return fAddressSize; } bool IsDwarf64() const { return fIsDwarf64; }