1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <title>libc++abi spec
</title>
11 <th rowspan=
2>libc++abi Specification
</th>
12 <th colspan=
3>Completed ?
</th>
16 <th>darwin
</th><th>linux
</th><th>arm
</th>
20 <td colspan=
4 align=
"center">Memory management
</td>
26 <code>void* __cxa_allocate_exception(size_t thrown_size) throw();
</code>
30 <i>Effects:
</i> Allocates memory to hold the exception to be thrown.
31 <tt>thrown_size
</tt> is the size of the exception object. Can allocate
32 additional memory to hold private data. If memory can not be allocated, call
33 <tt>std::terminate()
</tt>.
36 <i>Returns:
</i> A pointer to the memory allocated for the exception object.
48 <code>void __cxa_free_exception(void * thrown_exception) throw();
</code>
52 <i>Effects:
</i> Frees memory allocated by
<tt>__cxa_allocate_exception
</tt>.
64 <code>void* __cxa_allocate_dependent_exception() throw();
</code>
68 <i>Effects:
</i> Allocates memory to hold a
"dependent" exception to be thrown.
69 <tt>thrown_size
</tt> is the size of the exception object. Can allocate
70 additional memory to hold private data. If memory can not be allocated, call
71 <tt>std::terminate()
</tt>.
74 <i>Returns:
</i> A pointer to the memory allocated for the exception object.
86 <code>void __cxa_free_dependent_exception (void* dependent_exception) throw();
</code>
90 <i>Effects:
</i> Frees memory allocated by
<tt>__cxa_allocate_dependent_exception
</tt>.
100 <td colspan=
4 align=
"center">Exception Handling
</td>
106 <code>void __cxa_throw(void* thrown_exception, struct std::type_info * tinfo,
107 void (*dest)(void*));
</code>
123 <code>void* __cxa_get_exception_ptr(void* exceptionObject) throw();
</code>
127 <i>Returns:
</i> The adjusted pointer to the exception object. (The adjusted
128 pointer is typically computed by the personality routine during phase
1 and
129 saved in the exception object.)
141 <code>void* __cxa_begin_catch(void* exceptionObject) throw();
</code>
148 <li>Increment's the exception's handler count.
</li>
149 <li>Places the exception on the stack of currently-caught exceptions if it is
150 not already there, linking the exception to the previous top of the stack.
</li>
151 <li>Decrements the uncaught_exception count.
</li>
154 If the initialization of the catch parameter is trivial (e,g., there is no
155 formal catch parameter, or the parameter has no copy constructor), the calls to
156 <tt>__cxa_get_exception_ptr()
</tt> and
<tt>__cxa_begin_catch()
</tt> may be
157 combined into a single call to
<tt>__cxa_begin_catch()
</tt>.
160 When the personality routine encounters a termination condition, it will call
161 <tt>__cxa_begin_catch()
</tt> to mark the exception as handled and then call
162 <tt>terminate()
</tt>, which shall not return to its caller.
165 <i>Returns:
</i> The adjusted pointer to the exception object.
177 <code>void __cxa_end_catch();
</code>
181 <i>Effects:
</i> Locates the most recently caught exception and decrements its
182 handler count. Removes the exception from the caughtÓexception stack, if the
183 handler count goes to zero. Destroys the exception if the handler count goes to
184 zero, and the exception was not re-thrown by throw. Collaboration between
185 __cxa_rethrow() and __cxa_end_catch() is necessary to handle the last point.
186 Though implementation-defined, one possibility is for __cxa_rethrow() to set a
187 flag in the handlerCount member of the exception header to mark an exception
200 <code>std::type_info* __cxa_current_exception_type();
</code>
204 <i>Returns:
</i> the type of the currently handled exception, or null if there
205 are no caught exceptions.
217 <code>void __cxa_rethrow();
</code>
221 <i>Effects:
</i> Marks the exception object on top of the caughtExceptions stack
222 (in an implementation-defined way) as being rethrown. If the caughtExceptions
223 stack is empty, it calls terminate() (see [C++FDIS] [except.throw],
15.1.8). It
224 then returns to the handler that called it, which must call __cxa_end_catch(),
225 perform any necessary cleanup, and finally call _Unwind_Resume() to continue
238 <code>void* __cxa_current_primary_exception() throw();
</code>
242 <i>Effects:
</i> Increments the ownership count of the currently handled
243 exception (if any) by one.
246 <i>Returns:
</i> the type of the currently handled exception, or null if there
247 are no caught exceptions.
259 <code>void __cxa_decrement_exception_refcount(void* primary_exception) throw();
</code>
263 <i>Effects:
</i> Decrements the ownership count of the exception by
1, and on
264 zero calls
<tt>_Unwind_DeleteException
</tt> with the exception object.
276 <code>__cxa_eh_globals* __cxa_get_globals() throw();
</code>
280 <i>Returns:
</i> A pointer to the __cxa_eh_globals structure for the current
281 thread, initializing it if necessary.
293 <code>__cxa_eh_globals* __cxa_get_globals_fast() throw();
</code>
297 <i>Requires:
</i> At least one prior call to __cxa_get_globals has been made from
301 <i>Returns:
</i> A pointer to the __cxa_eh_globals structure for the current
314 <code>void __cxa_increment_exception_refcount(void* primary_exception) throw();
</code>
318 <i>Effects:
</i> Increments the ownership count of the referenced exception.
330 <code>void __cxa_rethrow_primary_exception(void* primary_exception);
</code>
334 <i>Effects:
</i> Implements
<tt>std::rethrow_exception(exception_ptr p)
</tt>.
346 <code>bool __cxa_uncaught_exception() throw();
</code>
365 <code>_Unwind_Reason_Code __gxx_personality_v0
366 (int, _Unwind_Action, _Unwind_Exception_Class,
367 struct _Unwind_Exception *, struct _Unwind_Context *);
</code>
384 <td colspan=
4 align=
"center">Guard objects
</td>
390 <code>int __cxa_guard_acquire(uint64_t* guard_object);
</code>
394 <i>Effects:
</i> This function is called before initialization takes place. If
395 this function returns
1, either
<code>__cxa_guard_release
</code> or
396 <code>__cxa_guard_abort
</code> must be called with the same argument. The first
397 byte of the
<code>guard_object
</code> is not modified by this function.
400 On Darwin the implementation checks for deadlock.
403 <i>Returns:
</i> 1 if the initialization is not yet complete, otherwise
0.
415 <code>void __cxa_guard_release(uint64_t*);
</code>
419 <i>Effects:
</i> Sets the first byte of the guard object to a non-zero value.
420 This function is called after initialization is complete. A thread-safe
421 implementation will release the mutex acquired by __cxa_guard_acquire after
422 setting the first byte of the guard object.
434 <code>void __cxa_guard_abort(uint64_t*);
</code>
438 <i>Effects:
</i> This function is called if the initialization terminates by
439 throwing an exception.
449 <td colspan=
4 align=
"center">Vector construction and destruction
</td>
455 <code>void* __cxa_vec_new(size_t element_count,
458 void (*constructor)(void*),
459 void (*destructor)(void*) );
</code>
478 <code>void* __cxa_vec_new2(size_t element_count,
481 void (*constructor)(void*),
482 void (*destructor)(void*),
483 void* (*alloc)(size_t),
484 void (*dealloc)(void*) );
</code>
503 <code>void* __cxa_vec_new3(size_t element_count,
506 void (*constructor)(void*),
507 void (*destructor)(void*),
508 void* (*alloc)(size_t),
509 void (*dealloc)(void*, size_t) );
</code>
528 <code>void __cxa_vec_ctor(void* array_address,
529 size_t element_count,
531 void (*constructor)(void*),
532 void (*destructor)(void*) );
</code>
548 <code>void __cxa_vec_dtor(void* array_address,
549 size_t element_count,
551 void (*destructor)(void*) );
</code>
567 <code>void __cxa_vec_cleanup(void* array_address,
568 size_t element_count,
570 void (*destructor)(void*) );
</code>
586 <code>void __cxa_vec_delete(void* array_address,
589 void (*destructor)(void*) );
</code>
605 <code>void __cxa_vec_delete2(void* array_address,
608 void (*destructor)(void*),
609 void (*dealloc)(void*) );
</code>
625 <code>void __cxa_vec_delete3(void* __array_address,
628 void (*destructor)(void*),
629 void (*dealloc) (void*, size_t));
</code>
645 <code>void __cxa_vec_cctor(void* dest_array,
647 size_t element_count,
649 void (*constructor) (void*, void*),
650 void (*destructor)(void*) );
</code>
664 <td colspan=
4 align=
"center">Handlers
</td>
670 <code>void (*__cxa_new_handler)();
</code>
674 The currently installed new handler.
686 <code>void (*__cxa_terminate_handler)();
</code>
690 The currently installed terminate handler.
702 <code>void (*__cxa_unexpected_handler)();
</code>
718 <td colspan=
4 align=
"center">Utilities
</td>
724 <code>[[noreturn]] void __cxa_bad_cast()
</code>
728 <i>Effects:
</i> Throws an exception of type
<tt>bad_cast
</tt>.
740 <code>[[noreturn]] void __cxa_bad_typeid();
</code>
744 <i>Effects:
</i> Throws an exception of type
<tt>bad_typeid
</tt>.
756 <code>void __cxa_pure_virtual(void);
</code>
760 <i>Effects:
</i> Called if the user calls a non-overridden pure virtual function,
761 which has undefined behavior according to the C++ Standard. Ends the program.
773 <code>void __cxa_call_unexpected (void*) __attribute__((noreturn));
</code>
777 <i>Effects:
</i> Handles re-checking the exception specification if
778 unexpectedHandler throws, and if
<tt>bad_exception
</tt> needs to be thrown.
779 Called from the compiler.
791 <code>char* __cxa_demangle(const char* mangled_name,
814 __dynamic_cast(const void* __src_ptr,
815 const __class_type_info* __src_type,
816 const __class_type_info* __dst_type,
817 ptrdiff_t __src2dst);
</code>
836 000000000000d570 (__DATA,__const) external typeinfo for char32_t
837 000000000000cfd0 (__DATA,__const) external typeinfo for std::nullptr_t
838 000000000000d520 (__DATA,__const) external typeinfo for char16_t
839 000000000000d580 (__DATA,__const) external typeinfo for char32_t*
840 000000000000cfe0 (__DATA,__const) external typeinfo for std::nullptr_t*
841 000000000000d530 (__DATA,__const) external typeinfo for char16_t*
842 000000000000d5a0 (__DATA,__const) external typeinfo for char32_t const*
843 000000000000d000 (__DATA,__const) external typeinfo for std::nullptr_t const*
844 000000000000d550 (__DATA,__const) external typeinfo for char16_t const*
845 000000000000d190 (__DATA,__const) external typeinfo for signed char const*
846 000000000000d050 (__DATA,__const) external typeinfo for bool const*
847 000000000000d0f0 (__DATA,__const) external typeinfo for char const*
848 000000000000d4b0 (__DATA,__const) external typeinfo for double const*
849 000000000000d500 (__DATA,__const) external typeinfo for long double const*
850 000000000000d460 (__DATA,__const) external typeinfo for float const*
851 000000000000d140 (__DATA,__const) external typeinfo for unsigned char const*
852 000000000000d280 (__DATA,__const) external typeinfo for int const*
853 000000000000d2d0 (__DATA,__const) external typeinfo for unsigned int const*
854 000000000000d320 (__DATA,__const) external typeinfo for long const*
855 000000000000d370 (__DATA,__const) external typeinfo for unsigned long const*
856 000000000000d1e0 (__DATA,__const) external typeinfo for short const*
857 000000000000d230 (__DATA,__const) external typeinfo for unsigned short const*
858 000000000000cfb0 (__DATA,__const) external typeinfo for void const*
859 000000000000d0a0 (__DATA,__const) external typeinfo for wchar_t const*
860 000000000000d3c0 (__DATA,__const) external typeinfo for long long const*
861 000000000000d410 (__DATA,__const) external typeinfo for unsigned long long const*
862 000000000000d170 (__DATA,__const) external typeinfo for signed char*
863 000000000000d030 (__DATA,__const) external typeinfo for bool*
864 000000000000d0d0 (__DATA,__const) external typeinfo for char*
865 000000000000d490 (__DATA,__const) external typeinfo for double*
866 000000000000d4e0 (__DATA,__const) external typeinfo for long double*
867 000000000000d440 (__DATA,__const) external typeinfo for float*
868 000000000000d120 (__DATA,__const) external typeinfo for unsigned char*
869 000000000000d260 (__DATA,__const) external typeinfo for int*
870 000000000000d2b0 (__DATA,__const) external typeinfo for unsigned int*
871 000000000000d300 (__DATA,__const) external typeinfo for long*
872 000000000000d350 (__DATA,__const) external typeinfo for unsigned long*
873 000000000000d1c0 (__DATA,__const) external typeinfo for short*
874 000000000000d210 (__DATA,__const) external typeinfo for unsigned short*
875 000000000000cf90 (__DATA,__const) external typeinfo for void*
876 000000000000d080 (__DATA,__const) external typeinfo for wchar_t*
877 000000000000d3a0 (__DATA,__const) external typeinfo for long long*
878 000000000000d3f0 (__DATA,__const) external typeinfo for unsigned long long*
879 000000000000d160 (__DATA,__const) external typeinfo for signed char
880 000000000000d020 (__DATA,__const) external typeinfo for bool
881 000000000000d0c0 (__DATA,__const) external typeinfo for char
882 000000000000d480 (__DATA,__const) external typeinfo for double
883 000000000000d4d0 (__DATA,__const) external typeinfo for long double
884 000000000000d430 (__DATA,__const) external typeinfo for float
885 000000000000d110 (__DATA,__const) external typeinfo for unsigned char
886 000000000000d250 (__DATA,__const) external typeinfo for int
887 000000000000d2a0 (__DATA,__const) external typeinfo for unsigned int
888 000000000000d2f0 (__DATA,__const) external typeinfo for long
889 000000000000d340 (__DATA,__const) external typeinfo for unsigned long
890 000000000000d1b0 (__DATA,__const) external typeinfo for short
891 000000000000d200 (__DATA,__const) external typeinfo for unsigned short
892 000000000000cf78 (__DATA,__const) external typeinfo for void
893 000000000000d070 (__DATA,__const) external typeinfo for wchar_t
894 000000000000d390 (__DATA,__const) external typeinfo for long long
895 000000000000d3e0 (__DATA,__const) external typeinfo for unsigned long long
896 00000000000093f9 (__TEXT,__cstring) external typeinfo name for char32_t
897 0000000000009351 (__TEXT,__cstring) external typeinfo name for std::nullptr_t
898 00000000000093ed (__TEXT,__cstring) external typeinfo name for char16_t
899 0000000000009470 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__enum_type_info
900 0000000000009410 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__array_type_info
901 0000000000009290 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__class_type_info
902 00000000000094a0 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__pbase_type_info
903 00000000000094d0 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__pointer_type_info
904 0000000000009440 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__function_type_info
905 00000000000092c0 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__si_class_type_info
906 00000000000092f0 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__vmi_class_type_info
907 0000000000009320 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__fundamental_type_info
908 0000000000009500 (__TEXT,__cstring) external typeinfo name for __cxxabiv1::__pointer_to_member_type_info
909 00000000000093fc (__TEXT,__cstring) external typeinfo name for char32_t*
910 0000000000009354 (__TEXT,__cstring) external typeinfo name for std::nullptr_t*
911 00000000000093f0 (__TEXT,__cstring) external typeinfo name for char16_t*
912 0000000000009400 (__TEXT,__cstring) external typeinfo name for char32_t const*
913 0000000000009358 (__TEXT,__cstring) external typeinfo name for std::nullptr_t const*
914 00000000000093f4 (__TEXT,__cstring) external typeinfo name for char16_t const*
915 0000000000009386 (__TEXT,__cstring) external typeinfo name for signed char const*
916 0000000000009362 (__TEXT,__cstring) external typeinfo name for bool const*
917 0000000000009374 (__TEXT,__cstring) external typeinfo name for char const*
918 00000000000093e0 (__TEXT,__cstring) external typeinfo name for double const*
919 00000000000093e9 (__TEXT,__cstring) external typeinfo name for long double const*
920 00000000000093d7 (__TEXT,__cstring) external typeinfo name for float const*
921 000000000000937d (__TEXT,__cstring) external typeinfo name for unsigned char const*
922 00000000000093a1 (__TEXT,__cstring) external typeinfo name for int const*
923 00000000000093aa (__TEXT,__cstring) external typeinfo name for unsigned int const*
924 00000000000093b3 (__TEXT,__cstring) external typeinfo name for long const*
925 00000000000093bc (__TEXT,__cstring) external typeinfo name for unsigned long const*
926 000000000000938f (__TEXT,__cstring) external typeinfo name for short const*
927 0000000000009398 (__TEXT,__cstring) external typeinfo name for unsigned short const*
928 000000000000934d (__TEXT,__cstring) external typeinfo name for void const*
929 000000000000936b (__TEXT,__cstring) external typeinfo name for wchar_t const*
930 00000000000093c5 (__TEXT,__cstring) external typeinfo name for long long const*
931 00000000000093ce (__TEXT,__cstring) external typeinfo name for unsigned long long const*
932 0000000000009383 (__TEXT,__cstring) external typeinfo name for signed char*
933 000000000000935f (__TEXT,__cstring) external typeinfo name for bool*
934 0000000000009371 (__TEXT,__cstring) external typeinfo name for char*
935 00000000000093dd (__TEXT,__cstring) external typeinfo name for double*
936 00000000000093e6 (__TEXT,__cstring) external typeinfo name for long double*
937 00000000000093d4 (__TEXT,__cstring) external typeinfo name for float*
938 000000000000937a (__TEXT,__cstring) external typeinfo name for unsigned char*
939 000000000000939e (__TEXT,__cstring) external typeinfo name for int*
940 00000000000093a7 (__TEXT,__cstring) external typeinfo name for unsigned int*
941 00000000000093b0 (__TEXT,__cstring) external typeinfo name for long*
942 00000000000093b9 (__TEXT,__cstring) external typeinfo name for unsigned long*
943 000000000000938c (__TEXT,__cstring) external typeinfo name for short*
944 0000000000009395 (__TEXT,__cstring) external typeinfo name for unsigned short*
945 000000000000934a (__TEXT,__cstring) external typeinfo name for void*
946 0000000000009368 (__TEXT,__cstring) external typeinfo name for wchar_t*
947 00000000000093c2 (__TEXT,__cstring) external typeinfo name for long long*
948 00000000000093cb (__TEXT,__cstring) external typeinfo name for unsigned long long*
949 0000000000009381 (__TEXT,__cstring) external typeinfo name for signed char
950 000000000000935d (__TEXT,__cstring) external typeinfo name for bool
951 000000000000936f (__TEXT,__cstring) external typeinfo name for char
952 00000000000093db (__TEXT,__cstring) external typeinfo name for double
953 00000000000093e4 (__TEXT,__cstring) external typeinfo name for long double
954 00000000000093d2 (__TEXT,__cstring) external typeinfo name for float
955 0000000000009378 (__TEXT,__cstring) external typeinfo name for unsigned char
956 000000000000939c (__TEXT,__cstring) external typeinfo name for int
957 00000000000093a5 (__TEXT,__cstring) external typeinfo name for unsigned int
958 00000000000093ae (__TEXT,__cstring) external typeinfo name for long
959 00000000000093b7 (__TEXT,__cstring) external typeinfo name for unsigned long
960 000000000000938a (__TEXT,__cstring) external typeinfo name for short
961 0000000000009393 (__TEXT,__cstring) external typeinfo name for unsigned short
962 0000000000009348 (__TEXT,__cstring) external typeinfo name for void
963 0000000000009366 (__TEXT,__cstring) external typeinfo name for wchar_t
964 00000000000093c0 (__TEXT,__cstring) external typeinfo name for long long
965 00000000000093c9 (__TEXT,__cstring) external typeinfo name for unsigned long long
966 000000000000ce30 (__DATA,__const) external vtable for __cxxabiv1::__enum_type_info
967 000000000000cdb0 (__DATA,__const) external vtable for __cxxabiv1::__array_type_info
968 000000000000cbe0 (__DATA,__const) external vtable for __cxxabiv1::__class_type_info
969 000000000000ce70 (__DATA,__const) external vtable for __cxxabiv1::__pbase_type_info
970 000000000000cec0 (__DATA,__const) external vtable for __cxxabiv1::__pointer_type_info
971 000000000000cdf0 (__DATA,__const) external vtable for __cxxabiv1::__function_type_info
972 000000000000cc40 (__DATA,__const) external vtable for __cxxabiv1::__si_class_type_info
973 000000000000cca0 (__DATA,__const) external vtable for __cxxabiv1::__vmi_class_type_info
974 000000000000cd70 (__DATA,__const) external vtable for __cxxabiv1::__fundamental_type_info
975 000000000000cf10 (__DATA,__const) external vtable for __cxxabiv1::__pointer_to_member_type_info
977 (undefined) external ___stack_chk_fail (from libSystem)
978 (undefined) external ___stack_chk_guard (from libSystem)
979 (undefined) external ___stderrp (from libSystem)
980 (undefined) external ___strcat_chk (from libSystem)
981 (undefined) external _abort (from libSystem)
982 (undefined) external _calloc (from libSystem)
983 (undefined) external _dlsym (from libSystem)
984 (undefined) external _free (from libSystem)
985 (undefined) external _malloc (from libSystem)
986 (undefined) external _memcpy (from libSystem)
987 (undefined) external _pthread_getspecific (from libSystem)
988 (undefined) external _pthread_key_create (from libSystem)
989 (undefined) external _pthread_mutex_init (from libSystem)
990 (undefined) external _pthread_mutex_lock (from libSystem)
991 (undefined) external _pthread_mutex_unlock (from libSystem)
992 (undefined) external _pthread_mutexattr_init (from libSystem)
993 (undefined) external _pthread_mutexattr_settype (from libSystem)
994 (undefined) external _pthread_once (from libSystem)
995 (undefined) external _pthread_setspecific (from libSystem)
996 (undefined) external _realloc (from libSystem)
997 (undefined) external _strcmp (from libSystem)
998 (undefined) external _strcpy (from libSystem)
999 (undefined) external _strlen (from libSystem)
1000 (undefined) external _strncmp (from libSystem)
1001 (undefined) external _vasprintf (from libSystem)
1002 (undefined) external _vfprintf (from libSystem)
1003 (undefined) external dyld_stub_binder (from libSystem)
1004 (undefined) external __Unwind_DeleteException (from libSystem)
1005 (undefined) external __Unwind_GetIP (from libSystem)
1006 (undefined) external __Unwind_GetLanguageSpecificData (from libSystem)
1007 (undefined) external __Unwind_GetRegionStart (from libSystem)
1008 (undefined) external __Unwind_RaiseException (from libSystem)
1009 (undefined) external __Unwind_Resume_or_Rethrow (from libSystem)
1010 (undefined) external __Unwind_SetGR (from libSystem)
1011 (undefined) external __Unwind_SetIP (from libSystem)
1012 (undefined) external ___bzero (from libSystem)