MCPcopy Create free account
hub / github.com/Vector35/debugger / paste

Method paste

ui/registerswidget.cpp:631–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629
630
631void DebugRegistersWidget::paste()
632{
633 QModelIndexList sel = selectionModel()->selectedIndexes();
634 if (sel.empty())
635 return;
636
637 if (sel[0].column() != DebugRegistersListModel::ValueColumn)
638 return;
639
640 auto sourceIndex = m_filter->mapToSource(sel[0]);
641 if (!sourceIndex.isValid())
642 return;
643
644 auto reg = m_model->getRow(sourceIndex.row());
645
646 QClipboard* clipboard = QGuiApplication::clipboard();
647 auto text = clipboard->text();
648
649 uint64_t newValue = 0;
650 std::string errorString;
651 if (!BinaryView::ParseExpression(
652 m_controller->GetLiveView(), text.toStdString(), newValue, reg.value(), errorString))
653 return;
654
655 if (newValue == reg.value())
656 return;
657
658 if (!m_controller->SetRegisterValue(reg.name(), newValue))
659 return;
660}
661
662
663bool DebugRegistersWidget::selectionNotEmpty()

Callers

nothing calls this directly

Calls 6

rowMethod · 0.80
getRowMethod · 0.45
GetLiveViewMethod · 0.45
valueMethod · 0.45
SetRegisterValueMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected