mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: POSIX.C : debug printing
This commit is contained in:
@ -1074,18 +1074,33 @@ int Foam::system(const std::string& command)
|
|||||||
|
|
||||||
void* Foam::dlOpen(const fileName& lib)
|
void* Foam::dlOpen(const fileName& lib)
|
||||||
{
|
{
|
||||||
|
if (POSIX::debug)
|
||||||
|
{
|
||||||
|
Info<< "dlOpen(const fileName&)"
|
||||||
|
<< " : dlopen of " << lib << endl;
|
||||||
|
}
|
||||||
return ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
return ::dlopen(lib.c_str(), RTLD_LAZY|RTLD_GLOBAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::dlClose(void* handle)
|
bool Foam::dlClose(void* handle)
|
||||||
{
|
{
|
||||||
|
if (POSIX::debug)
|
||||||
|
{
|
||||||
|
Info<< "dlClose(void*)"
|
||||||
|
<< " : dlclose" << endl;
|
||||||
|
}
|
||||||
return ::dlclose(handle) == 0;
|
return ::dlclose(handle) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void* Foam::dlSym(void* handle, const std::string& symbol)
|
void* Foam::dlSym(void* handle, const std::string& symbol)
|
||||||
{
|
{
|
||||||
|
if (POSIX::debug)
|
||||||
|
{
|
||||||
|
Info<< "dlSym(void*, const std::string&)"
|
||||||
|
<< " : dlsym of " << symbol << endl;
|
||||||
|
}
|
||||||
// clear any old errors - see manpage dlopen
|
// clear any old errors - see manpage dlopen
|
||||||
(void) ::dlerror();
|
(void) ::dlerror();
|
||||||
|
|
||||||
@ -1110,6 +1125,12 @@ bool Foam::dlSymFound(void* handle, const std::string& symbol)
|
|||||||
{
|
{
|
||||||
if (handle && !symbol.empty())
|
if (handle && !symbol.empty())
|
||||||
{
|
{
|
||||||
|
if (POSIX::debug)
|
||||||
|
{
|
||||||
|
Info<< "dlSymFound(void*, const std::string&)"
|
||||||
|
<< " : dlsym of " << symbol << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// clear any old errors - see manpage dlopen
|
// clear any old errors - see manpage dlopen
|
||||||
(void) ::dlerror();
|
(void) ::dlerror();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user