Skip to content

Commit

Permalink
Debugger: CoreFile: read symbol and string table addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
weinhold committed Apr 27, 2016
1 parent 5cde7a8 commit 42f9500
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/apps/debugger/elf/CoreFile.cpp
Expand Up @@ -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),
Expand All @@ -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)
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions src/apps/debugger/elf/CoreFile.h
Expand Up @@ -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);
Expand All @@ -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:
Expand All @@ -83,6 +88,9 @@ struct CoreFileImageInfo {
uint64 fDataSize;
int32 fDeviceId;
int64 fNodeId;
uint64 fSymbolTable;
uint64 fSymbolHash;
uint64 fStringTable;
CoreFileAreaInfo* fTextArea;
CoreFileAreaInfo* fDataArea;
BString fName;
Expand Down

0 comments on commit 42f9500

Please sign in to comment.