1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-05-17 02:35:17 +02:00
Commit graph

74 commits

Author SHA1 Message Date
Keno Fischer 8afc33ce9f Add an option to have start_ip_offset be relative to start_ip
By default, the start_ip_offset in libunwind's table_entry struct is
relative to the unw_dyn_info_t's segbase. This presents a problem
for us in conjunction with using LLVM's MCJIT because it likes to
spread text sections and the corresponding eh_frame sections quite
far apart. This represents my attempt to support this use case in the
simplest manner that is backwards compatible, by adding a new format
kind (UNW_INFO_FORMAT_REMOTE_TABLE2) that indicates that the
`start_ip_offset` should be interpreted as relative to `start_ip`
rather than segbase.
2015-09-15 12:18:30 -07:00
Arun Sharma 781d5d5263 One time whitespace fixup.
for f in $(find src include -name '*.[ch]'); do
  expand -t 8 $f > $tmp; mv $tmp $f;
done
2014-09-27 09:47:23 -07:00
Konstantin Belousov dbce594d33 Correct name returned by get_proc_name() for some frames.
Fix returning the name of the function containing the frame PC,
for the non-interrupted frames.  The symbol lookup code should
take use_prev_instr value into account, otherwise it could return
the name of the function adjacent to the caller.
2014-08-15 13:01:40 -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 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 5e7e890a0b Plug in `ALIAS' attribute 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 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
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
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 e2962af9d3 Implement a cheaper getcontext()
Since the fast unwinding code path doesn't need the full context,
a faster target dependent getcontext is implemented.

Signed-off-by: Lassi Tuura <lat@cern.ch>
2011-04-05 22:07:05 -07:00
Lassi Tuura 5f38f35d5d Drop a call frame in tdep_trace and avoid a call to unw_step.
Dropping the extra frame for unw_backtrace itself using unw_step is
approximately 15% slower than skipping the frame in tdep_trace.  So
drop the frame in the latter, and make the function a private
implementation detail for libunwind, not an exported interface.

Also moves unw_getcontext call back into unw_backtrace to avoid an
extra call frame in case slow_backtrace does not get inlined into
unw_backtrace.
2011-04-01 00:00:39 -07:00
Lassi Tuura 50bc12afba Export unw_backtrace() and alias backtrace() to it. 2011-04-01 00:00:33 -07:00
Arun Sharma 2f9b04e9c2 Mark slow_backtrace() ALWAYS_INLINE
Also fix Makefile.am so remote unwinding tests such Gtest-trace
don't link with the local unwind library (libunwind.a).
2011-03-31 22:58:07 -07:00
Arun Sharma 7ff83c051e Fix up compilation and test failures 2011-03-24 23:32:25 -07:00
Lassi Tuura 44a14d1364 Integrate fast trace into backtrace(). 2011-03-24 22:33:55 -07:00
Konstantin Belousov 093855f12a Remove unneeded includes of sys/types.h 2010-03-08 00:25:22 +02:00
Konstantin Belousov 3eabce18b1 Include sys/types.h when needed. 2010-03-06 16:43:39 +02:00
Daniel Jacobowitz 3842dac733 Add initial ARM and MIPS support. To support this, also enable the
reading of .debug_frame sections (used in lieu of .eh_frame sections
when they're not available).
2008-02-04 17:16:37 -07:00
David Mosberger-Tang f5cb2c52dc 2007-12-14 Mark Wielaard <mwielaard@redhat.com>
* src/mi/Gget_reg.c (unw_get_reg): Use tdep_get_ip() when
   looking for UNW_REG_IP.
2008-01-07 15:43:42 -07:00
David Mosberger-Tang 1a0af36731 Fix forgotten copyright year update. 2006-07-26 15:48:48 -06:00
David Mosberger-Tang 6a89d40236 Fix missed "tdep.h" -> "libunwind_i.h" conversions. 2006-07-26 15:44:23 -06:00
David Mosberger-Tang 69d85f7c14 Restore mi/Ldyn-remote.c. 2006-07-26 15:10:48 -06:00
David Mosberger-Tang ca69fee8bb Merge ../libunwind-v0.98
Conflicts:

	include/dwarf_i.h
	include/x86/jmpbuf.h
	include/x86_64/jmpbuf.h
	src/hppa/init.h
	src/mi/Gget_fpreg.c
	src/mi/Gset_fpreg.c
	src/mi/strerror.c
2006-07-25 21:41:43 -06:00
David Mosberger-Tang f176ad6fc6 Bring git v0.98.5 tree in sync with released v0.98.5.
Sadly, the conversion from Bitkeeper -> CVS -> git wasn't perfect.  Or
so it seems.
2006-07-25 21:32:28 -06:00
hp.com!davidm 97b483dcaa Drop include of "mempool.h", which causes problems in the kernel, due to
a conflicting <linux/mempool.h>.
(SOS_MEMORY_SIZE): Move to libunwind_i.h.

(Logical change 1.295)
2005-05-20 11:28:16 +00:00
hp.com!davidm d9e100753f Include "libunwind_i.h" instead of "tdep.h".
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 07b01ad205 Include "libunwind_i.h" instead of "tdep.h" and "internal.h".
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 670dd57e82 Include "libunwind_i.h" instead of "libunwind.h" and a whole bunch of standard
header files.
Use lock_release instead of mutex_unlock/sigprocmask calls.

(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 5724bee8c2 Include "libunwind_i.h" instead of "internal.h".
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 71acf1d00e Don't include <stdlib.h>.
Include "libunwind_i.h" instead of "tdep.h".

(Logical change 1.294)
2005-05-20 09:48:08 +00:00
mostang.com!davidm 7fbb8a9593 Adjust for sigset_t to intrmask_t renaming.
(Logical change 1.290)
2005-05-03 09:13:17 +00:00
hp.com!davidm b38691980f (sos_alloc): Fix soslock vs. sos_lock typo.
2005/02/23 14:40:44-08:00 mostang.com!davidm
Adjust for sigset_t to intrmask_t renaming.

(Logical change 1.290)
2005-05-03 09:13:17 +00:00
hp.com!davidm 15df8b804c (_ReadSLEB): Fix typo: shift needs to be increment before checking
for loop-exit.  Otherwise, sign-extension may clobber the
	most recently read 7 bits.

(Logical change 1.284)
2005-02-19 06:15:20 +00:00
hp.com!davidm d15f52662a (local_find_proc_info): When compiling for libunwind-ia64, declare
_U_dyn_info_list_addr as weak and if it remained undefined,
	return -UNW_ENOINFO.

(Logical change 1.282)
2004-11-16 18:47:39 +00:00
bea.com!thallgre 0f818455ce Initial revision 2004-08-18 15:16:46 +00:00
bea.com!thallgre 48cc8c5712 (Logical change 1.245) 2004-08-18 15:16:46 +00:00
mostang.com!davidm 58badbb339 (add_memory): Rephrase for-loop conditional to avoid bug in Intel-compiler
which gets triggered with -O3 -ip.

(Logical change 1.212)
2004-04-22 22:36:53 +00:00
mostang.com!davidm db24e76397 (mi_init): Use assertion instead of relying on compiler-optimization
to verify that unw_cursor_t is big enough to contain a
	cursor.

(Logical change 1.207)
2004-04-20 23:46:44 +00:00
hp.com!davidm 36c7442db3 (Logical change 1.205) 2004-04-20 16:53:44 +00:00
hp.com!davidm 662957d585 Initial revision 2004-04-20 16:53:44 +00:00
hp.com!davidm 36e094230c (intern_string): Cast buf-pointer to int8_t* to shut up Intel
compiler warning.

(Logical change 1.205)
2004-04-20 16:53:44 +00:00
mostang.com!davidm fe9d715071 (get_proc_name): Minor whitespace fixes.
(Logical change 1.199)
2004-03-31 07:38:06 +00:00
hp.com!davidm 14e36a6a51 Rename: src/backtrace.c -> src/mi/backtrace.c
(Logical change 1.192)
2004-03-30 01:56:19 +00:00
hp.com!davidm 3a95b3c641 Initial revision 2004-03-30 01:56:19 +00:00