Return TypeFunction nameArguments
voidCatchCtrlC(int,)

Declared in file: hzProcess.h
Defined in file : hzProcess.cpp

Function Logic:

0:START 1:getpid pid pthread_self tid backtrace nSize backtrace_symbols cpSym GetThreadLogger pLog GetThreadInfo phz 2:!pLog 3:printf printf printf nIndex 4:nIndex 5:puts 6:printf fflush hzProcess::StackTrace 7:hzLogger::Log hzLogger::Out hzLogger::Out nIndex 8:nIndex 9:hzLogger::Out 10:hzProcess::StackTrace hzLogger::Out 11:sig==2 12:signal 13:signal 14: No text

Function body:

void CatchCtrlC (int sig)
{
   hzLogger*   pLog ;
   hzProcess*  phz ;
   void*       pvArr[1024];
   char**      cpSym ;
   uint32_t    pid ;
   uint32_t    tid ;
   uint32_t    nSize ;
   uint32_t    nIndex ;
   pid = getpid() ;
   tid = pthread_self() ;
   nSize = backtrace(pvArr, 1023);
   cpSym = backtrace_symbols(pvArr, nSize);
   pLog = GetThreadLogger() ;
   phz = GetThreadInfo() ;
   if (!pLog)
   {
       printf("CatchCtrlC: %s\n", s_signals[sig]) ;
       printf("CatchCtrlC: Signal %d Process %u, thread %u\n", sig, pid, tid) ;
       printf("Stack Trace is:\n") ;
       for (nIndex = 0; nIndex < nSize ; nIndex++)
           puts(cpSym[nIndex]);;
       printf("Stack Trace end:\n") ;
       fflush(stdout);
       phz->StackTrace() ;
   }
   else
   {
       pLog->Log("CatchCtrlC: %s\n", s_signals[sig]) ;
       pLog->Out("Signal %d Process %u, thread %u\n", sig, pid, tid) ;
       pLog->Out("Stack Trace is:\n") ;
       for (nIndex = 0; nIndex < nSize ; nIndex++)
           pLog->Out("%s\n", cpSym[nIndex]) ;
       phz->StackTrace() ;
       pLog->Out("Stack Trace end:\n") ;
   }
   if (sig == 2)
       signal(sig, 0);
   else
       signal(sig, CatchCtrlC);
}