Пример #1
0
void vcos_pthreads_logging_assert(const char *file, const char *func, unsigned int line, const char *fmt, ...)
{
   va_list ap;
#ifdef WIN32_KERN
   UNREFERENCED_PARAMETER(file);
   UNREFERENCED_PARAMETER(func);
   UNREFERENCED_PARAMETER(line);

   va_start(ap, fmt);

   DbgPrint(fmt, ap);

   va_end(ap);

#ifdef VCOS_HAVE_BACKTRACK
   if (vcos_backtrace_self)
      vcos_backtrace_self();
#endif
   __debugbreak();
#else
   va_start(ap, fmt);
   fprintf(stderr, "assertion failure:%s:%d:%s():",
       file, line, func);
   vfprintf(stderr, fmt, ap);
   va_end(ap);
   fprintf(stderr, "\n");

#ifdef VCOS_HAVE_BACKTRACK
   if (vcos_backtrace_self)
       vcos_backtrace_self();
#endif
   abort();
#endif
}
Пример #2
0
/**
  * Call the fatal error handler.
  */
void vcos_abort(void)
{
   VCOS_ALERT("vcos_abort: Halting");

#ifdef __VIDEOCORE__
   _bkpt();
#endif

#if defined(VCOS_HAVE_BACKTRACE) && !defined(NDEBUG)
   vcos_backtrace_self();
#endif

#ifdef __VIDEOCORE__
   /* Flush the cache to help with postmortem RAM-dump debugging */
   vclib_cache_flush();
#endif

#ifdef PLATFORM_RASPBERRYPI
   extern void pattern(int);
   while(1)
      pattern(8);
#endif

   /* Insert chosen fatal error handler here */
#if defined __VIDEOCORE__ && !defined(NDEBUG)
   while(1); /* allow us to attach a debugger after the fact and see where we came from. */
#else
   abort(); /* on vc this ends up in _exit_halt which doesn't give us any stack backtrace */
#endif
}
void vcos_pthreads_logging_assert(const char *file, const char *func, unsigned int line, const char *fmt, ...)
{
   va_list ap;
   va_start(ap, fmt);
   fprintf(stderr, "assertion failure:%s:%d:%s():",
           file, line, func);
   vfprintf(stderr, fmt, ap);
   va_end(ap);
   fprintf(stderr, "\n");
#ifdef VCOS_HAVE_BACKTRACE
   vcos_backtrace_self();
#endif
}
/**
  * Call the fatal error handler.
  */
void vcos_abort(void)
{
#ifdef __CC_ARM
    assert(0);
    return;
#endif

#ifdef __VIDEOCORE__
   _bkpt();
#endif

#if defined(VCOS_HAVE_BACKTRACE) && !defined(NDEBUG)
   vcos_backtrace_self();
#endif

   /* Insert chosen fatal error handler here */
   abort();
}