From: Andrew on
On 27 Aug, 22:36, Andrew <marlow.and...(a)googlemail.com> wrote:
> I am trying to port lucidDb to solaris. It currently is only buildable
> on linux or windoze. It turns out that on these platforms it knows how
> to programmatically get a stack trace at runtime from within C++ (as
> opposed to using gdb or something like that).
>
> I have come across sw that does this sort of thing in the past. It is
> inherently non-portable, implementations have to be found for various
> target platforms. So I was wondering, has anybody seen this done for
> solaris? Ideally it would be good to track down a library that does it
> for solaris, linux and windoze. I am not aware of any such library.
> Hopefully someone here will know...
>
> One of the complications is that the symbols will need to be
> demangled. This is compiler-specific also. I will be using gcc.

I would like to add that I once worked in a place where they found
another solution to this problem. The app was always run in the
debugger in a here document that gave the 'where' command followed by
'quit'. So when there was a SEGV etc you automatically got the stack
trace. Surew, running it in the debugger is slower than running it
directly but it did solve the problem. What do people think of this
approach?


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]