vic/drivers/shared_all/src/vic_log.c
void
print_trace(void)
{
    void  *array[50];
    size_t size;
    char **strings;
    size_t i;

    size = backtrace(array, 50);
    strings = backtrace_symbols(array, size);

    /* Note: we are ignoring the first and last stack frame
       the first is this function, the last is the linker, neither are
       particularly useful */
    fprintf(LOG_DEST,
            "---------------------------------------------------------------------------\n");
    fprintf(LOG_DEST, "Traceback (most recent call last):\n");
    for (i = size - 2; i > 0; i--) {
        fprintf(LOG_DEST, "%s\n", strings[i]);
    }

    free(strings);
}
/******************************************************************************
 * @brief    Print traceback for current error position
 *****************************************************************************/
@brief    Print traceback for current error position
@brief Print traceback for current error position
void
print_trace(void)
{
    void  *array[50];
    size_t size;
    char **strings;
    size_t i;
    size = backtrace(array, 50);
    strings = backtrace_symbols(array, size);
    fprintf(LOG_DEST,
            "---------------------------------------------------------------------------\n");
    fprintf(LOG_DEST, "Traceback (most recent call last):\n");
    for (i = size - 2; i > 0; i--) {
        fprintf(LOG_DEST, "%s\n", strings[i]);
    }
    free(strings);
}
void print_trace ( void ) { void * array [ 50 ] ; size_t size ; char * * strings ; size_t i ; size = backtrace ( array , 50 ) ; strings = backtrace_symbols ( array , size ) ; fprintf ( LOG_DEST , " \n " ) ; fprintf ( LOG_DEST , " \n " ) ; for ( i = size - 2 ; i > 0 ; i -- ) { fprintf ( LOG_DEST , " \n " , strings [ i ] ) ; } free ( strings ) ; }
@brief    Print traceback for current error position
@brief Print traceback for current error position
/* Note: we are ignoring the first and last stack frame
       the first is this function, the last is the linker, neither are
       particularly useful */