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

279 commits

Author SHA1 Message Date
Arun Sharma 2fce54102c Implement _Unwind_GetIPInfo() as required by the C++ ABI
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>
2009-04-02 22:22:05 -07:00
Arun Sharma 9607c6407c Fixup CONFIG_DEBUG_FRAME support. 2009-03-17 19:08:58 -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
Arun Sharma ff0ae70cc3 Bad pointer validation for 32 bit x86.
This corresponds to commit 649f1fb344.

Signed-off-by: Paul Pluzhnikov <ppluzhnikov@google.com>
2009-03-16 21:34:49 -07:00
Arun Sharma ef29eade44 This patch eliminates one system call per unwind by not using the
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>
2008-06-16 14:42:16 -06:00
Arun Sharma 649f1fb344 [X86-64] For local unwinding, we have a defence mechanism against
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>
2008-06-16 14:35:53 -06: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 a8be10e251 [X86] Cleanup XMM handling for x86
* 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>
2008-01-07 15:41:20 -07:00
Jose Flavio Aguilar Paulino 9ea6af8ed5 [PPC32] Make PPC32 unwinding work for real. 2007-10-08 12:33:18 -06:00
Jose Flavio Aguilar Paulino 4499bb29a6 [PPC32] First check-in to add preliminary support for Linux/PPC32. 2007-09-12 21:52:25 -06: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
David Mosberger-Tang fad8b04c9f Rebuilt configure and Makefile.in files. 2007-08-06 19:56:28 -06:00
Jose Flavio Aguilar Paulino b33021e4b2 Add PPC64 support. 2007-08-02 09:59:43 -06:00
Arun Sharma be02d9ac0d dwarf.h needs atomic_ops.h. So include it. 2006-08-16 15:39:52 -06:00
David Mosberger-Tang b3f25f65af [dwarf] Include <config.h> in dwarf.h since it's testing HAVE_ATOMIC_OPS_H.
Reported by Arun Sharma.
2006-08-10 21:44:14 -06:00
Arun Sharma (अरुण) 795529eee3 [x86-64] Add a known good address cache.
This improves the performance of Lperf-simple from 500ns to 195ns
on the avg.

Signed-off-by: Arun Sharma <arun.sharma@google.com>
2006-08-10 21:30:01 -06:00
David Mosberger-Tang 1fdb08e5fc Various fixes to get x86 to compile and work again.
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".
2006-07-26 22:36:03 -06:00
Arun Sharma 11ea1275bd [dwarf] The sword() function in Gexpr.c doesn't do what's intended.
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>
2006-07-26 22:12:10 -06:00
Arun Sharma 8cdd8bfed8 [x86-64] Make even UNW_LOCAL_ONLY accessors go through validation.
Signed-off-by: Arun Sharma <arun.sharma@google.com>
2006-07-26 21:39:46 -06:00
Arun Sharma c5dc3c150a [dwarf] Allow return address column to differ from function to function.
Signed-off-by: Andrey Veskov <Andrey.Veskov@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@google.com>
2006-07-26 21:29:50 -06:00
Arun Sharma 036cbfa020 Fix x86 compilation.
x86 needs the global_cache just like the x86-64 version.

Signed-off-by: Andrey.Veskov@intel.com
Signed-off-by: Arun Sharma <arun.sharma@google.com>
2006-07-26 21:20:59 -06:00
Arun Sharma 00db7f752a Implement a ip -> dwarf_reg_state cache.
Signed-off-by: Arun Sharma <arun.sharma@google.com>
2006-07-26 21:18:49 -06:00
David Mosberger-Tang 37be21c01e Restore more files wiped out by Bitkeeper->CVS->GIT transition. 2006-07-26 15:09:39 -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 b47b9aa232 UNW_IA64_BSP and UNW_IA64_SP are no longer read-only.
(Logical change 1.303)
2005-05-20 15:32:18 +00:00
hp.com!davidm 7a8b0ba617 (rbs_get_base): New macro.
(Logical change 1.297)
2005-05-20 13:13:07 +00: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 9d94c8f62b Rename: include/x86_64/jmpbuf.h -> include/tdep-x86_64/jmpbuf.h
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm e3ac62c5f1 Rename: include/x86_64/jmpbuf.h -> include/tdep-x86_64/jmpbuf.h
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 3a2c945244 Rename: include/x86/jmpbuf.h -> include/tdep-x86/jmpbuf.h
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm f6d4c74beb Rename: include/x86/jmpbuf.h -> include/tdep-x86/jmpbuf.h
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm e6cf7e84eb Rename: include/x86/dwarf-config.h -> include/tdep-x86/dwarf-config.h
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm d90772c868 Rename: include/x86/dwarf-config.h -> include/tdep-x86/dwarf-config.h
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 56cea5b4a9 Rename: include/ia64/script.h -> include/tdep-ia64/script.h
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 12f0ce1a39 Rename: include/ia64/script.h -> include/tdep-ia64/script.h
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 910087d5b5 Rename: include/ia64/jmpbuf.h -> include/tdep-ia64/jmpbuf.h
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm e86e18224d Rename: include/ia64/jmpbuf.h -> include/tdep-ia64/jmpbuf.h
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 983d841e64 Rename: include/hppa/jmpbuf.h -> include/tdep-hppa/jmpbuf.h
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm f8a07dfb22 Rename: include/hppa/jmpbuf.h -> include/tdep-hppa/jmpbuf.h
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 400a917a7a Rename: include/hppa/dwarf-config.h -> include/tdep-hppa/dwarf-config.h
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm c56b45e82e Rename: include/hppa/dwarf-config.h -> include/tdep-hppa/dwarf-config.h
(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 180a1ececa Initial revision 2005-05-20 09:48:08 +00:00
hp.com!davidm f9b7af51ed Include <libunwind.h> instead of "internal.h" and "mempool.h".
(dwarf_reg_state_pool): Move to dwarf_i.h.
(dwarf_cie_info_pool): Likewise.

(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 3ad4903154 Include "libunwind_i.h" instead of "tdep.h".
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)
2005-05-20 09:48:08 +00:00
hp.com!davidm ead43e8545 Include "libunwind_i.h" instead of "internal.h".
}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 59f9f6a1ac Include "libunwind_i.h" instead of "internal.h".
2005/05/19 08:11:38-07:00 hp.com!davidm
Rename: include/ia64/rse.h -> include/tdep-ia64/rse.h

(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 5e5db2dada Adjust for renaming of file.
Drop include of <libunwind.h>.
Include "script.h" instead of "ia64/script.h".

}(Logical change 1.294)
2005-05-20 09:48:08 +00:00
hp.com!davidm 0870c54c2a Adjust for renaming of file.
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)
2005-05-20 09:48:08 +00:00