Re: examining a jump buffer
- From: Dan Espen <daneNO@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 22 Feb 2007 15:30:02 -0500
Allan Adler <ara@xxxxxxxxxxxxxxxxxxxx> writes:
Jean-David Beyer <jeandavid8@xxxxxxxxxxx> writes:
Allan Adler wrote:
Thanks for the suggestions. I'm never sure what one can look at and
what one can't. For example, I think gdb can't really let you examine
kernel stuff. I think we (collectively) once had a thread here in which
I wanted to examine the innards of a FILE using gdb. Anyway, I'll try
what you suggest.
That would not matter, since "env" is in your user space.
OK, thanks. I wrote a naive little program and tested it in gdb:
main()
{
setjmp(env);
longjump(env,1);
return 0;
}
It compiled ok and hung when it ran. I looked at it in gdb and printed env
and realized eventually that I was stepping through an infinite loop in which
the program was executing longjump(env,1) over and over again. Can someone
please explain why? I can sort of guess, but my guesses in a matter about
which I understand so little aren't worth much.
It appears that you don't understand how setjmp/longjmp work.
They are doing exactly what they should be doing.
The man pages for both functions are pretty clear.
What part of:
After longjmp() is completed, program exe-
cution continues as if the corresponding call of setjmp() had just
returned the value val.
don't you understand?
It's trying to tell you longjump goes to the instruction
right after setjmp.
This is probably not the best forum to learn C on.
.
- Follow-Ups:
- Re: examining a jump buffer
- From: Allan Adler
- Re: examining a jump buffer
- References:
- examining a jump buffer
- From: Allan Adler
- Re: examining a jump buffer
- From: Dan Espen
- Re: examining a jump buffer
- From: Allan Adler
- Re: examining a jump buffer
- From: Jean-David Beyer
- Re: examining a jump buffer
- From: Allan Adler
- examining a jump buffer
- Prev by Date: Re: examining a jump buffer
- Next by Date: How to save parts of a process image to a file?
- Previous by thread: Re: examining a jump buffer
- Next by thread: Re: examining a jump buffer
- Index(es):
Relevant Pages
|