MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / ExecuteAction

Function ExecuteAction

mainthread.cpp:54–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54static void ExecuteAction(void* ctxt)
55{
56 MainThreadActionContext* action = (MainThreadActionContext*)ctxt;
57
58 // We can't throw across a thread and *certainly* not across the api boundary
59 // But how do we deal with exceptions thrown in main thread callbacks if the caller doesn't wait for them?
60 // Likely the only good solution is abort()
61 try
62 {
63 action->action();
64 }
65 catch (const std::exception& e)
66 {
67 LogError("Exception in main thread handler: %s", e.what());
68 fprintf(stderr, "Exception in main thread handler: %s\n", e.what());
69 abort();
70 }
71 catch (...)
72 {
73 LogError("Exception in main thread handler: <unknown exception>");
74 fprintf(stderr, "Exception in main thread handler: <unknown exception>\n");
75 abort();
76 }
77 delete action;
78}
79
80
81Ref<MainThreadAction> BinaryNinja::ExecuteOnMainThread(const function<void()>& action)

Callers

nothing calls this directly

Calls 2

actionMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected