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

Method CreateForViewFrame

ui/ui.cpp:1530–1554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1528
1529
1530DebuggerUI* 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
1557DebuggerUI* DebuggerUI::GetForViewFrame(ViewFrame* frame)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected