Jay Vaughan <jay.vaughan@xxxxxxxxxxxxxxx> writes: > Are there methods of using GNU coverage which will allow me to save my > coverage information for the cases where death is warranted by my > guardian library? Is there some way for me to manually force coverage > to be written prior to doing my big exit() call in the constructor? > Has anyone else run into this problem and solved it? The coverage code runs a constructor at the default initialization priority. Since your code is running at a higher priority, it runs before coverage has been initialized. Ideally you could call __gcov_init (info) at the start of your constructor. The problem is that __gcov_init takes an argument, a pointer to a struct gcov_info, and you should really pass the same pointer as the default constructor will pass. But there is no way for your code to get that value. I can't think of anything that would work without changing and rebuilding the compiler and the gcov support code. Ian