]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/Mainwindow.cxx
Name Blocks according to start *and* end address
[frida/frida.git] / src / gui / Mainwindow.cxx
index 5e47b25871227bc791e9354021f49d2e5d0a7466..745fd3ed7c0dfb9f4d10046724a34f7d9b0597a6 100644 (file)
@@ -72,12 +72,18 @@ namespace {
        void local__add_basic_block(BasicBlock * block, Disassembler * dis, QGraphicsScene * scene,
                                                                uint64_t starty, uint64_t startx) {
                std::stringstream s;
-               s << "BLOCK_" << std::hex << block->getStartAddress();
+               s << "BLOCK_" << std::hex << block->getStartAddress()
+                 << "_" << block->getEndAddress();
                BasicBlockWidget * widget = new BasicBlockWidget(s.str().c_str());
                scene->addItem(widget);
                widget->setFlag(QGraphicsItem::ItemIsMovable, true);
                widget->moveBy(100*startx, 10*(block->getStartAddress() - starty));
 
+               dis->printEachInstruction(block->getStartAddress(), block->getEndAddress(),
+                                                                 [&](uint8_t* bytes, size_t byte_count, const std::string& line) {
+                                                                         widget->addItem(bytes, byte_count, line.c_str() + 1);
+                                                                 });
+
                if (block->getNextBlock(0) != 0)
                        local__add_basic_block(dis->getBasicBlock(block->getNextBlock(0)), dis, scene, starty, startx+1);
                if (block->getNextBlock(1) != 0)