Using read_rcfile(). More...
Classes | |
| class | libcwd::RcFile |
| This object represents a runtime configuration file. More... | |
In order to use attach_gdb() and/or to read debug channel states from an external file, you should call read_rcfile(), for example,
Or better yet,
which does all of the above and more. Use silent = off in your rcfile to get debug output about loading the rcfile.
At the start of every new thread you should call init_thread():
read_rcfile() can be used to turn on or off debug channels, but you still have to turn on the debug object(s) (or use NAMESPACE_DEBUG::init()); in particular the debug object libcw_do that is used to print WARNING messages in case something is wrong with your rcfile.
The default rcfile is .libcwdrc (you can change that by setting the environment variable LIBCWD_RCFILE_NAME ). The application will first attempt to read this file from the current directory. If that fails then it will try to read the rcfile from the users home directory. If that fails too then it will fall back to reading ${CMAKE_INSTALL_DATADIR}/libcwd . You can use the latter as a template and/or example file for writing your own rcfile.
If the environment variable LIBCWD_RCFILE_OVERRIDE_NAME is set, it will be read after the above file where any setting overwrites a previous one. Using channels_on even once, in this file, will reset all previously turned on channels, although additional channels_on lines accumulate again.