1- Does someone know if there is an equivalent, in Visibroker 3.3 C++,
of the Java Exception.printStackTrace() ?
2- More, I would like to get all this in a string instead of printing to
stdout: is there a way to do this ?
Thanks for your help.
Rodolphe.
Unless there is special support for this in Visibroker, there is
nothing like this in C++. Exception mechanisms in C++ do not mandate
any standard Exception object, and in general do not seem (in my
experience) to provide a stack trace.
There are ways of simulating this, however, if you are a diciplined
programmer. Just recently on comp.lang.c++.moderated I mentioned
under a similar thread some macros that were built in to the Blaze
(formerly Neruon Data) Open Interface Toolkit - a cross platform GUI
toolkit. Basically you added a couple of macros to your code as shown
below.
Obj::method()
{
ERR_TRACEIN;
... code ...
ERR_TRACEOUT; // does return;
// or use ERR_TRACERET(val) to return a value
}
These macros manage a linked list of the __FILE__ and __LINE__ macros,
not quite a stack trace, but you get the idea of what could be done.
BUT - as I mentioned, it is a programmer dicipline, and not mandated,
or given to you for free.
Hope this helps.
gre...@cibc.ca
Sent via Deja.com http://www.deja.com/
Before you buy.
Right. This really has nothing to do with CORBA, but has instead to do
with the programming language and operating system you're using. On
HP-UX, for example, you can get a stack trace printed to the standard
error output by calling the function
extern "C" void U_STACK_TRACE();
--steve
--
Steve Vinoski vinoski at iona.com
Chief Architect 1-800-ORBIX-4U
IONA Technologies, Inc. Waltham, MA USA 02451
200 West St. http://www.iona.com/hyplan/vinoski/
Copyright 1999 Stephen B. Vinoski. All Rights Reserved.
> In article <3869FE47...@club-internet.fr>,
> rlecocq <rle...@club-internet.fr> wrote:
> > Hello,
> >
> > 1- Does someone know if there is an equivalent, in Visibroker 3.3 C++,
> > of the Java Exception.printStackTrace() ?
Most UNIXes allow you to attach a debugger to a running process and take
a stack trace with that.
Some UNIX also have a stack_trace() call or some such in their C library.
However, if it's there, it's non-standard.
Cheers,
Michi.
--
Michi Henning +61 7 3891 5744
Object Oriented Concepts +61 4 1118 2700 (mobile)
Suite 4, 904 Stanley St +61 7 3891 5009 (fax)
East Brisbane 4169 mi...@ooc.com.au
AUSTRALIA http://www.ooc.com.au/staff/michi-henning.html