Ignore:
Timestamp:
Feb 8, 2020, 10:07:49 AM (21 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
arm-eh, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
3ecfa13
Parents:
3e274ab
Message:

formatting, add floating-point signal handler to cpp-cc to catch division by 0 in constant-expression evaluations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/interpose.cfa

    r3e274ab r74330e7  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  4 11:38:20 2020
    13 // Update Count     : 161
     12// Last Modified On : Sat Feb  8 08:40:34 2020
     13// Update Count     : 163
    1414//
    1515
     
    170170
    171171static void __cfaabi_backtrace( int start ) {
    172         enum {
    173                 Frames = 50,                                                                    // maximum number of stack frames
    174         };
     172        enum { Frames = 50, };                                                          // maximum number of stack frames
    175173        int last = kernel_abort_lastframe();                            // skip last N stack frames
    176174
    177175        void * array[Frames];
    178176        size_t size = backtrace( array, Frames );
    179         char ** messages = backtrace_symbols( array, size );
     177        char ** messages = backtrace_symbols( array, size ); // does not demangle names
    180178
    181179        *index( messages[0], '(' ) = '\0';                                      // find executable name
     
    185183                char * name = 0p, * offset_begin = 0p, * offset_end = 0p;
    186184
    187                 for ( char * p = messages[i]; *p; ++p ) {               // find parantheses and +offset
     185                for ( char * p = messages[i]; *p; p += 1 ) {    // find parantheses and +offset
    188186                        //__cfaabi_bits_print_nolock( "X %s\n", p);
    189187                        if ( *p == '(' ) {
     
    237235        __cfaabi_bits_write( STDERR_FILENO, abort_text, len );
    238236
    239         if ( fmt[strlen( fmt ) - 1] != '\n' ) {                 // add optional newline if missing at the end of the format text
     237        if ( fmt[strlen( fmt ) - 1] != '\n' ) {                         // add optional newline if missing at the end of the format text
    240238                __cfaabi_dbg_write( "\n", 1 );
    241239        }
Note: See TracChangeset for help on using the changeset viewer.