| 126 | } |
| 127 | |
| 128 | DisassembleWindow::DisassembleWindow(QWidget *parent, DisassembleWidget* widget) |
| 129 | : QTreeWidget(parent) |
| 130 | { |
| 131 | /*context menu commands */{ |
| 132 | m_selectAddrAction = new QAction(i18nc("@action", "Change &Address"), this); |
| 133 | m_selectAddrAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); |
| 134 | connect(m_selectAddrAction, &QAction::triggered, widget, &DisassembleWidget::slotChangeAddress); |
| 135 | |
| 136 | m_jumpToLocation = new QAction(QIcon::fromTheme(QStringLiteral("debug-execute-to-cursor")), i18nc("@action", "&Jump to Cursor"), this); |
| 137 | m_jumpToLocation->setWhatsThis(i18nc("@info:whatsthis", "Sets the execution pointer to the current cursor position.")); |
| 138 | connect(m_jumpToLocation,&QAction::triggered, widget, &DisassembleWidget::jumpToCursor); |
| 139 | |
| 140 | m_runUntilCursor = new QAction(QIcon::fromTheme(QStringLiteral("debug-run-cursor")), i18nc("@action", "&Run to Cursor"), this); |
| 141 | m_runUntilCursor->setWhatsThis(i18nc("@info:whatsthis", "Continues execution until the cursor position is reached.")); |
| 142 | connect(m_runUntilCursor,&QAction::triggered, widget, &DisassembleWidget::runToCursor); |
| 143 | |
| 144 | m_disassemblyFlavorAtt = new QAction(i18nc("@option:check", "&AT&&T"), this); |
| 145 | m_disassemblyFlavorAtt->setToolTip(i18nc("@info:tooltip", "GDB will use the AT&T disassembly flavor (e.g. mov 0xc(%ebp),%eax).")); |
| 146 | m_disassemblyFlavorAtt->setData(DisassemblyFlavorATT); |
| 147 | m_disassemblyFlavorAtt->setCheckable(true); |
| 148 | |
| 149 | m_disassemblyFlavorIntel = new QAction(i18nc("@option:check", "&Intel"), this); |
| 150 | m_disassemblyFlavorIntel->setToolTip(i18nc("@info:tooltip", "GDB will use the Intel disassembly flavor (e.g. mov eax, DWORD PTR [ebp+0xc]).")); |
| 151 | m_disassemblyFlavorIntel->setData(DisassemblyFlavorIntel); |
| 152 | m_disassemblyFlavorIntel->setCheckable(true); |
| 153 | |
| 154 | m_disassemblyFlavorActionGroup = new QActionGroup(this); |
| 155 | m_disassemblyFlavorActionGroup->setExclusive(true); |
| 156 | m_disassemblyFlavorActionGroup->addAction(m_disassemblyFlavorAtt); |
| 157 | m_disassemblyFlavorActionGroup->addAction(m_disassemblyFlavorIntel); |
| 158 | connect(m_disassemblyFlavorActionGroup, &QActionGroup::triggered, widget, &DisassembleWidget::setDisassemblyFlavor); |
| 159 | |
| 160 | connect(this, &QTreeWidget::itemSelectionChanged, this, [this] { |
| 161 | // On the off chance that our context menu is currently visible, prevent accidentally wrong behavior: |
| 162 | // disable actions that depend on selected items because their effect changes along with the selection. |
| 163 | m_selectAddrAction->setEnabled(false); |
| 164 | m_jumpToLocation->setEnabled(false); |
| 165 | m_runUntilCursor->setEnabled(false); |
| 166 | }); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | QString DisassembleWindow::selectedAddress() const |
| 171 | { |
nothing calls this directly
no test coverage detected