Re: [Linux-ia64] getcontext() correctly implemented ?

From: David Mosberger <>
Date: 2001-09-21 04:26:35
>>>>> On Thu, 20 Sep 2001 19:34:00 +0200 (CEST), stefan <> said:

  Stefan> Hello list, in order to save the full register set of the
  Stefan> ia64 I want to use getcontext(&ctx) instead of
  Stefan> setjmp(jmpbuf) and check the registers in ctx.uc_mcontext
  Stefan> for references in a garbage collected system.

The *context() routines are designed to support synchronous context
switches only (see glibc FAQ).  Thus, they basically save the
"preserved" state only.

  Stefan> My question is: Is getcontext() correctly implemented in
  Stefan> glibc(). Which version do I need and can I use it for the
  Stefan> described purpose at all ?

It's implemented to meet the requirements of SuS.  In that sense, it
should be correct (you'll probably need glibc 2.2.4 as there were some
silly bugs in earlier versions).

To get the full machine context, in a signal handler, you'd have to
either (a) use stack unwinding to recover the preserved state at the
point of the signal or (b) use a combination of sigcontext and
setjmp() or getcontext().  Can say a little more about what you're
trying to do?  That would make it easier to give a specific example.

To accomplish (a), we really need a user-level unwinder.  It's been on
the todo list for some time, but nobody got around to implement it, so

Received on Thu Sep 20 11:26:45 2001

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:05 EST