| 66 | |
| 67 | |
| 68 | DebugAdapter* LldbAdapterType::Create(BinaryNinja::BinaryView* data) |
| 69 | { |
| 70 | #ifdef WIN32 |
| 71 | // Since we have applied delay load on liblldb.dll, we must explicitly specify the directory the liblldb.dll is in |
| 72 | // and load it by ourselves. This is because the delay load only search for the directory that the binaryninja.exe |
| 73 | // is in, and it does not search for the directory where the user/default plugin is in, which is exactly where |
| 74 | // the liblldb.dll is located. |
| 75 | // As a note, the reason for us to apply delay load on liblldb.dll is that if we load it early, it will also load |
| 76 | // the system's default dbgeng dlls, which does not work for our dbgeng adapter. |
| 77 | if (getenv("BN_STANDALONE_DEBUGGER") != nullptr) |
| 78 | SetDllDirectoryA(GetUserPluginDirectory().c_str()); |
| 79 | else |
| 80 | SetDllDirectoryA(GetBundledPluginDirectory().c_str()); |
| 81 | |
| 82 | auto module = LoadLibraryA("liblldb.dll"); |
| 83 | if (module == NULL) |
| 84 | throw std::runtime_error("fail to load liblldb"); |
| 85 | #endif |
| 86 | |
| 87 | // TODO: someone should free this. |
| 88 | return new LldbAdapter(data); |
| 89 | } |
| 90 | |
| 91 | |
| 92 | bool LldbAdapterType::IsValidForData(BinaryNinja::BinaryView* data) |
nothing calls this directly
no outgoing calls
no test coverage detected