Date: Tue, 14 Aug 2001 18:22:12 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Mario Deilmann" Message-Id: <2561-Tue14Aug2001182212+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: <9lb68u$8j710$1@ID-75293.news.dfncis.de> (rio_41@hotmail.com) Subject: Re: unwind programs stack ! References: <9lb3p7$8h7vn$1 AT ID-75293 DOT news DOT dfncis DOT de> <7263-Tue14Aug2001152627+0300-eliz AT is DOT elta DOT co DOT il> <9lb68u$8j710$1 AT ID-75293 DOT news DOT dfncis DOT de> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Mario Deilmann" > Newsgroups: comp.os.msdos.djgpp > Date: Tue, 14 Aug 2001 14:04:34 +0200 > > I need the struct member > > __jmp_buf __jmpbuf; /* Calling environment. */ > > in the defintion of jmp_buf[1]; > > e.g.: > #include > static jmp_buf env; > > /*extract the FP from env */ > fp=(void *)env->__jmp_buf[JMPBUF_FP]; > > this doesn't work with djgpp's setjmp.h or do I understand something wrong ? Is FP the so-called ``frame pointer''? If so, this is the EBP register, and in DJGPP you need to say simply this: fp = (void *)env->__ebp; That's it! (A program which uses such intimate details of data structures internal to the library is highly non-portable, so you shouldn't be surprised it doesn't work on anything but GNU/Linux. In fact, I won't be surprised if it will break on some future Linux system as well.)