1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-30 21:21:45 +02:00
Commit graph

1670 commits

Author SHA1 Message Date
Tommi Rantala a26f1eac22 IA64: `ent' needed conditionally in Gtables.c
ia64/Gtables.c: In function '_ULia64_search_unwind_table':
ia64/Gtables.c:258: warning: unused variable 'ent'
2012-07-31 16:21:15 +03:00
Tommi Rantala 0fecf13d10 Fix --enable-debug-frame build
dwarf/Gfind_unwind_table.c: In function '_Ux86_dwarf_find_unwind_table':
dwarf/Gfind_unwind_table.c:223:46: error: 'struct elf_dyn_info' has no member named 'edi'
2012-07-31 16:21:15 +03:00
Tommi Rantala 5d36914c9b IA64: use tdep_find_unwind_table() in coredump lib
Fixup commit d93d96ad83 ("Fix compilation
on IA64"), and replace the dwarf_find_unwind_table() call with
tdep_find_unwind_table().

Fixes linkage error on IA64:
../src/.libs/libunwind-coredump.so: undefined reference to `dwarf_find_unwind_table'
2012-07-31 16:21:15 +03:00
Tommi Rantala 354b3fd45b Allow IA64 cross-compilation
Change the way we generate the cursor header files, so that we do not
need to invoke IA64 binaries, which would fail when cross-compiling
libunwind.

Adopt the strategy used in the Linux kernel build system, and parse our
annotated offset information from the assembler file produced by the
compiler.
2012-07-31 16:03:53 +03:00
Martin Milata de28c51e63 Build libunwind-coredump using libtool
So that it builds shared/pic library that can be linked with other
libraries.

Signed-off-by: Martin Milata <mmilata@redhat.com>
2012-07-04 17:01:44 -07:00
Martin Milata d93d96ad83 Fix compilation on IA64
- Add tdep macro for {dwarf,ia64}_find_unwind_table so that ia64
   doesn't try to use dwarf code.
 - Fix extraneous #if.
 - Fix mistyped filename in Makefile.am.
 - Link ia64-specific tests with correct libraries.

Signed-off-by: Martin Milata <mmilata@redhat.com>
2012-05-23 20:52:28 -07:00
Arun Sharma fa5409387c Merge branch 'coredump2' of https://github.com/adsharma/libunwind
Conflicts:
	src/ptrace/_UPT_find_proc_info.c
2012-05-23 20:51:50 -07:00
Arun Sharma dd297ea92e Revert "x86_64: unbreak test-ptrace"
This reverts commit c9c5a40be1.
dwarf_get() returns 0 on success. We should continue unwinding
in that case.

TBD: investigate test-ptrace failure on some platforms.
2012-05-18 15:24:02 -07:00
Arun Sharma c9c5a40be1 x86_64: unbreak test-ptrace
If dwarf_get returns 0 (indicating the end of call chain), we should
not override the return value to 1. This may result in the caller
continuing to unwind and getting spurious errors.
2012-05-16 07:49:30 -07:00
Konstantin Belousov 1a6ea3da60 freebsd: Fix boundary conditions for non-dwarf walker on x86_64.
In the commit d04dc94cc2, the check for
dwarf.ip == 0 was removed from non-dwarf walker in x86_64 version of
unw_step(). Apparently this broke the detection of the end of frame
chain when NULL %rbp is specified, because the case just marked
dwarf.ip as 0. Explicitly set ret to 0 to indicate the end of
iteration.
2012-05-14 23:18:00 -07:00
Konstantin Belousov 3bb74aae3d freebsd: Account for the possible ERESTART handling of the syscalls. 2012-05-14 23:07:52 -07:00
Konstantin Belousov 5f440b4af2 freebsd: Workaround for old FreeBSD kernels
Older kernels interpret the pid argument of the process information
sysctls as pid only. If libunwind UPT consumer passed tid to _UPT_create,
tdep_get_elf_image() returns error due to sysctls failure. Provide a
slow workaround by searching for a process owning the supplied tid if
sysctl returned ESRCH.
2012-05-14 23:07:52 -07:00
Konstantin Belousov f8858bacca freebsd: Fix logic error
When encountered vm map entry is not backed by a vnode, continue search
for matching entry instead of aborting the loop.
2012-05-14 23:07:51 -07:00
Konstantin Belousov 0fac4c8109 freebsd: Consistently use symbolic name UNW_EUNSPEC for errors 2012-05-14 23:07:51 -07:00
Jiri Olsa 69e300e8f6 dwarf: Get correct return from expression evaluation
Currently the expression evaluation always succeeds,
and possible error is not propagated to the caller.

The ',' operator makes the condition always return 0.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Paul Pluzhnikov <ppluzhnikov@google.com>
2012-04-16 07:13:54 -07:00
Arun Sharma cbc66b62c0 mips: fix a linker error
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
2012-04-09 19:48:49 -07:00
Arun Sharma 9507a9b501 ia64: move ia64 specific code out of dwarf
We still need to fixup the callers to pick dwarf_find_unwind_table
vs ia64_find_unwind_table in a target dependent way.
2012-03-29 11:35:26 -07:00
Arun Sharma bc056ffc9f coredump: update license to be the same as rest of libunwind
Per Denys Vlasenko <dvlasenk@redhat.com>:

Sure. It's a trivial file, I don't mind if you use
whatever license you like on it :)
2012-03-26 19:07:58 -07:00
Alexander Larsson edcc521a0e Add helper macros for pointer arithmetics
ALIGN lets you align pointers and STRUCT_MEMBER lets you get
structure members at a specific offset.

These are useful in general, and will be needed for the coredump notes
cleanup work.
2012-03-26 19:04:01 -07:00
Alexander Larsson b1393b7e63 Clean up the elf notes handling in the coredump code
We centralize the elf notes handling code in some macros, thus
simplifying the loops over the notes and avoiding code duplication.
2012-03-26 18:59:49 -07:00
Arun Sharma 49ca8b6a3e ia64: remove references to an out of scope local
This causes problems with gcc-4.7

Signed-off-by: Joel Brobecker <brobecker@adacore.com>
2012-03-26 18:54:53 -07:00
Arun Sharma 5e59e93d04 dwarf: introduce a valid bit for dwarf_reg_state_t
Without this, cache_match() returns true when (ip == 0).
2012-03-25 18:33:40 -07:00
Arun Sharma d04dc94cc2 dwarf: ip == 0 should't terminate unwind 2012-03-25 18:10:10 -07:00
Arun Sharma 43e5ee28c0 Demote the debug level to reduce verbosity 2012-03-25 17:44:53 -07:00
Arun Sharma 0628a9872c Whitespace cleanup 2012-03-23 22:34:42 -07:00
Alexander Larsson 0c0ea23cf2 Add support for multiple threads in core files
_UCD_select_thread() lets you select the active thread from
the core file and _UCD_get_num_threads() tells you how many there are.
2012-03-23 22:07:17 -07:00
Alexander Larsson d627481783 Break out the ifdefs for the UCD_info.prstatus type
This cleans up the code a bit and makes it easier to refer to
the prstatus type in other places.
2012-03-23 22:07:14 -07:00
Alexander Larsson b9ff650a22 Add _UCD_get_pid and _UCD_get_cursig
These let you get the pid and the current signal from the coredump.

This isn't strictly unwind related, but these are trivial to implement
as we have the info, and you almost always want these when you're
printing a backtrace from a core file.
2012-03-23 22:07:11 -07:00
Alexander Larsson adbeb79155 Fix build with --enable-debug
This just fixes a typo
2012-03-23 22:07:07 -07:00
Kostik Belousov cc7c74e691 On FreeBSD, the structure is called prstatus. 2012-03-13 18:15:39 +02:00
Kostik Belousov dc9be1a97a Implement register read for FreeBSD coredumps.
Rename _UCD_access_reg.c to _UCD_access_reg_linux.c, to have
per-OS coredump register reader.
2012-03-13 14:00:01 +02:00
Kostik Belousov 1e6959a769 Shut down compiler warning about format mismatch. 2012-03-13 13:17:07 +02:00
Kostik Belousov e8eb583450 Handle byteswap.h and endian.h inclusion. 2012-03-13 13:09:25 +02:00
Arun Sharma f0bb806ecb Move the test case to tests dir. 2012-03-12 20:11:49 -07:00
Arun Sharma 0f17b52171 Fixup regnames on x64 2012-03-12 20:11:49 -07:00
Arun Sharma b08ae72d6c Add support for unwinding coredump images
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2012-03-12 20:11:08 -07:00
Arun Sharma d276b7a961 Introduce get_proc_name_in_image()
This is similar to get_proc_name() but takes an already mapped
image.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2012-03-12 20:09:18 -07:00
Arun Sharma 6525714c27 Move some dwarf functionality from ptrace to dwarf
Move ptrace-independent code from src/ptrace/_UPT_find_proc_info.c
to src/dwarf/{G,L}find_unwind_table.c. Name this moved function
dwarf_find_unwind_table().

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
2012-03-12 20:06:37 -07: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
Arun Sharma 3d08506936 Fix undefined symbol: _Uelf64_valid_object
Without this change, we end up building libunwind-${arch}.a with
missing symbols.

Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
2012-02-12 19:53:38 -08:00
Konstantin Belousov 59328832f7 Provide the FreeBSD implementation for _UI_siglongjmp_cont on x86.
On FreeBSD, _NSIG is at least 128, so just pass a pointer to the
signal mask in the register.
Add my copyright.
2012-02-05 11:47:47 +02:00
Konstantin Belousov 1774384098 FreeBSD also supports PT_GNU_STACK. 2012-02-05 11:42:02 +02:00
Konstantin Belousov 29dae2171e Style. 2012-02-05 11:40:17 +02:00
Tommi Rantala 51445f61d3 ARM: fix unwind table search when IP less than first table entry
Properly return error when searching for unwind table entry for an IP
that is less than the first available table entry.
2012-02-01 07:57:15 -08:00
Tommi Rantala ec4b23bf70 ARM: fix off-by-one in exidx VFP pop
The range of VFP registers we need to pop is inclusive.
2012-01-24 20:43:55 -08:00
Tommi Rantala 458c661be7 Fix libunwind-generic.so symbolic link never being created in make install
Commit 7d43108f9c ("No
libunwind-generic.so if configured with --disable-shared") introduced a
check to avoid creating a broken libunwind-generic.so link, but the
result of the commit is that libunwind-generic.so is never created (at
least when installing to a clean directory).

We need to check for the installed libunwind-$(arch).so file,
libunwind-generic.so will be the symbolic link name.
2012-01-23 07:38:59 -08:00
Arun Sharma 52ca68c770 Fix a race condition
There is a window of time between the munmap and the tls_cache being
marked as destroyed, where there could be a bad access to memory that
has been unmapped/freed. Reorder the code a bit to close the window.

Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
2011-12-16 10:45:51 -08:00
Arun Sharma cf2f3d3b75 Correct the inverted check
Typo when manually applying the previous commit.
2011-12-02 08:35:00 -08:00
Arun Sharma 2f328202ee Fix a compiler warning
Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
2011-12-01 22:08:08 -08:00
Konstantin Belousov 2b606faa21 Fix compilation on non-glibc machines.
Commit 297d9cd07d (Fix for failing test-setjmp)
breaks non glibc systems, since __GLIBC_PREREQ is not defined there.
As a consequence, preprocessor aborts with an error.

Trying to hide __GLIBC_PREREQ under #ifdef __GLIBC would require
either code duplication, or moving the longjmp implementation into
the separate file, which is included twice. In fact, I am not sure
in any use of the __GLIBC_PREREQ at the compile time, because the
compiled code can be run on the later version of glibc.

Below is the patch, tested on FreeBSD x86/x86_64 and Scientific Linux 6.1
x86_64. I compile the code always, but keep it in under unused static
symbol. In principle, the code could be optimized out by linker.

[ Minor formatting edits: asharma@fb.com ]
2011-11-30 21:59:09 -08:00