From cb4e14fde0ee90cf5986f2a15b95acb98b04045c Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Wed, 14 Jan 2015 17:51:01 +0100 Subject: [PATCH] implement entryAddress() at least silences warning and is not (really) more work than eliminating the function --- src/disassembler/llvm/LLVMDisassembler.cxx | 13 ++++++------- src/disassembler/llvm/LLVMDisassembler.hxx | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/disassembler/llvm/LLVMDisassembler.cxx b/src/disassembler/llvm/LLVMDisassembler.cxx index 1f92ab0..7d4da01 100644 --- a/src/disassembler/llvm/LLVMDisassembler.cxx +++ b/src/disassembler/llvm/LLVMDisassembler.cxx @@ -316,20 +316,19 @@ void LLVMDisassembler::disassemble() { if (binary->isELF()) { bool is64bit = (binary->getData()[4] == 0x02); - uint64_t entry(0); for (int i(0); i < (is64bit? 8 : 4); ++i) { if (binary->isLittleEndian()) { - entry |= (unsigned int)((unsigned char)binary->getData()[0x18 + i]) << 8*i; + _entryAddress |= (unsigned int)((unsigned char)binary->getData()[0x18 + i]) << 8*i; } else { - entry = entry << 8; - entry |= (unsigned char)binary->getData()[0x18 + i]; + _entryAddress = _entryAddress << 8; + _entryAddress |= (unsigned char)binary->getData()[0x18 + i]; } } - LOG4CXX_DEBUG(logger, "Adding entry at: " << std::hex << entry); + LOG4CXX_DEBUG(logger, "Adding entryAddress at: " << std::hex << _entryAddress); std::stringstream s; - s << "<_start 0x" << std::hex << entry << ">"; + s << "<_start 0x" << std::hex << _entryAddress << ">"; - disassembleFunctionAt(entry, s.str()); + disassembleFunctionAt(_entryAddress, s.str()); } if (functions.empty()) { diff --git a/src/disassembler/llvm/LLVMDisassembler.hxx b/src/disassembler/llvm/LLVMDisassembler.hxx index 5c54f39..9063181 100644 --- a/src/disassembler/llvm/LLVMDisassembler.hxx +++ b/src/disassembler/llvm/LLVMDisassembler.hxx @@ -25,7 +25,7 @@ public: void start(); void getSymbols() {} - uint64_t entryAddress() {} + uint64_t entryAddress() {return _entryAddress;} void forEachFunction(std::function callback); void printEachInstruction(uint64_t start, uint64_t end, @@ -76,6 +76,7 @@ private: std::map sections; std::map symbols; InformationManager * manager; + uint64_t _entryAddress; }; #endif -- 2.39.5