History log of /ndk/sources/cxx-stl/gabi++/src/terminate.cc
Revision Date Author Comments
f24c5b7f7e0637d7dc9f3b8d15b5df50a3ecd31a 26-Dec-2013 Logan Chien <logan.chien@mediatek.com> [gabi++] Fix the default std::unexpected() handler

The default handler for std::unexpected() should delegate the function
call to std::terminate() so that the user-defined terminate handler can
get the chance to run.

This commit fixes:
- tests/device/test-stlport_shared-exception/jni/eh55.cpp
- tests/device/test-stlport_static-exception/jni/eh55.cpp

Change-Id: Ie18de8b8fc78c4af15bb7af569f0c9e9cfdb3514
429798ff636b0553e4ff3c692067718caa9c454e 26-Dec-2013 Logan Chien <logan.chien@mediatek.com> [gabi++] std::unexpected() is allowed to throw exceptions.

According to the C++ standard, std::unexpected() can throw the
exception. Thus, we should not specify the exception specifier (i.e.
noexcept) and we should not capture the exception thrown by the
user-specified unexpected handler.

Change-Id: I84a7606c1410f04cbee3e124786d07b36e138eec
bd2a9cbe1439db13a642cc55f279a1b9bb1695f0 07-Dec-2013 David 'Digit' Turner <digit@android.com> Fix GAbi++ std::unexpected() link error.

Note: std::terminate() and std::unexpected() are 'nothrow' in C++11,
but they are _not _ 'throw()' in C++98, so introduce a new
_GABIXX config macro to deal with this.

Change-Id: I3e9eab9186278c43906fdd6bce15a3d836b21957
d8a45f1d01c3b4b52f309fff81be2159e9f8d730 04-Dec-2013 David 'Digit' Turner <digit@android.com> ndk: Fix test-libc++ build with Clang.

Fixes the following:

cd tests/device/test-libc++
../../../ndk-build NDK_TOOLCHAIN_VERSION=clang

Change-Id: I0452c62ea69057483d05131ac8b40fdb7856e3a7
2319d708f6756fde7f18e0bf276715f001521c5a 30-Oct-2013 David 'Digit' Turner <digit@android.com> gabi++: Add std::get_new_handler() and __cxa_deleted_virtual()

This patch adds two missing functions to GAbi++:

- std::get_new_handler() is used to retrieve the current std::new_handler

- __cxa_deleted_virtual() is used in C++11 vtables to point to
'deleted methods'.

+ Add missing _GABIXX_NOEXCEPT and _GABIXX_NORETURN declarations.

+ Change throw() declarations into _GABIXX_NOEXCEPT, when compiling
C++11, this translates into the allegedly more efficient 'noexcept'
statement.

Change-Id: Ia5beaba8b6926372b96fa154b23bb118ab064f3e
7a9c37698a1e2cdd865b5db7b14f9781cb696da6 28-Jul-2013 David 'Digit' Turner <digit@android.com> gabi++: Fix terminate / unexpected thread-safety.

This patch makes all operations on terminate and unexpected
handlers properly thread-safe. This also marks the appropriate
functions as "noreturn".

+ Move internal <cxxabi.h> declarations to internal header
src/cxxabi_defines.h

+ Add new <gabixx_config.h> header.

+ Move some exception-specific code to src/exception.cc

+ Rename __cxxabiv1::fatalError() to __gabixx::__fatal_error() in
src/fatal_error.cc

+ Get rid of __cxa_thread_info.

Change-Id: If79bf0263cc5f0be1bbf782a7874125fd4923d17
fdf89810ae76eac8def019716322018499531410 04-Mar-2013 Albert J. Wong <ajwong@google.com> Make Hello World run with libcxx and gabi++.

This change does 2 things:

(1) Modifies gabi++ source compatible with libcxx.
(2) Adds stubs for missing libc functions needed by libcxx.

It introduces a new macro, GXXABI_LIBCXX, into gabi++ which conditionally
enables and disables functions in gabi++ to make the exported API behave
like libcxxabi's. Existing gabi++ code is also refactored to remove
symbols + APIs that shouldn't really be in namespace std.

Locale handling code has been patched to hobble along in the c-abi, but
there are TODOs.

The exception handling logic in gabi++ isn't complete, nor are the
libc stubs. Where incomplete functionality is introduced a
preprocess warning is left to indicate lack of functionality.

After this CL, it is possible to make a running Hello World using
libcxx on Android.

Change-Id: Iceafd6f8d6dead6b64320b0c0f852d579cceb34c
bfa632c0f1d1ccf590aef435c307c48b39446d8f 23-Jan-2013 WenHan Gu <Wenhan.gu@mediatek.com> [gabi++] Fix bug: Use un-exsited object in uncaught_exception.

We may call std::uncaught_exception before pthread_setspecific,
that means we should not use __cxa_get_globals_fast, since it won't get
the correct __cxa_eh_globals object. This will cause segmentation
fault at the following usage on the object.

Also, we can eliminate the redundant null pointer check since function
__cxa_get_globals will guarantee the returned value must not be NULL.

Change-Id: Ibcc177ab6da95331e212eee022f79c440cbcf821
Signed-off-by: WenHan Gu <Wenhan.gu@mediatek.com>
7ae983a6ba4bf8ed27a64c492ed5a7178e389bc8 21-Nov-2012 David 'Digit' Turner <digit@android.com> GAbi++: Improve fatal error handling.

This patch does two things to improve fatal error handling in GAbi++:

- Change the default std::terminate() implementation to crash the
current process instead of calling abort(), in order to improve
debugging. See source code comments for details.

- Introduce a new internal fatalError() function that is used to
report errors to stderr and/or the log, then call std::terminate().

+ Add missing 'exceptions' tags to LOCAL_CPP_FEATURES.

Change-Id: I7e95ddc445ec85524a5091df464802e2f0be83ff
419afd910dc325e65df10b53e99e49c1eded6d26 19-Nov-2012 WenHan Gu <Wenhan.gu@mediatek.com> Make gabi++ support C++ exception handling.

After applying this patch, we can make gabi++
support full features on C++ exception handling.

This CL has run through tests in both ndk and GCC testsuites
(196 tests total) that are related to exception handling.
It achieves the same pass rate as gnustl library does!

NDK documentation states that upstream might support exception in gabi++.
Therefore, I did this patch to achieve the goal.

Change-Id: I59a448364b35054fcd9ba6ee33ca87380090d675