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

Method SetCurrentBinaryView

ui/debugadapterscriptingprovider.cpp:58–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57
58void DebugAdapterScriptingInstance::SetCurrentBinaryView(BinaryNinja::BinaryView* view)
59{
60 if (m_data.operator!=(view))
61 {
62 m_data = view;
63 if (m_data)
64 {
65 if (m_controller)
66 m_controller->RemoveEventCallback(m_debuggerEventCallback);
67
68 m_controller = DebuggerController::GetController(view);
69 if (m_controller)
70 {
71 m_debuggerEventCallback = m_controller->RegisterEventCallback(
72 [&](const DebuggerEvent& event) {
73 if (event.type == BackendMessageEventType)
74 {
75 const std::string message = event.data.messageData.message;
76 Output(message);
77 }
78 },
79 "Debugger Console");
80 }
81 }
82 else
83 {
84 if (m_controller)
85 {
86 m_controller->RemoveEventCallback(m_debuggerEventCallback);
87 m_controller = nullptr;
88 m_debuggerEventCallback = -1;
89 }
90 }
91 }
92
93 BNScriptingProviderInputReadyState newReadyStatus = NotReadyForInput;
94 if (m_data && m_controller)
95 newReadyStatus = ReadyForScriptExecution;
96 else
97 newReadyStatus = NotReadyForInput;
98
99 if (newReadyStatus != m_readyStatus)
100 {
101 m_readyStatus = newReadyStatus;
102 InputReadyStateChanged(m_readyStatus);
103 }
104}
105
106
107BNScriptingProviderExecuteResult DebugAdapterScriptingInstance::ExecuteScriptInput(const std::string& input)

Callers

nothing calls this directly

Calls 3

operator!=Method · 0.45
RemoveEventCallbackMethod · 0.45
RegisterEventCallbackMethod · 0.45

Tested by

no test coverage detected