Changes in libcfa/src/interpose.cfa [5ccee64:851fd92]
- File:
-
- 1 edited
-
libcfa/src/interpose.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/interpose.cfa
r5ccee64 r851fd92 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Feb 17 10:18:53202013 // Update Count : 1 6612 // Last Modified On : Fri Mar 13 17:35:37 2020 13 // Update Count : 178 14 14 // 15 15 16 16 #include <stdarg.h> // va_start, va_end 17 #include <stdio.h> 17 18 #include <string.h> // strlen 18 19 #include <unistd.h> // _exit, getpid … … 143 144 void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); 144 145 void abort( bool signalAbort, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )); 146 void __abort( bool signalAbort, const char fmt[], va_list args ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )); 145 147 146 148 extern "C" { … … 152 154 va_list argp; 153 155 va_start( argp, fmt ); 154 abort( false, fmt, argp );156 __abort( false, fmt, argp ); 155 157 va_end( argp ); 156 158 } … … 218 220 } 219 221 220 void abort( bool signalAbort, const char fmt[], ... ) { 222 // Cannot forward va_list. 223 void __abort( bool signalAbort, const char fmt[], va_list args ) { 221 224 void * kernel_data = kernel_abort(); // must be done here to lock down kernel 222 225 int len; … … 228 231 229 232 assert( fmt ); 230 va_list args;231 va_start( args, fmt );232 233 233 len = vsnprintf( abort_text, abort_text_size, fmt, args ); 234 va_end( args );235 234 __cfaabi_bits_write( STDERR_FILENO, abort_text, len ); 236 235 237 236 if ( fmt[strlen( fmt ) - 1] != '\n' ) { // add optional newline if missing at the end of the format text 238 __cfaabi_ dbg_write("\n", 1 );237 __cfaabi_bits_write( STDERR_FILENO, "\n", 1 ); 239 238 } // if 240 239 kernel_abort_msg( kernel_data, abort_text, abort_text_size ); … … 248 247 va_list args; 249 248 va_start( args, fmt ); 250 abort( false, fmt, args ); 249 __abort( false, fmt, args ); 250 // CONTROL NEVER REACHES HERE! 251 251 va_end( args ); 252 } 253 254 void abort( bool signalAbort, const char fmt[], ... ) { 255 va_list args; 256 va_start( args, fmt ); 257 __abort( signalAbort, fmt, args ); 258 // CONTROL NEVER REACHES HERE! 259 va_end( args ); 252 260 } 253 261
Note:
See TracChangeset
for help on using the changeset viewer.