Stack: Difference between revisions

11 bytes removed ,  14 years ago
m
Killing "PlusPlus"
[unchecked revision][unchecked revision]
(Moved Stack Trace to its own topic)
m (Killing "PlusPlus")
Line 188:
== Unwinding the stack ==
 
Unwinding the stack is complex. It is done when using exceptions, like in [[C PlusPlus|C++]]. It is performed when an exception is thrown. The purpose of unwinding the stack is to call the destructor of local objects of the stack frames and to remove stack frames until an appropriate landing pad is found. The landing pad is the try..catch block in C++ or Java. The catch block has to match the exception, i.e. a RuntimeException object can't be caught as a String object.
 
The unwinding algorithm depends on the architecture. Normally this algorithm is provided in the language runtime library. When using GCC and C++ it is defined in the libsupc++ library linked with your application. However it doesn't happen, when creating a kernel. The libsupc++ library is also too bloated to use in kernel space.
57

edits