Commit Graph

299 Commits

Author SHA1 Message Date
Dan Albert 0ed2e2f6ec Add a cmake build system.
Will add support for tests with lit in a later patch.
This does not yet support building the unwinder in src/Unwind.

llvm-svn: 212286
2014-07-03 19:35:48 +00:00
Dan Albert c67aa5403c Fix a warning about undeclared call to abort().
llvm-svn: 212232
2014-07-02 22:44:35 +00:00
Logan Chien 93a68fb0c7 Revert the LSDA change to scan_eh_tab.
This commit reverts the LSDA-related change in r211745.

The r211745 adds a new argument to scan_eh_tab(), i.e. lsda.
However, IMO, calling _Unwind_GetLanguageSpecificData() directly in
scan_eh_tab() was more intuitive and reduces several function call
to _Unwind_GetLanguageSpecificData() in __cxx_personality_v0().

llvm-svn: 212037
2014-06-30 12:35:29 +00:00
Logan Chien 05d761cf24 Silence the implicit signed/unsigned conversion warning.
llvm-svn: 211912
2014-06-27 17:17:44 +00:00
Logan Chien 92a4d51fa6 Silence unused variable and parameter warnings.
llvm-svn: 211790
2014-06-26 16:58:38 +00:00
Logan Chien 37be06a0c6 Fix linux build.
* Replace strlcpy with snprintf since strlcpy is not available
  in glibc.

* Replace __LINUX__ with __linux__.

llvm-svn: 211784
2014-06-26 13:56:23 +00:00
Logan Chien 6d3dae07ca Add missing header for _LIBUNWIND_LOG().
llvm-svn: 211775
2014-06-26 12:22:38 +00:00
Nick Kledzik 0f0cd46201 Fix building for iOS
llvm-svn: 211751
2014-06-26 00:25:33 +00:00
Nico Weber 49f09fd88a Minor libc++abi changes to make things build better with gcc.
llvm-svn: 211748
2014-06-25 23:55:37 +00:00
Nico Weber ae5438701e Update libc++abi to use the ARM EHABI unwinder from its libunwind.
llvm-svn: 211745
2014-06-25 23:52:07 +00:00
Nico Weber 97080e0c5e Land support for ARM EHABI unwinding for libunwind.
This was written by:
Albert Wong <ajwong@chromium.org>
Antoine Labour <piman@chromium.org>
Dana Jansen <danakj@chromium.org
Jonathan Roelofs <jonathan@codesourcery.com>
Nico Weber <thakis@chromium.org>

llvm-svn: 211743
2014-06-25 23:39:00 +00:00
Nico Weber af5ca95730 Start landing support for ARM EHABI unwinding.
The new code will be behind a LIBCXXABI_ARM_EHABI define (so that platforms
that don't want it can continue using e.g. SJLJ). This commit mostly just
adds the LIBCXXABI_ARM_EHABI define.

llvm-svn: 211739
2014-06-25 22:49:13 +00:00
Marshall Clow fa9fd4a09b Add a FAQ section, with a question about why the std::exception class destructors live in libc++abi
llvm-svn: 210661
2014-06-11 16:54:09 +00:00
Jonathan Roelofs 72a15cda3f Add test case for inherited exceptions
Test case written by Dana Jansens.

llvm-svn: 210129
2014-06-03 21:50:11 +00:00
Jonathan Roelofs 20f6f45c5b Add EH test case checking that handlers in noexcept functions can still unwind
llvm-svn: 209944
2014-05-31 00:25:59 +00:00
Jonathan Roelofs 75fd1b5f51 Add EH test cases corresponding to C++ ABI # 15.3.3
llvm-svn: 209943
2014-05-31 00:24:58 +00:00
Nico Weber 897f23dda8 Let libc++abi compile with gcc.
There was a single problem in cxa_demangle.cpp, where gcc would complain
`error: changes meaning of 'String'` about the line `typedef String String;`.
According to 3.3.7p2, this diagnostic is allowed (but not required, so clang
does not have to report this).

As a fix, make string_pair a template and pass String as template parameter.
This fixes the error with gcc and also removes some repetition from the code. 

No behavior change.

llvm-svn: 209909
2014-05-30 17:27:21 +00:00
Logan Chien 63488f0e4e Fix typo in comment.
llvm-svn: 208795
2014-05-14 17:16:57 +00:00
Richard Smith bd32a449e6 PR19091: Track whether we're demangling a function template specialization to
determine whether we get a mangling for a return type, rather than trying to
figure it out based on whether the mangled name ended with a '>'.

llvm-svn: 208611
2014-05-12 18:44:13 +00:00
Logan Chien dc65ab4cef Implement ARM EHABI exception handling.
This commit implements the ARM zero-cost exception handling
support for libc++abi.

llvm-svn: 208466
2014-05-10 00:42:10 +00:00
Logan Chien cc24fc546b Check exception specification with __cplusplus.
To allow the compilation with gcc, we can't use the
__has_feature(cxx_noexcept) to detect the default destructor
exception specification, which is noexcept(true) by default
in C++11.  We should use __cplusplus >= 201103L instead.

llvm-svn: 208465
2014-05-10 00:40:54 +00:00
Jonathan Roelofs 6bfee10279 Fixes more incorrect #ifs for SJ/LJ exceptions
Replaces several `#if __arm__` with `#if __USING_SJLJ_EXCEPTIONS__`.

llvm-svn: 208352
2014-05-08 19:13:16 +00:00
Jonathan Roelofs bce1e4d60e Fix broken build from r208135
llvm-svn: 208350
2014-05-08 18:48:43 +00:00
Marshall Clow 1f6f59ac37 Make libc++abi use the implementation of __numstr from libc++. No functionality change, just removal of duplicated code.
llvm-svn: 208246
2014-05-07 20:17:41 +00:00
Jonathan Roelofs 40e9842854 On single threaded systems, turn mutexes into nops
http://reviews.llvm.org/D3386

llvm-svn: 208135
2014-05-06 21:30:56 +00:00
Joerg Sonnenberger c72473d87b Try harder to get the compiler to use float registers in different
places to increase the chance of messing up any preserved registers.

llvm-svn: 207938
2014-05-04 16:31:33 +00:00
Joerg Sonnenberger e9a72d54c7 Don't use bash features.
llvm-svn: 207907
2014-05-03 12:09:55 +00:00
Nick Kledzik 326254f422 Add unwind test case that checks restoring of float registers (such as on AArch64)
llvm-svn: 207481
2014-04-29 01:08:23 +00:00
Nick Kledzik d7339b48f7 Fix cast warning
llvm-svn: 207469
2014-04-28 23:49:49 +00:00
Nick Kledzik 0c790015df Use return address register from CIE. Move DwarfInstructions::lastRestoreReg() to Register::lastDwarfRegNum().
llvm-svn: 207467
2014-04-28 23:43:21 +00:00
Nick Kledzik 4141a3bca8 No need to specialize DwarfInstructions::getCFA(). It is the same for all archs
llvm-svn: 207463
2014-04-28 23:12:37 +00:00
Nick Kledzik 0fef333dee Properly sign extend delta in compact unwind info
llvm-svn: 207170
2014-04-25 01:39:06 +00:00
Nick Kledzik f00751bfa1 Fix one missed use of DW_EH_PE_omit in r203626
llvm-svn: 207169
2014-04-25 01:35:29 +00:00
Nick Kledzik 49fdc41b21 Remove unused/obsolete ARM64 constants
llvm-svn: 207064
2014-04-24 02:33:46 +00:00
Dan Albert 5f60710f2b Fix virtual class with non-virtual dtor complaint
Fixes compiler complaint about:
src/Unwind/UnwindCursor.hpp:366:25: error: 'libunwind::AbstractUnwindCursor' has virtual functions but non-virtual destructor [-Werror,-Wnon-virtual-dtor]

llvm-svn: 206942
2014-04-23 04:46:46 +00:00
Dan Albert 0056c8eb01 Fixes incorrect #ifs for SJ/LJ exceptions
The was working because, given __APPLE__, _LIBUNWIND_BUILD_SJLJ_APIS was set to
__arm__, but other ARM targets not using SJ/LJ will fail to compile.

llvm-svn: 206941
2014-04-23 04:45:42 +00:00
Dan Albert c579b935c3 Fixes type of dyldInfo for glibc/bionic systems
Darwin and the BSDs define a tagged struct dl_info typedef'd as Dl_info. glibc
and bionic typedef an anonymous struct as Dl_info.

llvm-svn: 206939
2014-04-23 04:20:57 +00:00
Jonathan Roelofs 9fc137bd1d Replace bzero with memset
... so that we can use newlib as the c library.

llvm-svn: 206427
2014-04-16 23:26:55 +00:00
Nick Kledzik 0f64d66304 Properly sign extend sdata2/4 in unwinder. Patch by Patrick Wildt
llvm-svn: 206122
2014-04-12 23:22:52 +00:00
Nick Kledzik 74ebf58742 Properly conditionalize DwarfFDECache<A>::dyldUnloadHook. Patch by Patrick Wildt
llvm-svn: 206121
2014-04-12 22:11:11 +00:00
Logan Chien aacc1c76f9 Code cleanup and re-indent cxa_exception.hpp
llvm-svn: 206108
2014-04-12 11:56:41 +00:00
Joerg Sonnenberger 7955feb82f The content of .eh_frame may be misaligned, so use memcpy. This is seen
in the wild on SH3.

llvm-svn: 205756
2014-04-08 11:43:49 +00:00
Joerg Sonnenberger fd0d20fae7 Include stdlib.h for getenv when !NDEBUG.
llvm-svn: 205573
2014-04-03 22:00:08 +00:00
Joerg Sonnenberger dfd7c9f324 Simplify.
llvm-svn: 204292
2014-03-20 01:28:28 +00:00
Joerg Sonnenberger 1ed1a3d994 Fix DW_CFA_GNU_args_size handling. The primary architecture using this
opcode is VAX. A function call pushes the number of arguments given onto
the stack and "ret" will pop it automatically. The FDE of the caller
contains the amount of stack space used for arguments (and possibly
extra padding), so unwinding has to compensate for this when "returning"
from a function. This is exactly the case when step() is done. The
existing handling in unw_set_reg no longer makes sense.

llvm-svn: 204290
2014-03-20 01:23:55 +00:00
Joerg Sonnenberger 59155e79cc 0 is a valid LSDA encoding and can be seen in statically linked
programs. Initialize lsdaEncoding to DW_EH_PE_omit and check for that
value to decide whether a value should be decoded.

llvm-svn: 203626
2014-03-11 23:43:43 +00:00
Anders Carlsson 3e107b3bd8 Demangle Dc to decltype(auto) as per the Itanium C++ ABI spec.
llvm-svn: 201533
2014-02-17 21:56:01 +00:00
Jonathan Roelofs c5f7e6fe67 [libcxxabi] Fix broken codesourcery.com links in comments
review: http://llvm-reviews.chandlerc.com/D2718
llvm-svn: 201208
2014-02-12 04:49:09 +00:00
Marshall Clow d230a3d1f6 Fix PR17221 - can't catch virtual base classes when throwing derived NULL pointers. Specifically, libc++abi would crash when you tried it.
llvm-svn: 200904
2014-02-06 04:47:02 +00:00
Marshall Clow 176be6fed5 Fix PR17222 - catching derived classes from thrown null pointer. Adds tests, too
llvm-svn: 200864
2014-02-05 18:19:57 +00:00