Logging improvements
authorChristoph Egger <christoph@christoph-egger.org>
Sat, 10 Jan 2015 16:45:14 +0000 (17:45 +0100)
committerChristoph Egger <christoph@christoph-egger.org>
Sat, 10 Jan 2015 16:45:14 +0000 (17:45 +0100)
src/disassembler/llvm/LLVMDisassembler.cxx

index c44c60c83e779f5114556c8562f10f838877b634..6a25e9abad87e756a9d77c77876f72be90aa96fc 100644 (file)
@@ -209,6 +209,9 @@ void LLVMDisassembler::disassembleFunction(LLVMFunction* function) {
                                                                blocks.insert(std::make_pair(block->getStartAddress(), block));
                                                                function->addBasicBlock(block);
                                                                remaining_blocks.push(block);
+                                                       } else {
+                                                               LOG4CXX_DEBUG(logger, "Reusing Block starting at " << std::hex << current_block->getStartAddress());
+                                                               function->addBasicBlock(blocks.find(jmptarget)->second);
                                                        }
                                                        if (MIA->isConditionalBranch(inst)) {
                                                                jmptarget = base_address + current_address + inst_size;
@@ -218,6 +221,9 @@ void LLVMDisassembler::disassembleFunction(LLVMFunction* function) {
                                                                        blocks.insert(std::make_pair(block->getStartAddress(), block));
                                                                        function->addBasicBlock(block);
                                                                        remaining_blocks.push(block);
+                                                               } else {
+                                                                       LOG4CXX_DEBUG(logger, "Reusing Block starting at " << std::hex << current_block->getStartAddress());
+                                                                       function->addBasicBlock(blocks.find(jmptarget)->second);
                                                                }
                                                        }
                                                }