This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libverbose_terminate, pass 1 of N

Phil Edwards <> writes:

| Jason's patch
| 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]