Changeset 4f37255
- Timestamp:
- Jul 14, 2019, 11:46:01 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7dc2e57b
- Parents:
- ec72861
- Location:
- libcfa/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/interpose.cfa
rec72861 r4f37255 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at May 5 11:37:35 201813 // Update Count : 11 112 // Last Modified On : Sun Jul 14 22:57:16 2019 13 // Update Count : 116 14 14 // 15 15 … … 81 81 //============================================================================================= 82 82 83 void sigHandler_segv 84 void sigHandler_ill 85 void sigHandler_fpe 86 void sigHandler_ab ort( __CFA_SIGPARMS__ );87 void sigHandler_term 83 void sigHandler_segv( __CFA_SIGPARMS__ ); 84 void sigHandler_ill ( __CFA_SIGPARMS__ ); 85 void sigHandler_fpe ( __CFA_SIGPARMS__ ); 86 void sigHandler_abrt( __CFA_SIGPARMS__ ); 87 void sigHandler_term( __CFA_SIGPARMS__ ); 88 88 89 89 struct { … … 110 110 __cfaabi_sigaction( SIGILL , sigHandler_ill , SA_SIGINFO ); 111 111 __cfaabi_sigaction( SIGFPE , sigHandler_fpe , SA_SIGINFO ); 112 __cfaabi_sigaction( SIGABRT, sigHandler_ab ort, SA_SIGINFO | SA_RESETHAND);112 __cfaabi_sigaction( SIGABRT, sigHandler_abrt, SA_SIGINFO | SA_RESETHAND); 113 113 __cfaabi_sigaction( SIGTERM, sigHandler_term , SA_SIGINFO ); 114 114 __cfaabi_sigaction( SIGINT , sigHandler_term , SA_SIGINFO ); … … 204 204 if ( *p == '(' ) { 205 205 name = p; 206 } 207 else if ( *p == '+' ) { 206 } else if ( *p == '+' ) { 208 207 offset_begin = p; 209 } 210 else if ( *p == ')' ) { 208 } else if ( *p == ')' ) { 211 209 offset_end = p; 212 210 break; … … 223 221 224 222 __cfaabi_dbg_bits_print_nolock( "(%i) %s : %s + %s %s\n", frameNo, messages[i], name, offset_begin, offset_end); 225 } 226 // otherwise, print the whole line 227 else { 223 } else { // otherwise, print the whole line 228 224 __cfaabi_dbg_bits_print_nolock( "(%i) %s\n", frameNo, messages[i] ); 229 225 } … … 258 254 } 259 255 260 void sigHandler_ab ort( __CFA_SIGPARMS__ ) {256 void sigHandler_abrt( __CFA_SIGPARMS__ ) { 261 257 __cfaabi_backtrace(); 262 258 -
libcfa/src/iostream.cfa
rec72861 r4f37255 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 12 12:04:13201913 // Update Count : 8 1912 // Last Modified On : Sat Jul 13 08:07:59 2019 13 // Update Count : 821 14 14 // 15 15 … … 499 499 if ( ! f.flags.left ) { \ 500 500 buf[i] = '.'; buf[i + 1] = '\0'; \ 501 if ( buf[0] == ' ' ) bufbeg = 1; 501 if ( buf[0] == ' ' ) bufbeg = 1; /* decimal point within width */ \ 502 502 } else { \ 503 503 for ( i = 0; i < len && buf[i] != ' '; i += 1 ); /* trailing blank ? */ \ … … 546 546 forall( dtype ostype | ostream( ostype ) ) { 547 547 ostype & ?|?( ostype & os, _Ostream_Manip(char) f ) { 548 if ( f.base != 'c' ) { 548 if ( f.base != 'c' ) { // bespoke binary/octal/hex format 549 549 _Ostream_Manip(unsigned char) fmtuc @= { f.val, f.wd, f.pc, f.base, {'\0'} }; 550 550 fmtuc.flags.pc = f.flags.pc; … … 558 558 559 559 #define CFMTNP "% * " 560 char fmtstr[sizeof(CFMTNP)]; 560 char fmtstr[sizeof(CFMTNP)]; // sizeof includes '\0' 561 561 memcpy( &fmtstr, CFMTNP, sizeof(CFMTNP) ); 562 int star = 1; 562 int star = 1; // position before first '*' 563 563 564 564 // Insert flags into spaces before '*', from right to left. … … 566 566 fmtstr[star] = '%'; 567 567 568 fmtstr[sizeof(CFMTNP)-2] = f.base; 568 fmtstr[sizeof(CFMTNP)-2] = f.base; // sizeof includes '\0' 569 569 // printf( "%d %s\n", f.wd, &fmtstr[star] ); 570 570 fmt( os, &fmtstr[star], f.wd, f.val ); … … 631 631 else { 632 632 fprintf( stderr, "invalid Boolean constant\n" ); 633 abort(); 633 abort(); // cannot use abort stream 634 634 } // if 635 635 return is; … … 639 639 char temp; 640 640 for () { 641 fmt( is, "%c", &temp ); 641 fmt( is, "%c", &temp ); // must pass pointer through varg to fmt 642 642 // do not overwrite parameter with newline unless appropriate 643 643 if ( temp != '\n' || getANL( is ) ) { c = temp; break; } … … 773 773 if ( ! f.s ) { 774 774 // printf( "skip %s %d\n", f.scanset, f.wd ); 775 if ( f.wd == -1 ) fmt( is, f.scanset, "" ); 775 if ( f.wd == -1 ) fmt( is, f.scanset, "" ); // no input arguments 776 776 else for ( f.wd ) fmt( is, "%*c" ); 777 777 return is;
Note: See TracChangeset
for help on using the changeset viewer.