![]() |
setjmp,longjmp, sigsetjmp implementation
Where I can find setjmp,longjmp, sigsetjmp implementation? In GCC source I
can't find. |
Re: setjmp,longjmp, sigsetjmp implementation
Użytkownik "Borneq" <borneq@antyspam.hidden.pl> napisał w wiadomości
news:ka75r3$66s$1@node2.news.atman.pl... > Where I can find setjmp,longjmp, sigsetjmp implementation? In GCC source I > can't find. I found one: https://www-asim.lip6.fr/trac/netbsd...v=3&order=name |
Re: setjmp,longjmp, sigsetjmp implementation
Użytkownik "Borneq" <borneq@antyspam.hidden.pl> napisał w wiadomości
news:ka76g3$6v1$1@node2.news.atman.pl... > I found one: > https://www-asim.lip6.fr/trac/netbsd...v=3&order=name Is setjmp but not longjmp |
Re: setjmp,longjmp, sigsetjmp implementation
Borneq wrote:
> Where I can find setjmp, longjmp, sigsetjmp implementation? e.g. http://sourceware.org/git/?p=glibc.git;a=tree;f=setjmp |
Re: setjmp,longjmp, sigsetjmp implementation
Uzytkownik "Noob" <root@127.0.0.1> napisal w wiadomosci
news:ka7744$178$1@dont-email.me... >> Where I can find setjmp, longjmp, sigsetjmp implementation? > > e.g. http://sourceware.org/git/?p=glibc.git;a=tree;f=setjmp This call low level functions, longjmp.c : #include <setjmp.h> void __libc_siglongjmp (sigjmp_buf env, int val) { /* Perform any cleanups needed by the frames being unwound. */ _longjmp_unwind (env, val); if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, (sigset_t *) NULL); /* Call the machine-dependent function to restore machine state. */ __longjmp (env[0].__jmpbuf, val ?: 1); } longjmp_unwind ,__sigprocmask, __longjmp are in other library? In assembly? |
Re: setjmp,longjmp, sigsetjmp implementation
Borneq wrote:
> longjmp_unwind, __sigprocmask, __longjmp are in other library? 1) tar xjf glibc-2.16.0.tar.bz2 2) grep -rn __longjmp glibc-2.16.0 e.g. http://sourceware.org/git/?p=glibc.g...86/__longjmp.S |
Re: setjmp,longjmp, sigsetjmp implementation
Uzytkownik "Noob" <root@127.0.0.1> napisal w wiadomosci
news:ka7b08$n4m$1@dont-email.me... > Borneq wrote: > >> longjmp_unwind, __sigprocmask, __longjmp are in other library? > > 1) tar xjf glibc-2.16.0.tar.bz2 > 2) grep -rn __longjmp glibc-2.16.0 > > e.g. > http://sourceware.org/git/?p=glibc.g...86/__longjmp.S Thanks |
Re: setjmp,longjmp, sigsetjmp implementation
"Noob" <root@127.0.0.1> wrote in message news:ka7b08$n4m$1@dont-email.me... > Borneq wrote: > >> longjmp_unwind, __sigprocmask, __longjmp are in other library? > > 1) tar xjf glibc-2.16.0.tar.bz2 > 2) grep -rn __longjmp glibc-2.16.0 > > e.g. > http://sourceware.org/git/?p=glibc.g...86/__longjmp.S This is not C. In that case why does it need to be that complicated? I used to do this in just 3 instructions: mov esp,[spsave] mov ebp,[bpsave] jmp [....] It worked. -- Bartc |
Re: setjmp,longjmp, sigsetjmp implementation
BartC wrote:
> > > "Noob" <root@127.0.0.1> wrote in message news:ka7b08$n4m$1@dont-email.me... >> Borneq wrote: >> >>> longjmp_unwind, __sigprocmask, __longjmp are in other library? >> >> 1) tar xjf glibc-2.16.0.tar.bz2 >> 2) grep -rn __longjmp glibc-2.16.0 >> >> e.g. >> http://sourceware.org/git/?p=glibc.g...86/__longjmp.S > > This is not C. In that case why does it need to be that complicated? I > used to do this in just 3 instructions: > > mov esp,[spsave] > mov ebp,[bpsave] > jmp [....] > > It worked. > Doesn't the whole machine state have to be saved/restored(registers/Fp/SSE/flags etc)? What if the calling function was using some regs for local vars etc ?!... |
Re: setjmp,longjmp, sigsetjmp implementation
On Wed, 12 Dec 2012 15:19:57 +0100, Johann Klammer wrote:
> Doesn't the whole machine state have to be > saved/restored(registers/Fp/SSE/flags etc)? No. > What if the calling function was using some regs for local vars etc ?!... 7.13.2.1p3: All accessible objects have values as of the time longjmp was called, except that the values of objects of automatic storage duration that are local to the function containing the invocation of the corresponding setjmp macro that do not have volatile-qualified type and have been changed between the setjmp invocation and longjmp call are indeterminate. gcc will warn about such cases with e.g.: warning: variable ‘foo’ might be clobbered by ‘longjmp’ or ‘vfork’ Typically, only the "essential" registers (program counter, stack pointer, frame pointer) are preserved. Registers holding local variables or intermediate results aren't required to be preserved (and usually aren't). "Global" state isn't modified by longjmp and, AIUI, that includes the FP environment (<fenv.h>). |
| All times are GMT. The time now is 08:58 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.