Back to index

glibc  2.9
Functions | Variables
unwind-forcedunwind.c File Reference
#include <dlfcn.h>
#include <stdio.h>
#include <unwind.h>
#include <pthreadP.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void __attribute_noinline__ pthread_cancel_init (void)
void _Unwind_Resume (struct _Unwind_Exception *exc)
_Unwind_Reason_Code __gcc_personality_v0 (int version, _Unwind_Action actions, _Unwind_Exception_Class exception_class, struct _Unwind_Exception *ue_header, struct _Unwind_Context *context)
_Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, void *stop_argument)
_Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *context)

Variables

static void(* libgcc_s_resume )(struct _Unwind_Exception *exc)
static _Unwind_Reason_Code(* libgcc_s_personality )(int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, struct _Unwind_Context *)
static _Unwind_Reason_Code(* libgcc_s_forcedunwind )(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *)
static _Unwind_Word(* libgcc_s_getcfa )(struct _Unwind_Context *)

Function Documentation

_Unwind_Reason_Code __gcc_personality_v0 ( int  version,
_Unwind_Action  actions,
_Unwind_Exception_Class  exception_class,
struct _Unwind_Exception ue_header,
struct _Unwind_Context context 
)

Definition at line 81 of file unwind-forcedunwind.c.

{
  if (__builtin_expect (libgcc_s_personality == NULL, 0))
    pthread_cancel_init ();

  return libgcc_s_personality (version, actions, exception_class,
                            ue_header, context);
}

Here is the call graph for this function:

_Unwind_Reason_Code _Unwind_ForcedUnwind ( struct _Unwind_Exception exc,
_Unwind_Stop_Fn  stop,
void *  stop_argument 
)

Definition at line 94 of file unwind-forcedunwind.c.

{
  if (__builtin_expect (libgcc_s_forcedunwind == NULL, 0))
    pthread_cancel_init ();

  return libgcc_s_forcedunwind (exc, stop, stop_argument);
}
_Unwind_Word _Unwind_GetCFA ( struct _Unwind_Context context)

Definition at line 104 of file unwind-forcedunwind.c.

void _Unwind_Resume ( struct _Unwind_Exception exc)

Definition at line 72 of file unwind-forcedunwind.c.

Definition at line 35 of file unwind-forcedunwind.c.

{
  void *resume, *personality, *forcedunwind, *getcfa;
  void *handle;

  if (__builtin_expect (libgcc_s_getcfa != NULL, 1))
    {
      /* Force gcc to reload all values.  */
      asm volatile ("" ::: "memory");
      return;
    }

  handle = __libc_dlopen ("libgcc_s.so.1");

  if (handle == NULL
      || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
      || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL
      || (forcedunwind = __libc_dlsym (handle, "_Unwind_ForcedUnwind"))
        == NULL
      || (getcfa = __libc_dlsym (handle, "_Unwind_GetCFA")) == NULL
#ifdef ARCH_CANCEL_INIT
      || ARCH_CANCEL_INIT (handle)
#endif
      )
    __libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");

  libgcc_s_resume = resume;
  libgcc_s_personality = personality;
  libgcc_s_forcedunwind = forcedunwind;
  /* Make sure libgcc_s_getcfa is written last.  Otherwise,
     pthread_cancel_init might return early even when the pointer the
     caller is interested in is not initialized yet.  */
  atomic_write_barrier ();
  libgcc_s_getcfa = getcfa;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 30 of file unwind-forcedunwind.c.

_Unwind_Word(* libgcc_s_getcfa)(struct _Unwind_Context *) [static]

Definition at line 31 of file unwind-forcedunwind.c.

Definition at line 27 of file unwind-forcedunwind.c.

void(* libgcc_s_resume)(struct _Unwind_Exception *exc) [static]

Definition at line 25 of file unwind-forcedunwind.c.