summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b702753)
When BasicBlocks appear in multiple functions, we ran into the situation
where a unfinished basicblock is included in a different function and
causing bad loops as it's end address wasn't set yet
template <typename ELFT>
void LLVMDisassembler<ELFT>::disassembleFunction(Function* function) {
template <typename ELFT>
void LLVMDisassembler<ELFT>::disassembleFunction(Function* function) {
+ std::vector<uint64_t> called_functions;
std::stack<BasicBlock*> remaining_blocks;
/* TODO:
* Do all blocks get added properly? We should take care to remove
std::stack<BasicBlock*> remaining_blocks;
/* TODO:
* Do all blocks get added properly? We should take care to remove
if (!MIA->isIndirectBranch(inst)) {
if (MIA->isCall(inst)) {
if (NULL == manager->getFunction(jmptarget))
if (!MIA->isIndirectBranch(inst)) {
if (MIA->isCall(inst)) {
if (NULL == manager->getFunction(jmptarget))
- disassembleFunctionAt(jmptarget);
+ called_functions.push_back(jmptarget);
} else {
current_block->setNextBlock(0, jmptarget);
if (new_blocks.find(jmptarget) == new_blocks.end()) {
} else {
current_block->setNextBlock(0, jmptarget);
if (new_blocks.find(jmptarget) == new_blocks.end()) {
splitBlocks(function);
LOG4CXX_DEBUG(logger, "Finished function " << function->getName());
manager->finishFunction(function);
splitBlocks(function);
LOG4CXX_DEBUG(logger, "Finished function " << function->getName());
manager->finishFunction(function);
+ for (uint64_t address : called_functions)
+ disassembleFunctionAt(address);
}
template <typename ELFT>
}
template <typename ELFT>