Re: examining a jump buffer
- From: Allan Adler <ara@xxxxxxxxxxxxxxxxxxxx>
- Date: 22 Feb 2007 21:55:41 -0500
Dan Espen <daneNO@xxxxxxxxxxxxxxxxxxxxxxxxx> writes:
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.
I already said that. You act like you are discovering it for yourself.
They are doing exactly what they should be doing.
I assumed that was the case and didn't say otherwise. I asked why they
were doing it.
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?
Quoting the man page would have been perfectly adequate. You really have
to deal with your tendency to dump on people. I rely on a lot of sources
of information, such as Kernighan and Pike and Harbison and Steele, not
just on man pages, which are the sources you prefer.
--
Ignorantly,
Allan Adler <ara@xxxxxxxxxxxxxxxxxxxx>
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.
.
- Follow-Ups:
- Re: examining a jump buffer
- From: Allan Adler
- Re: examining a jump buffer
- From: Dan Espen
- 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
- Re: examining a jump buffer
- From: Dan Espen
- examining a jump buffer
- Prev by Date: Font support for sound recording copyright symbol?
- Next by Date: Re: examining a jump buffer
- Previous by thread: Re: examining a jump buffer
- Next by thread: Re: examining a jump buffer
- Index(es):
Relevant Pages
|