76 lines
2.0 KiB
Diff
76 lines
2.0 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 bf95666..b68b700 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"
|
|
|
|
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
|
|
index 8106172..85d5eb0 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"
|
|
|
|
@@ -345,7 +347,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)
|
|
@@ -425,7 +427,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
|
|
/* Take any action which is expected to happen after the diagnostic
|
|
is written out. This function does not always return. */
|
|
void
|
|
@@ -467,14 +469,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 ();
|
|
|