Changeset 6bfe5cc
- Timestamp:
- Feb 5, 2018, 11:49:56 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 5f95b5f
- Parents:
- 43bbdf3
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/driver/cfa.cc
r43bbdf3 r6bfe5cc 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 1 22:26:10201813 // Update Count : 16 312 // Last Modified On : Mon Feb 5 22:05:28 2018 13 // Update Count : 166 14 14 // 15 15 … … 258 258 #endif 259 259 260 args[nargs] = "-Xlinker"; 261 nargs += 1; 262 args[nargs] = "--undefined=__cfaabi_dbg_bits_write"; 263 nargs += 1; 264 args[nargs] = "-Xlinker"; 265 nargs += 1; 266 args[nargs] = "--undefined=__cfaabi_interpose_startup"; 267 nargs += 1; 268 260 269 // include the cfa library in case it's needed 261 270 args[nargs] = "-L" CFA_LIBDIR; … … 273 282 args[nargs] = "-lrt"; 274 283 nargs += 1; 275 args[nargs] = "-Xlinker"; 276 nargs += 1; 277 args[nargs] = "--undefined=__cfaabi_dbg_bits_write"; 278 nargs += 1; 279 args[nargs] = "-Xlinker"; 280 nargs += 1; 281 args[nargs] = "--undefined=__cfaabi_interpose_startup"; 282 nargs += 1; 283 284 } // if 285 #endif //HAVE_LIBCFA 284 } // if 285 #endif // HAVE_LIBCFA 286 286 287 287 // Add exception flags (unconditionally) … … 333 333 nargs += 1; 334 334 } // if 335 336 args[nargs] = "-Xlinker"; // used by backtrace 337 nargs += 1; 338 args[nargs] = "-export-dynamic"; 339 nargs += 1; 335 340 336 341 // execute the compilation command -
src/libcfa/interpose.c
r43bbdf3 r6bfe5cc 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 21 22:27:33 201713 // Update Count : 1 12 // Last Modified On : Mon Feb 5 23:40:04 2018 13 // Update Count : 17 14 14 // 15 15 … … 32 32 #include "bits/signal.h" 33 33 #include "startup.h" 34 35 void __cfaabi_interpose_startup(void) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) ));36 34 37 35 typedef void (*generic_fptr_t)(void); … … 92 90 void sigHandler_abort( __CFA_SIGPARMS__ ); 93 91 94 void __cfaabi_interpose_startup() { 95 const char *version = NULL; 96 97 INIT_REALRTN( abort, version ); 98 INIT_REALRTN( exit, version ); 99 100 __kernel_sigaction( SIGSEGV, sigHandler_segv , SA_SIGINFO ); // Failure handler 101 __kernel_sigaction( SIGBUS , sigHandler_segv , SA_SIGINFO ); // Failure handler 102 __kernel_sigaction( SIGABRT, sigHandler_abort, SA_SIGINFO ); // Failure handler 92 extern "C" { 93 void __cfaabi_interpose_startup(void) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) )); 94 void __cfaabi_interpose_startup( void ) { 95 const char *version = NULL; 96 97 INIT_REALRTN( abort, version ); 98 INIT_REALRTN( exit, version ); 99 100 __kernel_sigaction( SIGSEGV, sigHandler_segv , SA_SIGINFO ); // Failure handler 101 __kernel_sigaction( SIGBUS , sigHandler_segv , SA_SIGINFO ); // Failure handler 102 __kernel_sigaction( SIGABRT, sigHandler_abort, SA_SIGINFO ); // Failure handler 103 } 103 104 } 104 105 … … 108 109 109 110 extern "C" { 110 void abort (void) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) {111 void abort( void ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) { 111 112 abortf( NULL ); 112 113 } 113 114 114 void exit (int __status) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) {115 void exit( int __status ) __attribute__ ((__nothrow__, __leaf__, __noreturn__)) { 115 116 libc_exit(__status); 116 117 } … … 121 122 } 122 123 123 void * kernel_abort ( void) __attribute__ ((__nothrow__, __leaf__, __weak__)) { return NULL; }124 void kernel_abort_msg( void * data, char * buffer, int size) __attribute__ ((__nothrow__, __leaf__, __weak__)) {}124 void * kernel_abort ( void ) __attribute__ ((__nothrow__, __leaf__, __weak__)) { return NULL; } 125 void kernel_abort_msg( void * data, char * buffer, int size ) __attribute__ ((__nothrow__, __leaf__, __weak__)) {} 125 126 126 127 enum { abort_text_size = 1024 }; … … 133 134 int len; 134 135 135 if ( fmt ) {136 if ( fmt ) { 136 137 va_list args; 137 138 va_start( args, fmt ); … … 142 143 143 144 __cfaabi_dbg_bits_write( abort_text, len ); 144 __cfaabi_dbg_bits_write( "\n", 1 );145 //__cfaabi_dbg_bits_write( "\n", 1 ); 145 146 } 146 147 … … 162 163 enum { Frames = 50 }; 163 164 void * array[Frames]; 164 int size = backtrace( array, Frames );165 size_t size = backtrace( array, Frames ); 165 166 char ** messages = backtrace_symbols( array, size ); 166 167 … … 176 177 177 178 for ( char *p = messages[i]; *p; ++p ) { 179 //__cfaabi_dbg_bits_print_nolock( "X %s\n", p); 178 180 // find parantheses and +offset 179 181 if ( *p == '(' ) {
Note: See TracChangeset
for help on using the changeset viewer.