From 7105c3f66d7a70c401c2061b14aad58cf07896b3 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 10 Jan 2025 19:12:22 -0500 Subject: [PATCH] Debugger Kit: Rename "TextDelta" to "LoadDelta". It's both the offset of the first TEXT segment as well as the overall load address, so we should call it that for clarity. Change-Id: I370e14054e9b4f8f88a6ce6c80e0a743f9f14d64 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8820 Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/kits/debug/SymbolLookup.cpp | 6 +++--- src/kits/debugger/elf/ElfSymbolLookup.cpp | 14 +++++++------- src/kits/debugger/elf/ElfSymbolLookup.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/kits/debug/SymbolLookup.cpp b/src/kits/debug/SymbolLookup.cpp index d741b11eb3..5715a14d8e 100644 --- a/src/kits/debug/SymbolLookup.cpp +++ b/src/kits/debug/SymbolLookup.cpp @@ -213,7 +213,7 @@ private: SymbolLookup* fSymbolLookup; const image_t* fImage; int32 fSymbolCount; - size_t fTextDelta; + size_t fLoadDelta; }; @@ -567,7 +567,7 @@ SymbolLookup::LoadedImage::LoadedImage(SymbolLookup* symbolLookup, fSymbolLookup(symbolLookup), fImage(image), fSymbolCount(symbolCount), - fTextDelta(image->regions[0].delta) + fLoadDelta(image->regions[0].delta) { // init info fInfo.id = fImage->id; @@ -686,7 +686,7 @@ SymbolLookup::LoadedImage::NextSymbol(int32& iterator, const char** _symbolName, *_symbolName = (const char*)fSymbolLookup->PrepareAddressNoThrow( SYMNAME(fImage, symbol), 1); *_symbolNameLen = fSymbolLookup->_SymbolNameLen(*_symbolName); - *_symbolAddress = symbol->st_value + fTextDelta; + *_symbolAddress = symbol->st_value + fLoadDelta; *_symbolSize = symbol->st_size; *_symbolType = symbol->Type() == STT_FUNC ? B_SYMBOL_TYPE_TEXT : B_SYMBOL_TYPE_DATA; diff --git a/src/kits/debugger/elf/ElfSymbolLookup.cpp b/src/kits/debugger/elf/ElfSymbolLookup.cpp index 1d1474b95d..a20e0aeec5 100644 --- a/src/kits/debugger/elf/ElfSymbolLookup.cpp +++ b/src/kits/debugger/elf/ElfSymbolLookup.cpp @@ -137,7 +137,7 @@ public: ElfSymbolLookupImpl(ElfSymbolLookupSource* source, uint64 symbolTable, uint64 symbolHash, uint64 stringTable, uint32 symbolCount, - uint32 symbolTableEntrySize, uint64 textDelta, bool swappedByteOrder) + uint32 symbolTableEntrySize, uint64 loadDelta, bool swappedByteOrder) : fSource(NULL), fSymbolTable(symbolTable), @@ -145,7 +145,7 @@ public: fStringTable(stringTable), fSymbolCount(symbolCount), fSymbolTableEntrySize(symbolTableEntrySize), - fTextDelta(textDelta), + fLoadDelta(loadDelta), fSwappedByteOrder(swappedByteOrder) { SetSource(source); @@ -233,7 +233,7 @@ public: } // get the values - target_addr_t address = Get(symbol.st_value) + fTextDelta; + target_addr_t address = Get(symbol.st_value) + fLoadDelta; target_size_t size = Get(symbol.st_size); uint32 type = symbol.Type() == STT_FUNC ? B_SYMBOL_TYPE_TEXT : B_SYMBOL_TYPE_DATA; @@ -309,7 +309,7 @@ private: uint64 fStringTable; uint32 fSymbolCount; uint32 fSymbolTableEntrySize; - uint64 fTextDelta; + uint64 fLoadDelta; bool fSwappedByteOrder; }; @@ -325,7 +325,7 @@ ElfSymbolLookup::~ElfSymbolLookup() /*static*/ status_t ElfSymbolLookup::Create(ElfSymbolLookupSource* source, uint64 symbolTable, uint64 symbolHash, uint64 stringTable, uint32 symbolCount, - uint32 symbolTableEntrySize, uint64 textDelta, bool is64Bit, + uint32 symbolTableEntrySize, uint64 loadDelta, bool is64Bit, bool swappedByteOrder, bool cacheSource, ElfSymbolLookup*& _lookup) { // create @@ -333,11 +333,11 @@ ElfSymbolLookup::Create(ElfSymbolLookupSource* source, uint64 symbolTable, if (is64Bit) { lookup = new(std::nothrow) ElfSymbolLookupImpl(source, symbolTable, symbolHash, stringTable, symbolCount, - symbolTableEntrySize, textDelta, swappedByteOrder); + symbolTableEntrySize, loadDelta, swappedByteOrder); } else { lookup = new(std::nothrow) ElfSymbolLookupImpl(source, symbolTable, symbolHash, stringTable, symbolCount, - symbolTableEntrySize, textDelta, swappedByteOrder); + symbolTableEntrySize, loadDelta, swappedByteOrder); } if (lookup == NULL) diff --git a/src/kits/debugger/elf/ElfSymbolLookup.h b/src/kits/debugger/elf/ElfSymbolLookup.h index b06d571ff5..57277735cb 100644 --- a/src/kits/debugger/elf/ElfSymbolLookup.h +++ b/src/kits/debugger/elf/ElfSymbolLookup.h @@ -30,7 +30,7 @@ public: uint64 symbolTable, uint64 symbolHash, uint64 stringTable, uint32 symbolCount, uint32 symbolTableEntrySize, - uint64 textDelta, bool is64Bit, + uint64 loadDelta, bool is64Bit, bool swappedByteOrder, bool cacheSource, ElfSymbolLookup*& _lookup);