void CPUDisassembly::mouseDoubleClickEvent(QMouseEvent* event) { if(event->button() != Qt::LeftButton) return; switch(getColumnIndexFromX(event->x())) { case 0: //address { int_t mSelectedVa = rvaToVa(getInitialSelection()); if(mRvaDisplayEnabled && mSelectedVa == mRvaDisplayBase) mRvaDisplayEnabled = false; else { mRvaDisplayEnabled = true; mRvaDisplayBase = mSelectedVa; mRvaDisplayPageBase = getBase(); } reloadData(); } break; case 1: //opcodes { toggleInt3BPAction(); //toggle INT3 breakpoint } break; case 2: //disassembly { assembleAt(); } break; case 3: //comments { setComment(); } break; default: Disassembly::mouseDoubleClickEvent(event); break; } }
void CallStackView::setupContextMenu() { mMenuBuilder = new MenuBuilder(this, [](QMenu*) { return DbgIsDebugging(); }); QIcon icon = DIcon(ArchValue("processor32.png", "processor64.png")); mMenuBuilder->addAction(makeAction(icon, tr("Follow &Address"), SLOT(followAddress()))); QAction* mFollowTo = mMenuBuilder->addAction(makeAction(icon, tr("Follow &To"), SLOT(followTo()))); mFollowTo->setShortcutContext(Qt::WidgetShortcut); mFollowTo->setShortcut(QKeySequence("enter")); connect(this, SIGNAL(enterPressedSignal()), this, SLOT(followTo())); mMenuBuilder->addAction(makeAction(icon, tr("Follow &From"), SLOT(followFrom())), [this](QMenu*) { return !getCellContent(getInitialSelection(), 2).isEmpty(); }); MenuBuilder* mCopyMenu = new MenuBuilder(this); setupCopyMenu(mCopyMenu); // Column count cannot be zero mMenuBuilder->addSeparator(); mMenuBuilder->addMenu(makeMenu(DIcon("copy.png"), tr("&Copy")), mCopyMenu); mMenuBuilder->loadFromConfig(); }
void CallStackView::followFrom() { QString addrText = getCellContent(getInitialSelection(), 2); DbgCmdExecDirect(QString("disasm " + addrText).toUtf8().constData()); }
void CallStackView::followAddress() { QString addrText = getCellContent(getInitialSelection(), 0); DbgCmdExecDirect(QString("sdump " + addrText).toUtf8().constData()); }