libverbose_terminate, pass 1 of N
Gabriel Dos Reis
gdr@integrable-solutions.net
Fri Dec 20 18:33:00 GMT 2002
Phil Edwards <phil@jaj.com> writes:
| Jason's patch
|
| http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00957.html
|
| started an interesting thread of about a dozen messages. The upshot is that
| currently, using __verbose_terminate() as the termination handler requires a
| change to user code, usually main(). It Would Be Cool[tm] if the user could
| install this handler at link-time with -l, or at runtime with LD_PRELOAD.
Thanks for tackling this.
As far as the LD_PRELOAD thiny isn't the mandated way to get this sort
of feature, I don't mind. I much favor the -l approach as it is
transparent about .a or .so distinction.
[...]
| I'm guessing that dg-output is only scanning stdout, not stderr.
Yeah. The tool (libstdc++-v3) is expected to output diagnostics on
stderr and testcase are expected to do output on stdout. I guess
there might be a way to hack around that.
[...]
| +#include <exception>
| +
| +namespace __gnu_cxx
| +{
| + static struct __Verb_Term_Preload
| + {
| + __Verb_Term_Preload ()
| + { std::set_terminate (__gnu_cxx::__verbose_terminate_handler); }
| + } __verb_term_dummy;
| +}
+namespace __gnu_cxx
+{
+ struct __verb_term_preload
+ {
+ __Verb_Term_Preload ()
+ { std::set_terminate (__gnu_cxx::__verbose_terminate_handler); }
+ };
+
+ static __verb_term_preload __verb_term_dummy;
+}
-- Gaby
More information about the Libstdc++
mailing list