76 lines
2.1 KiB
Diff
76 lines
2.1 KiB
Diff
backtrace.patch
|
|
|
|
From: Christian Prochaska <christian.prochaska@genode-labs.com>
|
|
|
|
|
|
---
|
|
gcc/diagnostic-show-locus.c | 2 ++
|
|
gcc/diagnostic.c | 11 ++++++++---
|
|
2 files changed, 10 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/gcc/diagnostic-show-locus.c b/gcc/diagnostic-show-locus.c
|
|
index 9c567bd..c307120 100644
|
|
--- a/gcc/diagnostic-show-locus.c
|
|
+++ b/gcc/diagnostic-show-locus.c
|
|
@@ -24,7 +24,9 @@ along with GCC; see the file COPYING3. If not see
|
|
#include "version.h"
|
|
#include "demangle.h"
|
|
#include "intl.h"
|
|
+#if 0
|
|
#include "backtrace.h"
|
|
+#endif
|
|
#include "diagnostic.h"
|
|
#include "diagnostic-color.h"
|
|
#include "gcc-rich-location.h"
|
|
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
|
|
index c61e0c4..fea960f 100644
|
|
--- a/gcc/diagnostic.c
|
|
+++ b/gcc/diagnostic.c
|
|
@@ -28,7 +28,9 @@ along with GCC; see the file COPYING3. If not see
|
|
#include "version.h"
|
|
#include "demangle.h"
|
|
#include "intl.h"
|
|
+#if 0
|
|
#include "backtrace.h"
|
|
+#endif
|
|
#include "diagnostic.h"
|
|
#include "diagnostic-color.h"
|
|
#include "edit-context.h"
|
|
@@ -376,7 +378,7 @@ static const char * const bt_stop[] =
|
|
};
|
|
|
|
/* A callback function passed to the backtrace_full function. */
|
|
-
|
|
+#if 0
|
|
static int
|
|
bt_callback (void *data, uintptr_t pc, const char *filename, int lineno,
|
|
const char *function)
|
|
@@ -456,7 +458,7 @@ bt_err_callback (void *data ATTRIBUTE_UNUSED, const char *msg, int errnum)
|
|
fprintf (stderr, "%s%s%s\n", msg, errnum == 0 ? "" : ": ",
|
|
errnum == 0 ? "" : xstrerror (errnum));
|
|
}
|
|
-
|
|
+#endif
|
|
/* Check if we've met the maximum error limit, and if so fatally exit
|
|
with a message. CONTEXT is the context to check, and FLUSH
|
|
indicates whether a diagnostic_finish call is needed. */
|
|
@@ -511,14 +513,17 @@ diagnostic_action_after_output (diagnostic_context *context,
|
|
case DK_ICE:
|
|
case DK_ICE_NOBT:
|
|
{
|
|
+#if 0
|
|
struct backtrace_state *state = NULL;
|
|
if (diag_kind == DK_ICE)
|
|
state = backtrace_create_state (NULL, 0, bt_err_callback, NULL);
|
|
+#endif
|
|
int count = 0;
|
|
+#if 0
|
|
if (state != NULL)
|
|
backtrace_full (state, 2, bt_callback, bt_err_callback,
|
|
(void *) &count);
|
|
-
|
|
+#endif
|
|
if (context->abort_on_error)
|
|
real_abort ();
|
|
|