Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - what is jmp_buf / __JUMP_BUFFER
using sc foo.c -e -l (where foo.c only contains a line #include <setjmp.h>) I got the following output (see below). My question is: is it true that in SC/DMC, jmp_buf is defined as just defined as array: int[16] which is used in func setjmp(...) and longjmp(...)? Then what is __JUMP_BUFFER ? is it used by any function at all? Thanks. ================================================================ typedef int jmp_buf[16]; ... int __cdecl _setjmp(jmp_buf); int __cdecl setjmp(jmp_buf); void __cdecl longjmp(jmp_buf,int); int __cdecl _inline_setjmp(jmp_buf); .. typedef struct __JUMP_BUFFER { unsigned long Ebp; unsigned long Ebx; unsigned long Edi; unsigned long Esi; unsigned long Esp; unsigned long Eip; unsigned long Except_Registration; unsigned long TryLevel; unsigned long Reserved; unsigned long Unwind_Handler; unsigned long ExceptData[6]; } _JUMP_BUFFER; ==================================================================== Apr 29 2004
It is like taking a snapshot of all the registers up to the point of execution, store it somewhere, except one (AX/EAX) so that you can comeback to it as if nothing had happened. In the Ix86 architecture, jmp_buf can be implemented as int[16]. The __JUMP_BUFFER is for the 32-bit stuff. It can be used error recoveries, program restarts, or multithreadings. See: S. Kofoed, Doctor Dobb's Journal Nov. 1995 for an implementation of that which is portable on Win32, Dos, Dosx and etc. <some where.com> wrote in message news:c6s623$2l5$1 digitaldaemon.com...using sc foo.c -e -l (where foo.c only contains a line #include Apr 29 2004
In article <c6sgcg$hj5$1 digitaldaemon.com>, Kar G Lim says...In the Ix86 architecture, jmp_buf can be implemented as int[16]. The __JUMP_BUFFER is for the 32-bit stuff. Apr 29 2004
<some where.com> wrote in message news:c6spl0$10bv$1 digitaldaemon.com...In article <c6sgcg$hj5$1 digitaldaemon.com>, Kar G Lim says...In the Ix86 architecture, jmp_buf can be implemented as int[16]. The __JUMP_BUFFER is for the 32-bit stuff. Apr 30 2004
|