1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-26 11:21:44 +02:00
libunwind-eh_elf/src/arm
Paul Pluzhnikov 84d4150668 Allow caller to block signals.
Greetings,

We use libunwind just for stack traces (I suspect many others do as well).

The use pattern is:

GetStackTrace(void** result, int max_depth)
{
...
  unw_getcontext(&uc);
  unw_init_local(&cursor, &uc);

  while (n < max_depth) {
    if (unw_get_reg(&cursor, UNW_REG_IP, (unw_word_t *) &ip) < 0) {
      break;
    }
    result[n++] = ip;
    if (unw_step(&cursor) <= 0) {
      break;
    }
  }

Given this usage, it is quite convenient for us to block signals (or
prevent signal handlers from re-entering libunwind by other means) at the
"top level", which makes most of the sigprocmask calls performed by
libunwind itself unneccessary.

The second patch in this series adds a configure option which removes most
of the sigprocmask calls.

Attached patch is a preliminary for it -- consolidating all of the
"sigprocmask; mutex_lock;" sequences into lock_acquire and "mutex_unlock;
sigprocmask;" sequences into lock_release.

Thanks,
--
Paul Pluzhnikov

commit 402d15b123d54a7669db7cf17a76dd315094e472
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date:   Mon Sep 21 10:18:28 2009 -0700

    Replace "sigprocmask + mutext_lock" with a single lock_acquire.
    Likewise, replace "mutext_unlock + sigprocmask" with lock_release.
2009-09-25 09:35:31 -07:00
..
Gcreate_addr_space.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
gen-offsets.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
getcontext.S Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gget_proc_info.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gget_save_loc.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gglobal.c Allow caller to block signals. 2009-09-25 09:35:31 -07:00
Ginit.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Ginit_local.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Ginit_remote.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gis_signal_frame.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gregs.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gresume.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Gstep.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
init.h Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
is_fpreg.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lcreate_addr_space.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lget_proc_info.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lget_save_loc.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lglobal.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Linit.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Linit_local.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Linit_remote.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lis_signal_frame.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lregs.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lresume.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
Lstep.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
offsets.h Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
regname.c Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
siglongjmp.S Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
unwind_i.h [ARM] This patch add some missing bits on ARM platform. 2008-04-21 13:43:18 -06:00