MCPcopy Create free account
hub / github.com/Singular/Singular / dReportError

Function dReportError

libpolys/reporter/dError.cc:44–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42{
43
44int dReportError(const char* fmt, ...)
45{
46#if 0
47#ifdef HAVE_EXECINFO_H
48#define SIZE 50
49 void *buffer[SIZE+1]; int ret;
50#endif
51#endif
52
53 va_list ap;
54 va_start(ap, fmt);
55#ifndef MAKE_DISTRIBUTION
56 fprintf(stderr, "\n// ***dError: ");
57 vfprintf(stderr, fmt, ap);
58#if !defined(OM_NDEBUG)
59 #ifdef omPrintCurrentBackTraceMax
60 fprintf(stderr, " occurred at: \n");
61 omPrintCurrentBackTraceMax(stderr, 8);
62 #endif
63#endif
64
65#if 0
66#ifdef HAVE_EXECINFO_H
67 ret = backtrace( buffer, SIZE ); // execinfo.h
68 fprintf(stderr, "\nExecinfo backtrace (with %zd stack frames): \n", ret);
69
70#ifndef HAVE_GCC_ABI_DEMANGLE
71 backtrace_symbols_fd(buffer, ret, STDERR_FILENO); // execinfo.h
72#else
73 char **ptr = backtrace_symbols( buffer, ret ); // execinfo.h
74
75 int status;
76 char *demangledName;
77 char *s;
78 char *ss;
79 for (int i = 0; i < ret; i++)
80 {
81 status = -1;
82
83 s = ptr[i];
84// fprintf (stderr, " #%02d: %s\n", i, s);
85
86 ss = index(s, '(');
87 ss[0] = 0;
88 fprintf (stderr, " #%02d: '%s': ", i, s);
89 ss[0] = '('; s = ss + 1;
90
91 ss = index(s, '+');
92
93 if ( ss != NULL )
94 {
95 ss[0] = 0;
96 demangledName = abi::__cxa_demangle( s, NULL, NULL, &status ); // cxxabi.h!
97 if( status == 0 && demangledName != NULL )
98 fprintf (stderr, " '%s'", (demangledName[0] != 0)? demangledName: s);
99 else
100 fprintf (stderr, " '%s'", s);
101

Callers 15

DBTestFunction · 0.85
id_DBTestFunction · 0.85
id_DBLmTestFunction · 0.85
kbTest_iFunction · 0.85
kbTestFunction · 0.85
naDBTestFunction · 0.85
p_Merge_q__TFunction · 0.85
p_ProcsSetFunction · 0.85
gnc_ReduceSpolyOldFunction · 0.85
gnc_CreateSpolyOldFunction · 0.85
sca_p_Mult_mmFunction · 0.85
sca_pp_Mult_mmFunction · 0.85

Calls 4

indexFunction · 0.85
malloc_freeFunction · 0.85
dErrorBreakFunction · 0.85

Tested by

no test coverage detected