From 42f95002355c4dc730d13302a84bdfe404a9bb6a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 27 Apr 2016 02:17:15 +0200 Subject: [PATCH] Debugger: CoreFile: read symbol and string table addresses --- src/apps/debugger/elf/CoreFile.cpp | 12 ++++++++++-- src/apps/debugger/elf/CoreFile.h | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/apps/debugger/elf/CoreFile.cpp b/src/apps/debugger/elf/CoreFile.cpp index 4f77ea3459e..1c6ec43494a 100644 --- a/src/apps/debugger/elf/CoreFile.cpp +++ b/src/apps/debugger/elf/CoreFile.cpp @@ -66,7 +66,8 @@ CoreFileAreaInfo::CoreFileAreaInfo(ElfSegment* segment, int32 id, CoreFileImageInfo::CoreFileImageInfo(int32 id, int32 type, uint64 initRoutine, uint64 termRoutine, uint64 textBase, uint64 textSize, uint64 dataBase, - uint64 dataSize, int32 deviceId, int64 nodeId, CoreFileAreaInfo* textArea, + uint64 dataSize, int32 deviceId, int64 nodeId, uint64 symbolTable, + uint64 symbolHash, uint64 stringTable, CoreFileAreaInfo* textArea, CoreFileAreaInfo* dataArea, const BString& name) : fId(id), @@ -79,6 +80,9 @@ CoreFileImageInfo::CoreFileImageInfo(int32 id, int32 type, uint64 initRoutine, fDataSize(dataSize), fDeviceId(deviceId), fNodeId(nodeId), + fSymbolTable(symbolTable), + fSymbolHash(symbolHash), + fStringTable(stringTable), fTextArea(textArea), fDataArea(dataArea), fName(name) @@ -479,6 +483,9 @@ CoreFile::_ReadImagesNote(const void* data, uint32 dataSize) uint64 dataSize = Get(entry.ni_data_size); int32 deviceId = Get(entry.ni_device); int64 nodeId = Get(entry.ni_node); + uint64 symbolTable = Get(entry.ni_symbol_table); + uint64 symbolHash = Get(entry.ni_symbol_hash); + uint64 stringTable = Get(entry.ni_string_table); // get name if (stringsSize == 0) { @@ -500,7 +507,8 @@ CoreFile::_ReadImagesNote(const void* data, uint32 dataSize) CoreFileAreaInfo* dataArea = _FindArea(dataBase); CoreFileImageInfo* image = new(std::nothrow) CoreFileImageInfo(id, type, initRoutine, termRoutine, textBase, textSize, dataBase, dataSize, - deviceId, nodeId, textArea, dataArea, copiedName); + deviceId, nodeId, symbolTable, symbolHash, stringTable, textArea, + dataArea, copiedName); if (image == NULL || !fImageInfos.AddItem(image)) { delete image; return B_NO_MEMORY; diff --git a/src/apps/debugger/elf/CoreFile.h b/src/apps/debugger/elf/CoreFile.h index 0cb067c53a9..5cf14d0ed6a 100644 --- a/src/apps/debugger/elf/CoreFile.h +++ b/src/apps/debugger/elf/CoreFile.h @@ -60,6 +60,8 @@ struct CoreFileImageInfo { uint64 textBase, uint64 textSize, uint64 dataBase, uint64 dataSize, int32 deviceId, int64 nodeId, + uint64 symbolTable, uint64 symbolHash, + uint64 stringTable, CoreFileAreaInfo* textArea, CoreFileAreaInfo* dataArea, const BString& name); @@ -70,6 +72,9 @@ struct CoreFileImageInfo { uint64 TextSize() const { return fTextSize; } uint64 DataBase() const { return fDataBase; } uint64 DataSize() const { return fDataSize; } + uint64 SymbolTable() const { return fSymbolTable; } + uint64 SymbolHash() const { return fSymbolHash; } + uint64 StringTable() const { return fStringTable; } const BString& Name() const { return fName; } private: @@ -83,6 +88,9 @@ struct CoreFileImageInfo { uint64 fDataSize; int32 fDeviceId; int64 fNodeId; + uint64 fSymbolTable; + uint64 fSymbolHash; + uint64 fStringTable; CoreFileAreaInfo* fTextArea; CoreFileAreaInfo* fDataArea; BString fName;