The last commit unconditionally enabled disassembling from the start of
the text section. On a sample binary (/bin/true) this resulted in a
BasicBlock with a size of several TiB which won't terminate properly.
Function* getFunction(uint64_t address);
BasicBlock* getBasicBlock(uint64_t address);
+ bool hasFunctions() const {return functions.size() != 0;}
/* Protocoll:
*
disassembleFunctionAt(_entryAddress, s.str());
}
- uint64_t text_entry;
- text_section.getAddress(text_entry);
- LOG4CXX_INFO(logger, "No Symbols found, starting at the beginning of the text segment");
- disassembleFunctionAt(text_entry);
+ if (!manager->hasFunctions()) {
+ uint64_t text_entry;
+ text_section.getAddress(text_entry);
+ LOG4CXX_INFO(logger, "No Symbols found, starting at the beginning of the text segment");
+ disassembleFunctionAt(text_entry);
+ }
}
template <typename ELFT>