Use and write plugins
Plugins are a quick and easy way to preload a library into your program, and define where to set breakpoints and tracepoints. A plugin is an XML file.
Examples include MPI correctness checking libraries, or if you define a library that is preloaded with your program that performs your own monitoring of the program.
Plugins can also be used to display a message when breakpoints are hit, showing, for example, an error message where the message is provided by the library in a variable.