| 2544 | } |
| 2545 | |
| 2546 | void MainWindow::contextConsole(const QPoint &posa) { |
| 2547 | bool ok = true; |
| 2548 | |
| 2549 | QPoint globalp = ui->console->mapToGlobal(posa); |
| 2550 | QTextCursor cursor = ui->console->cursorForPosition(posa); |
| 2551 | ui->console->setTextCursor(cursor); |
| 2552 | cursor.select(QTextCursor::WordUnderCursor); |
| 2553 | |
| 2554 | QString equ = getAddressOfEquate(cursor.selectedText().toUpper().toStdString()); |
| 2555 | uint32_t address; |
| 2556 | |
| 2557 | if (!equ.isEmpty()) { |
| 2558 | address = static_cast<uint32_t>(hex2int(equ)); |
| 2559 | } else { |
| 2560 | address = cursor.selectedText().toUInt(&ok, 16); |
| 2561 | } |
| 2562 | |
| 2563 | if (ok) { |
| 2564 | ui->console->setTextCursor(cursor); |
| 2565 | |
| 2566 | QMenu menu; |
| 2567 | QAction *gotoMem = gotoMemAction(&menu); |
| 2568 | QAction *gotoDisasm = gotoDisasmAction(&menu); |
| 2569 | menu.addSeparator(); |
| 2570 | QAction *toggleBreak = menu.addAction(ACTION_TOGGLE_BREAK); |
| 2571 | QAction *toggleRead = menu.addAction(ACTION_TOGGLE_READ); |
| 2572 | QAction *toggleWrite = menu.addAction(ACTION_TOGGLE_WRITE); |
| 2573 | QAction *toggleRw = menu.addAction(ACTION_TOGGLE_RW); |
| 2574 | |
| 2575 | QAction *item = menu.exec(globalp); |
| 2576 | if (item) { |
| 2577 | if (item == gotoMem) { |
| 2578 | debugForce(); |
| 2579 | gotoMemAddr(address); |
| 2580 | } else if (item == gotoDisasm) { |
| 2581 | debugForce(); |
| 2582 | gotoDisasmAddr(address); |
| 2583 | } else if (item == toggleBreak) { |
| 2584 | breakAdd(breakNextLabel(), address, true, true, false); |
| 2585 | } else if (item == toggleRead) { |
| 2586 | watchAdd(watchNextLabel(), address, address, DBG_MASK_READ, true, false); |
| 2587 | } else if (item == toggleWrite) { |
| 2588 | watchAdd(watchNextLabel(), address, address, DBG_MASK_WRITE, true, false); |
| 2589 | } else if (item == toggleRw) { |
| 2590 | watchAdd(watchNextLabel(), address, address, DBG_MASK_READ | DBG_MASK_WRITE, true, false); |
| 2591 | } |
| 2592 | memDocksUpdate(); |
| 2593 | } |
| 2594 | } |
| 2595 | } |
| 2596 | |
| 2597 | // ------------------------------------------------ |
| 2598 | // GUI IPC things |
nothing calls this directly
no test coverage detected