mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[sim] Output more error details on extension load failure (#2680)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#define DLOPEN(a) LoadLibraryA(a)
|
||||
#define DLSYM GetProcAddress
|
||||
#define DLCLOSE FreeLibrary
|
||||
#define DLERROR "error #" << GetLastError()
|
||||
#else
|
||||
#define DELIM ':'
|
||||
#define HTYPE void*
|
||||
@@ -33,6 +34,7 @@
|
||||
#define DLOPEN(a) dlopen(a, RTLD_LAZY)
|
||||
#define DLSYM dlsym
|
||||
#define DLCLOSE dlclose
|
||||
#define DLERROR dlerror()
|
||||
#endif
|
||||
|
||||
namespace hal {
|
||||
@@ -63,14 +65,16 @@ int HAL_LoadOneExtension(const char* library) {
|
||||
#else
|
||||
libraryName += ".so";
|
||||
#endif
|
||||
wpi::outs() << "HAL Extensions: Trying modified name: "
|
||||
wpi::outs() << "HAL Extensions: Load failed: " << DLERROR
|
||||
<< "\nTrying modified name: "
|
||||
<< wpi::sys::path::stem(libraryName) << "\n";
|
||||
wpi::outs().flush();
|
||||
handle = DLOPEN(libraryName.c_str());
|
||||
}
|
||||
#endif
|
||||
if (!handle) {
|
||||
wpi::outs() << "HAL Extensions: Failed to load library\n";
|
||||
wpi::outs() << "HAL Extensions: Failed to load library: " << DLERROR
|
||||
<< '\n';
|
||||
wpi::outs().flush();
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user