Commit 566b591e by Olivier Hainque Committed by Arnaud Charlet

tb-gcc.c (uw_data_t, [...]): Only define if not GCC-SJLJ eh.

2007-12-06  Olivier Hainque  <hainque@adacore.com>

	* tb-gcc.c (uw_data_t, trace_callback): Only define if not GCC-SJLJ eh.
	(__gnat_backtrace): Early return 0 if using GCC-SJLJ eh.

From-SVN: r130874
parent 8236f027
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 2004-2005, AdaCore * * Copyright (C) 2004-2007, AdaCore *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
...@@ -40,6 +40,12 @@ ...@@ -40,6 +40,12 @@
tailored callback and carried-on datastructure to keep track of the tailored callback and carried-on datastructure to keep track of the
input parameters we got as well as of the basic processing state. */ input parameters we got as well as of the basic processing state. */
/******************
* trace_callback *
******************/
#if !defined (__USING_SJLJ_EXCEPTIONS__)
typedef struct { typedef struct {
void ** traceback; void ** traceback;
int max_len; int max_len;
...@@ -50,10 +56,6 @@ typedef struct { ...@@ -50,10 +56,6 @@ typedef struct {
int n_entries_filled; int n_entries_filled;
} uw_data_t; } uw_data_t;
/******************
* trace_callback *
******************/
#if defined (__ia64__) && defined (__hpux__) #if defined (__ia64__) && defined (__hpux__)
#include <uwx.h> #include <uwx.h>
#endif #endif
...@@ -85,6 +87,8 @@ trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data) ...@@ -85,6 +87,8 @@ trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data)
return _URC_NO_REASON; return _URC_NO_REASON;
} }
#endif
/******************** /********************
* __gnat_backtrace * * __gnat_backtrace *
********************/ ********************/
...@@ -94,6 +98,12 @@ __gnat_backtrace (void ** traceback, int max_len, ...@@ -94,6 +98,12 @@ __gnat_backtrace (void ** traceback, int max_len,
void * exclude_min, void * exclude_max, void * exclude_min, void * exclude_max,
int skip_frames) int skip_frames)
{ {
#if defined (__USING_SJLJ_EXCEPTIONS__)
/* We have no unwind material (tables) at hand with sjlj eh, and no
way to retrieve complete and accurate call chain information from
the context stack we maintain. */
return 0;
#else
uw_data_t uw_data; uw_data_t uw_data;
/* State carried over during the whole unwinding process. */ /* State carried over during the whole unwinding process. */
...@@ -110,4 +120,5 @@ __gnat_backtrace (void ** traceback, int max_len, ...@@ -110,4 +120,5 @@ __gnat_backtrace (void ** traceback, int max_len,
_Unwind_Backtrace ((_Unwind_Trace_Fn)trace_callback, &uw_data); _Unwind_Backtrace ((_Unwind_Trace_Fn)trace_callback, &uw_data);
return uw_data.n_entries_filled; return uw_data.n_entries_filled;
#endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment