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

1749 commits

Author SHA1 Message Date
Matt Fischer
563b0ff314 Added --enable-setjmp
Currently, libunwind-setjmp is built whenever local unwinding is
built.  This patch adds an explicit flag to control it instead.
The default if not specified is to follow the old behavior.
2013-04-19 17:08:03 -05:00
Matt Fischer
abb0957198 Added --enable-ptrace
This change adds a manual override to control building of the ptrace
library, similar to the existing --enable-coredump option.  The
default is set based on the existence of sys/ptrace.h, allowing it
to be automatically disabled for platforms that do not have ptrace.
2013-04-19 16:46:24 -05:00
Arun Sharma
f92ecb6127 dwarf: Fix memory leak
Need to clean up by calling put_unwind_info() on code paths where fetch_proc_info() fails.

Signed-off-by: Arun Sharma <asharma@fb.com>
2013-04-02 21:19:56 -07:00
dave lerner
8028a537dd unw_is_signal_frame should return false/0 for bad addresses
access_mem() could fail and return a non-zero value, which callers
interpret as boolean true.

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
2013-03-10 14:59:44 -07:00
Chris January
679b65cd22 dwarf: Fix the order of the operands to the relational operators
dwarf_eval_expr are reversed compared with the DWARF spec.
2013-02-04 19:36:33 -08:00
Ladislav Michl
10b064ffe9 Support building with older compilers.
Add a check for __builtin_unreachable.
2012-11-24 21:37:07 -08:00
Arun Sharma
d7322f0f64 Update to v1.1 2012-10-05 21:54:17 -07:00
Tommi Rantala
adae66d2e2 Fix x86-64 debug build -Wformat warning
src/x86_64/Gstep.c: In function '_ULx86_64_step':
src/x86_64/Gstep.c:204:4: warning: unknown conversion type character 'r' in format [-Wformat]
2012-10-05 21:24:36 -07:00
Tommi Rantala
96c1bca2b0 Fix header inclusion order in `src/elfxx.c'
Make sure that we have included `config.h' before checking HAVE_LZMA.
This makes a difference at least on MIPS, where we include `elfxx.c'
directly. For other platforms this does not make much difference, as we
are already indirectly including `config.h' from other headers.
2012-10-05 21:24:30 -07:00
Arun Sharma
cb3fbbb172 Reduce the number of ifdefs in machine independent code
Hopefully we don't have too many GNUC users who don't have
fetch and add.
2012-09-29 12:22:47 -07:00
Tommi Rantala
890e23eb9d Prefer NULL over zero 2012-09-28 14:51:21 +03:00
Tommi Rantala
aebba1f8a7 Apply `define_lock()'
We have a nice macro for defining pthread mutexes, use it.
2012-09-28 14:51:21 +03:00
Tommi Rantala
22aff2cc1f Fix second operand read in dwarf_eval_expr()
Due to bad bracketing, the second operand was never read for dwarf
expressions that take two operands.

Caught with sparse.
2012-09-28 14:51:21 +03:00
Tommi Rantala
65bdcc6f9d Teach autotools current ARM `ex_tables.h' location 2012-09-28 14:51:21 +03:00
Tommi Rantala
5e7e890a0b Plug in `ALIAS' attribute 2012-09-28 14:51:21 +03:00
Tommi Rantala
7d471b1440 Define and use `CONST_ATTR' 2012-09-28 14:51:21 +03:00
Tommi Rantala
e0653f9e3a Define and use `WEAK' 2012-09-28 14:51:21 +03:00
Tommi Rantala
397f32a378 Plug in `ARRAY_SIZE' in ptrace code 2012-09-28 14:50:03 +03:00
Tommi Rantala
dcbe6836eb IA64: constify read only arrays in `tdep_init()' 2012-09-28 14:50:03 +03:00
Tommi Rantala
088ac53775 Constify `operands' in src/dwarf/Gexpr.c 2012-09-28 14:50:03 +03:00
Tommi Rantala
ee8df26288 Constify `dwarf_to_unw_regnum_map' 2012-09-28 14:50:03 +03:00
Tommi Rantala
a9b5b10f23 Set `_UPT_reg_offset' read only
We do not modify `_UPT_reg_offset', so let's set it `const'. Given that
the array is exported, it's technically possible that some library user
is actually modifying the content, but does not seem really all that
likely.
2012-09-28 14:50:03 +03:00
Tommi Rantala
e2d5cdd22d ppc32: include `compiler.h' for UNUSED in ucontext_i.h 2012-09-28 14:50:03 +03:00
Tommi Rantala
8d5b1aeeff SuperH port
Add support for the 32bit SuperH architecture running Linux.
Specifically, support is added for SH4, and support for earlier SH
versions and to the 64bit SH5 are left out. This was tested in qemu with
a little-endian SH4 debian image & GCC 4.7 cross compiler.
2012-09-28 14:50:03 +03:00
Tommi Rantala
79c2c254a7 MIPS coredump support
Add MIPS support to the coredump library. Explicit support for the MIPS
program counter register is added so that we can start backtracing from
the program counter value we read from a core dump. The PC register
support was not strictly required for local backtracing, and we will in
fact just plug the return address to the PC register in getcontext().

I have only tested the 32bit "OABI" paths.
2012-09-28 14:50:03 +03:00
Tommi Rantala
ded94b98ff Stop including `memory.h'
I am unable to find any reference to `memory.h' in the C99 and C11
committee drafts, so include `string.h' instead when we need memset() or
similar.
2012-09-28 14:50:03 +03:00
Tommi Rantala
cc6cd621ea HPPA: kludge out unused variable in unw_get_save_loc() stub 2012-09-28 14:06:07 +03:00
Tommi Rantala
fc38a5339d HPPA: properly check dwarf_get() return value in unw_step() 2012-09-28 14:06:07 +03:00
Tommi Rantala
6023ccf667 PPC: remove unused `PAGE_START' macro from Ginit.c 2012-09-28 14:06:07 +03:00
Tommi Rantala
0941dedb70 Remove unused src/x86_64/Lis_signal_frame.c 2012-09-28 14:06:07 +03:00
Tommi Rantala
23ecb97906 IA64: avoid -Wunused-but-set-variable in src/ia64/init.h
In file included from src/ia64/Ginit_remote.c:26:0:
src/ia64/init.h: In function 'common_init':
src/ia64/init.h:32:12: warning: variable 'natp' set but not used [-Wunused-but-set-variable]
2012-09-28 14:06:07 +03:00
Tommi Rantala
b4bde18112 Apply UNW_ALIGN more in src/mi/mempool.c
Apply UNW_ALIGN in a few places in src/mi/mempool.c that I missed in
commit c2f757418 ("Rename and share `ALIGN' macro from
_UCD_internal.h").
2012-09-28 14:06:07 +03:00
Tommi Rantala
5d0f376b08 Invert tdep_init() flag logic
Invert the flag that signals that tdep_init() was called, to move the
symbol from data to BSS.
2012-09-28 14:06:07 +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
26fc1563fb Align `sos_memory' to MAX_ALIGN
We give aligned pointers from the `sos_memory' array, so any non-aligned
bytes are only wasted.
2012-09-28 13:52:22 +03:00
Tommi Rantala
c36a14f245 Workaround non-power-of-two i386 sizeof(long double) in src/mi/mempool.c
To ensure that we return properly aligned pointers from sos_alloc(),
MAX_ALIGN must be a power-of-two. On i386 the power-of-two assumption
fails as sizeof(long double) = 12. Fix this by rounding up to 16.
2012-09-28 13:52:22 +03:00
Tommi Rantala
e6edad069c Use GCC __BIGGEST_ALIGNMENT__ for sos-pool MAX_ALIGN
Use the __BIGGEST_ALIGNMENT__ macro provided by GCC for sos_alloc()
allocation alignment. The macro gives ``the largest alignment ever used
for any data type on the target machine you are compiling for.''

__BIGGEST_ALIGNMENT__ also has some other nice properties, e.g. it is
power-of-two on all architectures (note that on i386, sizeof(long
double) = 12), and on some architectures (e.g. SuperH) the alignment
requirement can be lower than sizeof(long double).
2012-09-28 13:52:21 +03:00
Konstantin Belousov
d0cbc51955 x86_64: stop unwinding when %rbp location is NULL 2012-09-21 23:06:17 -07:00
Tommi Rantala
e891591bcb ppc32: fixup cross build failure 2012-09-21 22:52:28 -07:00
Arun Sharma
e4b24be9c2 pkg-config file fixups
Suggested-by: Alexander Toresson <alexander.toresson@gmail.com>
2012-09-21 22:46:01 -07:00
Alexander Toresson
ea5e90fd9f Create and install pkg-config .pc files
[Edit: renamed to libunwind-generic.pc and some .pc files
 created only when needed -- asharma@fb.com]
2012-09-15 11:34:43 -07:00
Cody P Schafer
9184535486 ptrace: add more Debug to access_reg
This was useful in debugging issues with the libunwind-ptrace code on
ppc64.
2012-09-15 10:50:32 -07:00
Cody P Schafer
3d6f7479b0 ptrace: check for NULL arg.
tdep_get_func_addr in ppc64 passes NULL for the last argument of
as->access_mem.  tdep_get_func_addr is called by elf_w(lookup_symbol),
which in turn is called by elf_w(get_proc_name_in_image).

elf_w(get_proc_name_in_image) is part of the API, and is only passed an
unw_addr_space_t, not a unw_cursor_t, meaning that we cannot recover the
UPT_info on the PPC64 platform.

This could be fixed by giving libunwind the knowledge to perform
relocations itself, thus not needing to look at the running image to
determine function addresses.
2012-09-15 10:47:43 -07:00
Cody P Schafer
10abb25af4 ptrace/access_reg: print out register name on "bad register"
When we have a "bad register", print out the name of that register (if
possible) to aid in debugging.
2012-09-15 10:47:43 -07:00
Cody P Schafer
f796a6dfe9 ppc64: add FRAME_POINTER & NIP to regname. 2012-09-15 10:47:43 -07:00
Cody P Schafer
0abc36eb18 ppc64: be explicit in access_reg range check 2012-09-15 10:47:42 -07:00
Cody P Schafer
64e8a3d909 UPT: Add reg offsets for ppc32/64 2012-09-15 10:47:42 -07:00
Cody P Schafer
3a5d7ff694 build: make libunwind-coredump build optional
Disable the building of libunwind-coredump except on x86_64 and x86
(where implimentations exsist).

Allow overriding of this autodetection via --enable-coredump and
--disable-coredump.
2012-09-15 10:47:42 -07:00
Cody P Schafer
fa56db394d ppc32: add UNUSED attribute to dmy_ctxt 2012-09-15 10:47:42 -07:00
Cody P Schafer
4ddca1acf1 ppc32: remove unused dmy_vrregset 2012-09-15 10:47:42 -07:00