| 1528 | |
| 1529 | |
| 1530 | DebuggerUI* DebuggerUI::CreateForViewFrame(ViewFrame* frame) |
| 1531 | { |
| 1532 | if (!frame) |
| 1533 | return nullptr; |
| 1534 | |
| 1535 | UIContext* context = UIContext::contextForWidget(frame); |
| 1536 | BinaryViewRef data = frame->getCurrentBinaryView(); |
| 1537 | if (!data) |
| 1538 | return nullptr; |
| 1539 | |
| 1540 | auto controller = DebuggerController::GetController(data); |
| 1541 | if (!controller) |
| 1542 | return nullptr; |
| 1543 | |
| 1544 | if (g_viewFrameMap.find(frame) != g_viewFrameMap.end()) |
| 1545 | { |
| 1546 | return g_viewFrameMap[frame].get(); |
| 1547 | } |
| 1548 | g_viewFrameMap.try_emplace(frame, std::make_unique<DebuggerUI>(context, controller)); |
| 1549 | connect(frame, &QObject::destroyed, [&](QObject* obj) { |
| 1550 | auto* vf = (ViewFrame*)obj; |
| 1551 | g_viewFrameMap.erase(vf); |
| 1552 | }); |
| 1553 | return g_viewFrameMap[frame].get(); |
| 1554 | } |
| 1555 | |
| 1556 | |
| 1557 | DebuggerUI* DebuggerUI::GetForViewFrame(ViewFrame* frame) |
nothing calls this directly
no outgoing calls
no test coverage detected