the instruction after the call for a normal frame. libunwind uses
IP-1 to lookup unwind information. However, this is not necessary for
interrupted frames such as signal frames (or interrupt frames) in
the kernel context.
This patch handles both cases correctly.
Based on work by Mark Wielaard <mwielaard@redhat.com>
The behavior on wait vs abort unwind depends on the locking primitive
chosen by the user. This makes the API consistent and independent of
the locking primitive.
Greetings,
Here is the second part, actually implementing the configure option.
Thanks,
--
Paul Pluzhnikov
commit cf823ed0d4d2447aa91af0e3cb5fbb6a6cba5068
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date: Mon Sep 21 11:37:38 2009 -0700
New configure option to allow caller to block signals.
Provide a special implementation for ia64, because the unwind
information is such that an IP adjustment is not necessary before
looking up unwind info.
Bad things happen if libunwind only provides parts of the ABI and
the rest come from libgcc.
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
getcontext in libc.
Also cleanup the namespace (check-name-space passes on x86_64 now).
Replace uses of offsets.h with ucontext_i.h.
Rename _x86_64_setcontext to _Ux86_64_setcontext.
TBD: Add CFI annotations for get/setcontext.
Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
Signed-off-by: Arun Sharma <arun.sharma@google.com>
bad/missing unwind information, which could result in libunwind
dereferencing bad pointers. This mechanism is based on msync(2) system
call and significantly reduces the chances of a bad pointer
dereference in libunwind.
The original idea was to turn this mechanism on only when necessary
i.e. libunwind didn't find proper unwind information for a IP.
There are a couple of problems in the current implementation.
* The flag is global and is modified without locking
* The flag isn't reset when starting a new unwind
The attached patch makes ->validate a per-thread setting by moving it
into struct cursor from unw_local_addr_space and resets it to false
when starting a new unwind. As a result, cursor->as_arg points to the
cursor itself instead of the ucontext (for the local case).
This was found to reduce the number of msync() system calls from an
application using libunwind significantly.
Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
Signed-off-by: Arun Sharma <arun.sharma@google.com>
* Use explicit types for XMM registers
* Support full width (128 bits) access
Signed-off-by: Andrew Cagney <cagney@redhat.com>
Signed-off-by: Arun Sharma <aruns@google.com>
routine and add address-space argument. This is needed because on
PPC64, a the function-name symbol refers to a function descriptor
(unlike, for example, on ia64, where the @fptr() operator is needed to
refer to a function descriptor). Thus, in order to look up the name
of a function, we need to dereference the function descriptor. To
make matters more "interesting", the function descriptors are normally
resolved by the dynamic linker, so we can't get their values from the
ELF file. Instead, we have to read them from the running image, hence
the need for the address-space argument.
include/dwarf.h: Declare dwarf_reg_state_pool and dwarf_cie_info_pool.
include/dwarf_i.h: Include libunwind_i.h instead of tdep.h.
Make dwarf_to_unw_regnum() a macro so it doesn't get compiled
into an object file merely because it include dwarf_i.h (important
when optimization is turned off).
(dwarf_read_encoded_pointer_inlined): New function.
include/tdep-x86/libunwind_i.h: Add include of "mempool.h".
include/tdep-x86_64/libunwind_i.h: Add include of "mempool.h".
Yes, it casts to signed, but then converts right back to
unsigned via the return type. Fixed thus.
Signed-off-by: Richard Henderson <rth@redhat.com>
Signed-off-by: Arun Sharma <arun.sharma@google.com>
Include "mempool.h".
(dwarf_reg_state_pool): Move here from dwarf.h.
(dwarf_cie_info_pool): Likewise.
Include "libunwind_i.h" instead of "tdep.h".
(Logical change 1.294)
Drop include of <libunwind.h>.
Include "script.h" instead of "ia64/script.h".
2005/05/19 07:42:45-07:00 hp.com!davidm
Rename: include/tdep-ia64.h -> include/tdep-ia64/libunwind_i.h
(Logical change 1.294)
that can be updated atomically (for Linux kernel compat.).
(unwi_full_mask): Rename from unwi_full_sigmask and change type to
intrmask_t.
(intrmask_t): New type.
(define_lock): New macro.
(lock_init): Likewise.
(lock_acquire): Likewise.
(lock_release): Likewise.
(GET_MEMORY): Likewise.
2005/02/20 21:42:54-08:00 mostang.com!davidm
(ALWAYS_INLINE): Include "inline" keyword for compatibility with
Linux kernel.
(ARRAY_SIZE): Rename from NELEMS for improved Linux-kernel
compatibility.
2004/10/25 05:21:51-07:00 hp.com!davidm
(Debug): Make a debug level of N imply that we're printing when
UNW_DEBUG_LEVEL=N since that's more intuitive.
(Logical change 1.290)