1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-28 12:11:45 +02:00
libunwind-eh_elf/src
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
..
arm Allow caller to block signals. 2009-09-25 09:35:31 -07:00
dwarf Allow caller to block signals. 2009-09-25 09:35:31 -07:00
hppa Allow caller to block signals. 2009-09-25 09:35:31 -07:00
ia64 Allow caller to block signals. 2009-09-25 09:35:31 -07:00
mi Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
mips Allow caller to block signals. 2009-09-25 09:35:31 -07:00
ppc Mark Wielaard <mwielaard@redhat.com> writes: 2007-10-01 08:35:01 -06:00
ppc32 Allow caller to block signals. 2009-09-25 09:35:31 -07:00
ppc64 Allow caller to block signals. 2009-09-25 09:35:31 -07:00
ptrace Fix ppc32 build. 2009-04-13 11:44:45 -07:00
setjmp Add initial ARM and MIPS support. To support this, also enable the 2008-02-04 17:16:37 -07:00
unwind Use a shorter path for include 2009-04-13 10:57:21 -07:00
x86 Allow caller to block signals. 2009-09-25 09:35:31 -07:00
x86_64 Allow caller to block signals. 2009-09-25 09:35:31 -07:00
elf32.c Do nothing of UNW_REMOTE_ONLY is defined. 2003-02-15 03:10:30 +00:00
elf32.h (Logical change 1.45) 2003-02-08 10:10:59 +00:00
elf64.c Do nothing of UNW_REMOTE_ONLY is defined. 2003-02-15 03:10:30 +00:00
elf64.h (Logical change 1.45) 2003-02-08 10:10:59 +00:00
elfxx.c Introduce a tdep_get_func_addr_hook() in the ELF lookup_symbol() 2007-08-22 13:02:09 -06:00
elfxx.h Introduce a tdep_get_func_addr_hook() in the ELF lookup_symbol() 2007-08-22 13:02:09 -06:00
Makefile.am Remove the special casing of ia64 for GetIPInfo() 2009-04-24 11:10:08 -07:00
os-hpux.c Include "libunwind_i.h" instead of "tdep.h" and "internal.h". 2005-05-20 09:48:08 +00:00
os-linux.c Include "libunwind_i.h" instead of "tdep.h" and "internal.h". 2005-05-20 09:48:08 +00:00
os-linux.h [Linux] Fix potentially overlapping memory-copy to use memmove() instead 2007-10-18 10:45:55 -06:00