Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

debugtrace.h File Reference

#include <signal.h>
#include <unistd.h>
#include <stdarg.h>

Go to the source code of this file.


Defines

#define TWO_ONE(x, y)   x ## y
#define TWO_TWO(x, y)   TWO_ONE(x,y)
#define DEBUG_MAX_DEPTH   1024
#define DBG_label   DBG_labels[DBG_trace]
#define MCHECK
#define MPROBE   do{ if( !DBG_trace ) (void)MCW_MALLOC_status ; } while(0)
#define TRACEBACK   DBG_traceback()
#define DBG_SIGNALS
#define DBG_LEADER_IN   "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
#define DBG_LEADER_OUT   "-----------------------------------------------------------"
#define ENTRY(rout)
#define DBROUT   DBG_rout[DBG_num-1]
#define DBEXIT
#define mainENTRY(rout)
#define PRINT_TRACING   (DBG_trace > 1)
#define STATUS(str)
#define RETURN(val)   do{ DBEXIT ; return (val) ; } while(0)
#define EXRETURN   do{ DBEXIT ; return ; } while(0)
#define EXIT(n)   do{ TRACEBACK ; exit(n) ; } while(0)
#define FATAL_ERROR_message   ERROR_exit

Functions

void DBG_sigfunc (int)
void DBG_traceback (void)
void INFO_message (char *fmt,...)
void ININFO_message (char *fmt,...)
void WARNING_message (char *fmt,...)
void ERROR_message (char *fmt,...)
void ERROR_exit (char *fmt,...)

Variables

char * DBG_rout [DEBUG_MAX_DEPTH]
int DBG_num
int DBG_trace
char * DBG_labels [3]
char last_status [1024]

Define Documentation

#define DBEXIT
 

Value:

do{ if( DBG_trace ){                                      \
                          printf("%*.*s%s [%d]: EXIT (file=%s line=%d)\n",     \
                                 DBG_num,DBG_num,DBG_LEADER_OUT,DBROUT,DBG_num, \
                                 __FILE__ , __LINE__ );                         \
                          MCHECK ; fflush(stdout) ; }                           \
                        DBG_num = (DBG_num>1) ? DBG_num-1 : 1 ;                 \
                        last_status[0] = '\0' ;                                 \
                    } while(0)

Definition at line 146 of file debugtrace.h.

#define DBG_label   DBG_labels[DBG_trace]
 

Definition at line 40 of file debugtrace.h.

#define DBG_LEADER_IN   "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
 

Definition at line 132 of file debugtrace.h.

#define DBG_LEADER_OUT   "-----------------------------------------------------------"
 

Definition at line 133 of file debugtrace.h.

#define DBG_SIGNALS
 

Value:

( signal(SIGPIPE,DBG_sigfunc) , \
                      signal(SIGSEGV,DBG_sigfunc) , \
                      signal(SIGINT ,DBG_sigfunc) , \
                      signal(SIGBUS ,DBG_sigfunc)  )

Definition at line 124 of file debugtrace.h.

#define DBROUT   DBG_rout[DBG_num-1]
 

Definition at line 144 of file debugtrace.h.

#define DEBUG_MAX_DEPTH   1024
 

Definition at line 38 of file debugtrace.h.

#define ENTRY rout   
 

Value:

do{ static char * rrr = (rout) ;  DBG_rout[DBG_num++] = rrr ; \
                        if( DBG_trace ){                                         \
                          printf("%*.*s%s [%d]: ENTRY (file=%s line=%d)\n",     \
                                 DBG_num,DBG_num,DBG_LEADER_IN,rrr,DBG_num,    \
                                 __FILE__ , __LINE__ ) ;                      \
                          MCHECK ; fflush(stdout) ; }                        \
                        last_status[0] = '\0' ;                             \
                    } while(0)

Definition at line 135 of file debugtrace.h.

#define EXIT n       do{ TRACEBACK ; exit(n) ; } while(0)
 

Definition at line 206 of file debugtrace.h.

Referenced by AFNI_make_voxwarp(), AFNI_rescan_session_OLD(), csfft_trigconsts(), EDIT_aver_fvol(), EDIT_check_argv(), EDIT_filter_volume(), EDIT_substitute_brick(), fft_3dec(), fft_4dec(), fft_5dec(), imsized_fname(), init_MCW_sizes(), main(), MAKER_4D_to_typed_fbuc(), MAKER_4D_to_typed_fim(), MAKER_4D_to_typed_fith(), mri_affine_bicubic(), mri_align_dfspace(), mri_dup2D(), mri_filt_fft(), mri_nsize(), mri_read_ascii(), mri_read_ppm3(), mri_rota(), mri_rota_bilinear(), mri_rota_shear(), mri_shift2D_bilinear(), mri_sobel(), mri_stat_seq(), mri_to_XImage(), new_MCW_bbox(), new_RT_input(), PCOR_get_coef(), PCOR_get_lsqfit(), PCOR_get_mcor(), PCOR_get_pcor(), PCOR_get_pcor_and_coef(), PCOR_get_perc(), PCOR_UPDATE(), pixar_to_XImage(), read_ascii_floats(), resize_XImage(), RT_fim_recurse(), RT_process_data(), RT_process_image(), RT_read_image(), RT_start_child(), RT_start_dataset(), RT_tell_afni_one(), shifter(), SUMA_add_nodes_ixyz(), SUMA_add_norms_xyz(), SUMA_add_triangles(), SUMA_create_empty_surface(), SUMA_make_vnlist(), THD_autonudge(), THD_get_many_timeseries(), update_PCOR_references(), and XImage_to_mri().

#define EXRETURN   do{ DBEXIT ; return ; } while(0)
 

Definition at line 205 of file debugtrace.h.

#define FATAL_ERROR_message   ERROR_exit
 

Definition at line 222 of file debugtrace.h.

#define mainENTRY rout   
 

Value:

do{ char *e=getenv("AFNI_TRACE");                                \
      if( e != NULL )                                              \
         DBG_trace = (*e=='y') ? 1 : (*e=='Y') ? 2 : 0 ;           \
      DBG_SIGNALS ; ENTRY(rout) ;                        } while(0)
This macro is only to be used inside main().

Definition at line 157 of file debugtrace.h.

Referenced by get_options(), and main().

#define MCHECK
 

Value:

do{ char * mc = MCW_MALLOC_status ;    \
        if( mc != NULL ) printf("** Memory usage: %s\n",mc) ; } while(0)

Definition at line 51 of file debugtrace.h.

#define MPROBE   do{ if( !DBG_trace ) (void)MCW_MALLOC_status ; } while(0)
 

Definition at line 55 of file debugtrace.h.

#define PRINT_TRACING   (DBG_trace > 1)
 

Definition at line 163 of file debugtrace.h.

#define RETURN val       do{ DBEXIT ; return (val) ; } while(0)
 

Definition at line 204 of file debugtrace.h.

#define STATUS str   
 

Value:

do{ if(PRINT_TRACING){                                          \
        MCHECK ;                                                   \
        printf("%*.*s%s -- %s\n",DBG_num,DBG_num," ",DBROUT,(str)); \
        fflush(stdout) ; }                                           \
      strncpy(last_status,str,1023); last_status[1023]='\0';          \
  } while(0)

Definition at line 165 of file debugtrace.h.

#define TRACEBACK   DBG_traceback()
 

Definition at line 59 of file debugtrace.h.

Referenced by AFNI_sigfunc(), and SUMA_sigfunc().

#define TWO_ONE x,
y       x ## y
 

combine two interpreted tokens into one using TWO_TWO *

Definition at line 31 of file debugtrace.h.

#define TWO_TWO x,
y       TWO_ONE(x,y)
 

Definition at line 32 of file debugtrace.h.


Function Documentation

void DBG_sigfunc int   
 

void DBG_traceback void   
 

Referenced by ISQ_show_image().

void ERROR_exit char *    fmt,
...   
 

Definition at line 76 of file debugtrace.c.

References output_message().

Referenced by CALC_read_opts(), main(), Syntax(), and THD_copy_file().

00077 {
00078    va_list vararg_ptr ;
00079    va_start( vararg_ptr , fmt ) ;
00080    output_message( "** FATAL ERROR: " , fmt , vararg_ptr ) ;
00081    va_end( vararg_ptr ) ;
00082    exit(1) ;
00083 }

void ERROR_message char *    fmt,
...   
 

Definition at line 65 of file debugtrace.c.

References output_message().

Referenced by AFNI_drive_save_jpeg(), AFNI_parse_args(), CALC_read_opts(), ISQ_save_jpeg(), and main().

00066 {
00067    va_list vararg_ptr ;
00068    va_start( vararg_ptr , fmt ) ;
00069    output_message( "** ERROR: " , fmt , vararg_ptr ) ;
00070    va_end( vararg_ptr ) ;
00071    return ;
00072 }

void INFO_message char *    fmt,
...   
 

Definition at line 32 of file debugtrace.c.

References output_message().

Referenced by AIVVV_niml_quitter(), CALC_read_opts(), GRA_file_pixmap(), identify_software(), ISQ_save_jpeg(), and main().

00033 {
00034    va_list vararg_ptr ;
00035    va_start( vararg_ptr , fmt ) ;
00036    output_message( "++ " , fmt , vararg_ptr ) ;
00037    va_end( vararg_ptr ) ;
00038    return ;
00039 }

void ININFO_message char *    fmt,
...   
 

Definition at line 43 of file debugtrace.c.

References output_message().

Referenced by mri_automask_image(), THD_mask_clust(), and THD_mask_erode().

00044 {
00045    va_list vararg_ptr ;
00046    va_start( vararg_ptr , fmt ) ;
00047    output_message( " + " , fmt , vararg_ptr ) ;
00048    va_end( vararg_ptr ) ;
00049    return ;
00050 }

void WARNING_message char *    fmt,
...   
 

Definition at line 54 of file debugtrace.c.

References output_message().

Referenced by CALC_read_opts(), and main().

00055 {
00056    va_list vararg_ptr ;
00057    va_start( vararg_ptr , fmt ) ;
00058    output_message( "++ WARNING: " , fmt , vararg_ptr ) ;
00059    va_end( vararg_ptr ) ;
00060    return ;
00061 }

Variable Documentation

char* DBG_labels[3]
 

Definition at line 118 of file debugtrace.h.

int DBG_num
 

Definition at line 116 of file debugtrace.h.

char* DBG_rout[DEBUG_MAX_DEPTH]
 

Definition at line 115 of file debugtrace.h.

int DBG_trace
 

Definition at line 117 of file debugtrace.h.

char last_status[1024]
 

Definition at line 121 of file debugtrace.h.

 

Powered by Plone

This site conforms to the following standards: