This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libverbose_terminate, pass 1 of N
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Phil Edwards <phil at jaj dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: 21 Dec 2002 03:26:14 +0100
- Subject: Re: libverbose_terminate, pass 1 of N
- Organization: Integrable Solutions
- References: <20021219154527.A8952@disaster.jaj.com>
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