Changes in libcfa/src/interpose.cfa [74330e7:8a13c47]
- File:
-
- 1 edited
-
libcfa/src/interpose.cfa (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/interpose.cfa
r74330e7 r8a13c47 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 8 08:40:34202013 // Update Count : 1 6312 // Last Modified On : Thu Jan 30 17:47:32 2020 13 // Update Count : 156 14 14 // 15 15 … … 29 29 #include "bits/signal.hfa" // sigHandler_? 30 30 #include "startup.hfa" // STARTUP_PRIORITY_CORE 31 #include <assert.h>32 31 33 32 //============================================================================================= … … 41 40 42 41 typedef void (* generic_fptr_t)(void); 43 generic_fptr_t interpose_symbol( const char symbol[], const char version[]) {42 generic_fptr_t interpose_symbol( const char * symbol, const char * version ) { 44 43 const char * error; 45 44 … … 146 145 extern "C" { 147 146 void abort( void ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )) { 148 abort( false, "%s", "" );147 abort( false, NULL ); // FIX ME: 0p does not work 149 148 } 150 149 … … 162 161 163 162 void * kernel_abort( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 0p; } 164 void kernel_abort_msg( void * data, char buffer[], int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {}163 void kernel_abort_msg( void * data, char * buffer, int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {} 165 164 // See concurrency/kernel.cfa for strong definition used in multi-processor mode. 166 165 int kernel_abort_lastframe( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 4; } … … 170 169 171 170 static void __cfaabi_backtrace( int start ) { 172 enum { Frames = 50, }; // maximum number of stack frames 171 enum { 172 Frames = 50, // maximum number of stack frames 173 }; 173 174 int last = kernel_abort_lastframe(); // skip last N stack frames 174 175 175 176 void * array[Frames]; 176 177 size_t size = backtrace( array, Frames ); 177 char ** messages = backtrace_symbols( array, size ); // does not demangle names178 char ** messages = backtrace_symbols( array, size ); 178 179 179 180 *index( messages[0], '(' ) = '\0'; // find executable name … … 183 184 char * name = 0p, * offset_begin = 0p, * offset_end = 0p; 184 185 185 for ( char * p = messages[i]; *p; p += 1 ) {// find parantheses and +offset186 for ( char * p = messages[i]; *p; ++p ) { // find parantheses and +offset 186 187 //__cfaabi_bits_print_nolock( "X %s\n", p); 187 188 if ( *p == '(' ) { … … 227 228 __cfaabi_bits_write( STDERR_FILENO, abort_text, len ); 228 229 229 assert( fmt ); 230 va_list args; 231 va_start( args, fmt ); 232 233 len = vsnprintf( abort_text, abort_text_size, fmt, args ); 234 va_end( args ); 235 __cfaabi_bits_write( STDERR_FILENO, abort_text, len ); 236 237 if ( fmt[strlen( fmt ) - 1] != '\n' ) { // add optional newline if missing at the end of the format text 238 __cfaabi_dbg_write( "\n", 1 ); 230 if ( fmt ) { 231 va_list args; 232 va_start( args, fmt ); 233 234 len = vsnprintf( abort_text, abort_text_size, fmt, args ); 235 va_end( args ); 236 __cfaabi_bits_write( STDERR_FILENO, abort_text, len ); 237 238 if ( fmt[strlen( fmt ) - 1] != '\n' ) { // add optional newline if missing at the end of the format text 239 __cfaabi_dbg_write( "\n", 1 ); 240 } 239 241 } 240 242
Note:
See TracChangeset
for help on using the changeset viewer.