From 6c52aacc57f185d65debde3c9e4c96f50b6f0829 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 8 Mar 2011 10:55:13 +0000 Subject: [PATCH] ENH: POSIX.C : debug printing --- src/OSspecific/POSIX/POSIX.C | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index e6e54c32c0..c31c13203a 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -1074,18 +1074,33 @@ int Foam::system(const std::string& command) 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); } bool Foam::dlClose(void* handle) { + if (POSIX::debug) + { + Info<< "dlClose(void*)" + << " : dlclose" << endl; + } return ::dlclose(handle) == 0; } 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 (void) ::dlerror(); @@ -1110,6 +1125,12 @@ bool Foam::dlSymFound(void* handle, const std::string& symbol) { if (handle && !symbol.empty()) { + if (POSIX::debug) + { + Info<< "dlSymFound(void*, const std::string&)" + << " : dlsym of " << symbol << endl; + } + // clear any old errors - see manpage dlopen (void) ::dlerror();