|
tesseract
3.03
|
#include "host.h"Go to the source code of this file.
Functions | |
| void | SavePixForCrash (int resolution, Pix *pix) |
| void | signal_exit (int signal_code) |
| void | err_exit () |
| void | set_global_loc_code (int loc_code) |
| void | set_global_subloc_code (int loc_code) |
| void | set_global_subsubloc_code (int loc_code) |
| void err_exit | ( | ) |
Definition at line 74 of file globaloc.cpp.
{
ASSERT_HOST("Fatal error encountered!" == NULL);
}
| void SavePixForCrash | ( | int | resolution, |
| Pix * | pix | ||
| ) |
Definition at line 34 of file globaloc.cpp.
{
#ifdef __linux__
#ifndef ANDROID
int thread_id = syscall(SYS_gettid) % kMaxNumThreadPixes;
#else
int thread_id = gettid() % kMaxNumThreadPixes;
#endif
pixDestroy(&global_crash_pixes[thread_id]);
if (pix != NULL) {
Pix* clone = pixClone(pix);
pixSetXRes(clone, resolution);
pixSetYRes(clone, resolution);
global_crash_pixes[thread_id] = clone;
}
#endif
}
| void set_global_loc_code | ( | int | loc_code | ) |
Definition at line 79 of file globaloc.cpp.
{
// global_loc_code = loc_code;
}
| void set_global_subloc_code | ( | int | loc_code | ) |
Definition at line 85 of file globaloc.cpp.
{
// global_subloc_code = loc_code;
}
| void set_global_subsubloc_code | ( | int | loc_code | ) |
Definition at line 91 of file globaloc.cpp.
{
// global_subsubloc_code = loc_code;
}
| void signal_exit | ( | int | signal_code | ) |
Definition at line 52 of file globaloc.cpp.
{
tprintf("Received signal %d!\n", signal_code);
#ifdef __linux__
#ifndef ANDROID
int thread_id = syscall(SYS_gettid) % kMaxNumThreadPixes;
#else
int thread_id = gettid() % kMaxNumThreadPixes;
#endif
if (global_crash_pixes[thread_id] != NULL) {
fprintf(stderr, "Crash caused by image with resolution %d\n",
pixGetYRes(global_crash_pixes[thread_id]));
fprintf(stderr, "<Cut here>\n");
pixWriteStreamPng(stderr, global_crash_pixes[thread_id], 0.0);
fprintf(stderr, "\n<End cut>\n");
}
// Raise an uncaught signal, so as to get a useful stack trace.
raise(SIGILL);
#else
abort();
#endif
}