1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-08 02:18:11 +01:00
Commit graph

28 commits

Author SHA1 Message Date
Tim Deegan
4eb880e1b5 Implement DWARF DW_CFA_val_expression for x86_64
Ubuntu's libc-bin (2.15-0ubuntu20.2) on x86_64 uses DW_CFA_val_expression
in describing the pthread spinlock operations __lll_unlock_wake() and
__lll_lock_wait().  libunwind 1.1 doesn't understand that opcode and
so backtraces from those operations are truncated.

This changeset adds basic support for it, by adding a new type to
dwarf_loc_t that describes the register's actual contents rather than
its location.  I've only implemented the new type for x86_64, and
stubbed it out for all other architectures -- it looks like a lot
of that code is duplicated so oughtn't to be that hard, but I don't
have test cases for them.

Tested that DW_CFA_val_expression works on x86_64 (by using
https://code.google.com/p/gperftools/ on a lock-heavy program).
Build-tested on x86, x86_64 and arm.  The unit tests don't pass for me
on any of those archs, but this cset doesn't break anything that was
passing before.

Signed-off-by: Tim Deegan <tjd@phlegethon.org>
2014-02-08 20:19:20 -08:00
Arun Sharma
85ce920cff Use adaptive mutexes when available. 2013-11-17 20:33:33 -08:00
Matt Fischer
eac65dc9b8 Add basic support for the QNX operating system
This change adds some special cases to allow libunwind to compile
for QNX.

* QNX's copy of <elf.h> and <link.h> reside in sys/ instead.  To deal
  with this, an AC_CHECK_HEADERS() was added to check for the files
  in both locations.
* Similarly, QNX does not have <endian.h>.  In cases where the file is
  not found, logic was added to refer to QNX-specific macros to determine
  endianness.
* The QCC compiler, which is a wrapper around GCC, cannot handle some
  standard GCC options.  Therefore, logic was added to check for QCC,
  and when it is found, to suppress the use of -lgcc, and to express the
  option -nostartfiles as -Wc,-nostartfiles instead, which is correctly
  passed on to the underlying GCC.
* Finally, the support file os-qnx.c was added, patterned after the existing
  os-*.c files.  Only local image lookup is currently supported (see the
  comments for more information), but this is sufficient for QNX, since
  ptrace is not supported there anyway, and that is the only case where the
  function is required to do remote image lookup.

Change-Id: Ie7934f94a7317bdde59335f2acd4c3a97c0384c1
2013-05-13 10:50:17 -05:00
Ladislav Michl
10b064ffe9 Support building with older compilers.
Add a check for __builtin_unreachable.
2012-11-24 21:37:07 -08:00
Tommi Rantala
890e23eb9d Prefer NULL over zero 2012-09-28 14:51:21 +03:00
Tommi Rantala
c2d6f85a0a Use __sync builtin atomics on all architectures if available
We can use the __sync builtin atomics also on other architectures than
IA64. GCC 4.7 documentation notes that these builtins are ``legacy'' --
adding support for the newer GCC __atomic atomics should be fairly easy.
2012-09-28 14:06:04 +03:00
Tommi Rantala
9a3565ddc1 Simplify `sos_alloc()' implementation
Instead of maintaining a pointer to the `sos_memory' array, maintain an
index that tells the next free position. When atomic operations are
available, the allocation boils down to a single fetch-and-add
operation.
2012-09-28 13:52:22 +03:00
Tommi Rantala
dc680c0b52 Pull attribute macros from libunwind_i.h' to new header compiler.h'
Pull attribute macros from `libunwind_i.h' to new header `compiler.h',
to allow the macros to also be used in the tests.
2012-09-28 13:52:21 +03:00
Tommi Rantala
c2f7574187 Rename and share `ALIGN' macro from _UCD_internal.h
Rename the `ALIGN' macro to `UNW_ALIGN', and move it from
`_UCD_internal.h' to `libunwind_i.h' so that we can share it with the
mempool code. `ALIGN' was clashing with system headers on FreeBSD:

In file included from src/coredump/_UCD_access_reg_freebsd.c:26:
src/coredump/_UCD_internal.h:102:1: warning: "ALIGN" redefined
In file included from /usr/include/sys/param.h:115,
                 from src/coredump/_UCD_lib.h:52,
                 from src/coredump/_UCD_access_reg_freebsd.c:24:
/usr/include/machine/param.h:79:1: warning: this is the location of the previous definition
2012-09-05 14:02:36 +03:00
Tommi Rantala
a15874f2cb Annotate unused argument in mark_as_used() to avoid -Wextra compiler noise
include/libunwind_i.h: In function 'mark_as_used':
include/libunwind_i.h:187:39: warning: unused parameter 'v' [-Wunused-parameter]
2012-09-04 12:59:11 +03:00
Tommi Rantala
18c26d4a7e Place `inline' at beginning of declaration of invalidate_edi()
../include/libunwind_i.h:319:1: warning: 'inline' is not at beginning of declaration [-Wold-style-declaration]
2012-08-21 22:33:57 +03:00
Arun Sharma
25ee9f8172 Introduce struct elf_dyn_info
This is a common part of struct UPT_info
and struct UCD_info (to be introduced later).
Make _UPTi_find_unwind_table function operate only on this part
of struct UPT_info.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2012-03-12 20:04:19 -07:00
Ken Werner
91494b732b Define GNU and processor specific values for the Phdr p_type field
Define GNU and processor specific values for the Phdr p_type field in case
they aren't defined by <elf.h> already.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-10-29 17:12:43 -07:00
Ken Werner
2c865b6ed3 Include <sys/mman.h> to have MAP_ANONYMOUS defined
This change prevents libunwind_i.h from using a self-defined MAP_ANONYMOUS and
therefore avoids collisions in case the system header gets pulled in later.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
2011-10-29 17:12:42 -07:00
Lassi Tuura
ae5c1f2adf Performance optimisations for fast trace.
Insert static branch prediction predicates in useful places and avoid
unnecessary code in the hottest paths. Bypass unnecessary indirect
calls, in particular to access_mem(), when known to be safe.
2011-04-17 20:34:38 -07:00
Arun Sharma
c0a9d0c7c1 Fix the mismatch between the macro parameter and the name used in the body.
Thanks to David Lee <live4thee@gmail.com> for noticing.
2011-01-23 18:06:51 -08:00
Konstantin Belousov
8ccebc9307 MAP_ANONYMOUS 2010-03-06 16:23:24 +02:00
Konstantin Belousov
905034ce72 Initial attempt at the build infrastructure for FreeBSD. 2010-03-06 00:41:37 +02:00
Arun Sharma
3067acf172 Remove duplicate calls to mark_as_used 2009-10-17 22:45:30 -07:00
Arun Sharma
4ab26bcdaa Fix compiler warnings seen with --disable_block_signals 2009-10-16 15:52:44 -07:00
Arun Sharma
491d576529 Fix compiler warnings on x86_64 2009-10-16 14:01:50 -07:00
Arun Sharma
af9daf66af Fix the naming of the sigprocmask parameters. 2009-10-15 19:29:49 -07:00
Paul Pluzhnikov
9aa0d6d680 Allow caller to block signals.
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.
2009-09-25 09:36:41 -07:00
Arun Sharma
ec53de82ec [PATCH] Avoiding name conflict with the GNU-specific dprintf in stdio.h
Signed-off-by: Yang Zhang <yaaang@gmail.com>
2009-03-16 21:37:11 -07:00
David Mosberger-Tang
e6b9f350f7 Introduce a tdep_get_func_addr_hook() in the ELF lookup_symbol()
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.
2007-08-22 13:02:09 -06:00
hp.com!davidm
d5ab898cdf (SOS_MEMORY_SIZE): Move to here from src/mi/mempool.c.
(Logical change 1.295)
2005-05-20 11:28:16 +00:00
hp.com!davidm
180a1ececa Initial revision 2005-05-20 09:48:08 +00:00
hp.com!davidm
5135d044ed Add include of <stdlib.h>.
2005/05/19 07:42:56-07:00 hp.com!davidm
Rename: include/internal.h -> include/libunwind_i.h

(Logical change 1.294)
2005-05-20 09:48:08 +00:00