This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Exception handling contexts
- To: gcc at gcc dot gnu dot org
- Subject: Exception handling contexts
- From: Adam Langley <agl at linuxpower dot org>
- Date: Mon, 16 Apr 2001 20:16:31 +0100
I'm hoping someone can help me here:
I have a userland threading system which simply mallocs a stack and
sets %esp to it. By using longjmp and setjmp to save state it's a very
nice way to do threads.
However, exception handling breaks.
I null out the frame pointer in the first function of the new thread,
which keeps the stack tidy, but I'm guessing exception handling uses
some structure that i'm fscking (eh_context seems a good candidate
from looking at the source)
#0 0x4014586f in __frame_state_for () from /usr/lib/libstdc++-libc6.2-2.so.3
#1 0x40144ab8 in exception::what () from /usr/lib/libstdc++-libc6.2-2.so.3
#2 0x40144e1a in exception::what () from /usr/lib/libstdc++-libc6.2-2.so.3
#3 0x40144e85 in exception::what () from /usr/lib/libstdc++-libc6.2-2.so.3
#4 0x40145668 in __frame_state_for () from /usr/lib/libstdc++-libc6.2-2.so.3
#5 0x40143f65 in __throw () from /usr/lib/libstdc++-libc6.2-2.so.3
#6 0x808a821 in Thread::start (this=0x8110eb8) at neuroses.cc:193
The code in Thread::start is:
try {
throw 1;
} catch (...) {}
Cc'ing to agl@linuxpower.org would be nice, thou I'll keep an eye on
the archives. Thanks.
Adam Langley
--
Just because you don't understand it doesn't mean that it doesn't work