Commit 2ed5b748 by Arnaud Charlet

[multiple changes]

2012-07-12  Javier Miranda  <miranda@adacore.com>

	* exp_ch3.adb (Make_Neq_Body): Fix typo in comment.

2012-07-12  Eric Botcazou  <ebotcazou@adacore.com>

	* tb-gcc.c (trace_callback): On IA-64/HP-UX, use workaround only
	if USE_LIBUNWIND_EXCEPTIONS is defined.
	* init.c: Further tweaks for IA-64/HP-UX.

2012-07-12  Tristan Gingold  <gingold@adacore.com>

	* raise-gcc.c: Do not include unwind-dw2-fde.h. Adjust comments.
	(db_region_for): Second argument is ip.  Do not recompute ip.
	(action_kind): Remove typedef, add unhandler enum const.
	(action_descriptor): Adjust type of kind field.
	(db_action_for): Second argument is ip, do not recompute it.
	(get_call_site_action_for): First argument is call_site, do not
	recompute it.  Remove useless return.
	(is_handled_by): Now return enum action_kind.
	Handle GNAT_ALL_OTHERS first.
	Return unhandler for GNAT_UNHANDLED_OTHERS.
	(get_action_description_for): First argument is now ip, do not
	recompute it.  Adjust code for call to is_handled_by.
	(__gnat_notify_unhandled_exception): Add prototype.
	(PERSONALITY_FUNCTION): Call get_ip_from_context.  Adjust calls.
	Handle unhandler case.
	(__gnat_cleanupunwind_handler): Add comments, add
	ATTRIBUTE_UNUSED on arguments.
	(__gnat_Unwind_RaiseException, __gnat_Unwind_ForcedUnwind): Define
	only once.
	* raise.h: Makes struct Exception_Data opaque.

From-SVN: r189433
parent cd20e505
2012-07-12 Javier Miranda <miranda@adacore.com>
* exp_ch3.adb (Make_Neq_Body): Fix typo in comment.
2012-07-12 Eric Botcazou <ebotcazou@adacore.com>
* tb-gcc.c (trace_callback): On IA-64/HP-UX, use workaround only
if USE_LIBUNWIND_EXCEPTIONS is defined.
* init.c: Further tweaks for IA-64/HP-UX.
2012-07-12 Tristan Gingold <gingold@adacore.com>
* raise-gcc.c: Do not include unwind-dw2-fde.h. Adjust comments.
(db_region_for): Second argument is ip. Do not recompute ip.
(action_kind): Remove typedef, add unhandler enum const.
(action_descriptor): Adjust type of kind field.
(db_action_for): Second argument is ip, do not recompute it.
(get_call_site_action_for): First argument is call_site, do not
recompute it. Remove useless return.
(is_handled_by): Now return enum action_kind.
Handle GNAT_ALL_OTHERS first.
Return unhandler for GNAT_UNHANDLED_OTHERS.
(get_action_description_for): First argument is now ip, do not
recompute it. Adjust code for call to is_handled_by.
(__gnat_notify_unhandled_exception): Add prototype.
(PERSONALITY_FUNCTION): Call get_ip_from_context. Adjust calls.
Handle unhandler case.
(__gnat_cleanupunwind_handler): Add comments, add
ATTRIBUTE_UNUSED on arguments.
(__gnat_Unwind_RaiseException, __gnat_Unwind_ForcedUnwind): Define
only once.
* raise.h: Makes struct Exception_Data opaque.
2012-07-12 Robert Dewar <dewar@adacore.com> 2012-07-12 Robert Dewar <dewar@adacore.com>
* make.adb, sem_ch9.adb, prj.adb, s-rident.ads, snames.ads-tmpl: Minor * make.adb, sem_ch9.adb, prj.adb, s-rident.ads, snames.ads-tmpl: Minor
......
...@@ -8204,7 +8204,7 @@ package body Exp_Ch3 is ...@@ -8204,7 +8204,7 @@ package body Exp_Ch3 is
-- otherwise, the inherited or predefined subprogram is called, see -- otherwise, the inherited or predefined subprogram is called, see
-- (RM 8.5.4(8)) -- (RM 8.5.4(8))
-- Stage 1: Search for a renaming of the unequality primitive and also -- Stage 1: Search for a renaming of the inequality primitive and also
-- search for an overriding of the equality primitive located before the -- search for an overriding of the equality primitive located before the
-- renaming declaration. -- renaming declaration.
......
...@@ -304,8 +304,10 @@ __gnat_install_handler (void) ...@@ -304,8 +304,10 @@ __gnat_install_handler (void)
#include <signal.h> #include <signal.h>
#include <sys/ucontext.h> #include <sys/ucontext.h>
#if defined(__ia64__) #if defined (IN_RTS) && defined (__ia64__)
#include <sys/uc_access.h> #include <sys/uc_access.h>
#define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE #define HAVE_GNAT_ADJUST_CONTEXT_FOR_RAISE
void void
...@@ -318,7 +320,7 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext) ...@@ -318,7 +320,7 @@ __gnat_adjust_context_for_raise (int signo ATTRIBUTE_UNUSED, void *ucontext)
__uc_get_ip (uc, &ip); __uc_get_ip (uc, &ip);
__uc_set_ip (uc, ip + 1); __uc_set_ip (uc, ip + 1);
} }
#endif /* __ia64__ */ #endif /* IN_RTS && __ia64__ */
/* Tasking and Non-tasking signal handler. Map SIGnal to Ada exception /* Tasking and Non-tasking signal handler. Map SIGnal to Ada exception
propagation after the required low level adjustments. */ propagation after the required low level adjustments. */
...@@ -331,9 +333,7 @@ __gnat_error_handler (int sig, ...@@ -331,9 +333,7 @@ __gnat_error_handler (int sig,
struct Exception_Data *exception; struct Exception_Data *exception;
const char *msg; const char *msg;
#if defined(__ia64__)
__gnat_adjust_context_for_raise (sig, ucontext); __gnat_adjust_context_for_raise (sig, ucontext);
#endif
switch (sig) switch (sig)
{ {
......
...@@ -81,7 +81,6 @@ extern void __gnat_setup_current_excep (_Unwind_Exception *); ...@@ -81,7 +81,6 @@ extern void __gnat_setup_current_excep (_Unwind_Exception *);
extern void __gnat_unhandled_except_handler (_Unwind_Exception *); extern void __gnat_unhandled_except_handler (_Unwind_Exception *);
#include "dwarf2.h" #include "dwarf2.h"
#include "unwind-dw2-fde.h"
#include "unwind-pe.h" #include "unwind-pe.h"
/* The known and handled exception classes. */ /* The known and handled exception classes. */
...@@ -426,7 +425,7 @@ db_phases (int phases) ...@@ -426,7 +425,7 @@ db_phases (int phases)
| |
+--> get_region_description_for (context) +--> get_region_description_for (context)
| |
+--> get_action_description_for (context, exception, region) +--> get_action_description_for (ip, exception, region)
| | | |
| +--> get_call_site_action_for (context, region) | +--> get_call_site_action_for (context, region)
| (one version for each underlying scheme) | (one version for each underlying scheme)
...@@ -514,15 +513,11 @@ get_ip_from_context (_Unwind_Context *uw_context) ...@@ -514,15 +513,11 @@ get_ip_from_context (_Unwind_Context *uw_context)
} }
static void static void
db_region_for (region_descriptor *region, _Unwind_Context *uw_context) db_region_for (region_descriptor *region, _Unwind_Ptr ip)
{ {
_Unwind_Ptr ip;
if (! (db_accepted_codes () & DB_REGIONS)) if (! (db_accepted_codes () & DB_REGIONS))
return; return;
ip = get_ip_from_context (uw_context);
db (DB_REGIONS, "For ip @ %p => ", (void *)ip); db (DB_REGIONS, "For ip @ %p => ", (void *)ip);
if (region->lsda) if (region->lsda)
...@@ -607,7 +602,7 @@ get_region_description_for (_Unwind_Context *uw_context, ...@@ -607,7 +602,7 @@ get_region_description_for (_Unwind_Context *uw_context,
/* Describe an action to be taken when propagating an exception up to /* Describe an action to be taken when propagating an exception up to
some context. */ some context. */
typedef enum enum action_kind
{ {
/* Found some call site base data, but need to analyze further /* Found some call site base data, but need to analyze further
before being able to decide. */ before being able to decide. */
...@@ -620,8 +615,12 @@ typedef enum ...@@ -620,8 +615,12 @@ typedef enum
cleanup, cleanup,
/* There is a handler for the exception in this context. */ /* There is a handler for the exception in this context. */
handler handler,
} action_kind;
/* There is a handler for the exception, but it is only for catching
unhandled exceptions. */
unhandler
};
/* filter value for cleanup actions. */ /* filter value for cleanup actions. */
static const int cleanup_filter = 0; static const int cleanup_filter = 0;
...@@ -629,7 +628,7 @@ static const int cleanup_filter = 0; ...@@ -629,7 +628,7 @@ static const int cleanup_filter = 0;
typedef struct typedef struct
{ {
/* The kind of action to be taken. */ /* The kind of action to be taken. */
action_kind kind; enum action_kind kind;
/* A pointer to the action record entry. */ /* A pointer to the action record entry. */
const unsigned char *table_entry; const unsigned char *table_entry;
...@@ -645,10 +644,8 @@ typedef struct ...@@ -645,10 +644,8 @@ typedef struct
} action_descriptor; } action_descriptor;
static void static void
db_action_for (action_descriptor *action, _Unwind_Context *uw_context) db_action_for (action_descriptor *action, _Unwind_Ptr ip)
{ {
_Unwind_Ptr ip = get_ip_from_context (uw_context);
db (DB_ACTIONS, "For ip @ %p => ", (void *)ip); db (DB_ACTIONS, "For ip @ %p => ", (void *)ip);
switch (action->kind) switch (action->kind)
...@@ -691,12 +688,10 @@ db_action_for (action_descriptor *action, _Unwind_Context *uw_context) ...@@ -691,12 +688,10 @@ db_action_for (action_descriptor *action, _Unwind_Context *uw_context)
#define __builtin_eh_return_data_regno(x) x #define __builtin_eh_return_data_regno(x) x
static void static void
get_call_site_action_for (_Unwind_Context *uw_context, get_call_site_action_for (_Unwind_Ptr call_site,
region_descriptor *region, region_descriptor *region,
action_descriptor *action) action_descriptor *action)
{ {
_Unwind_Ptr call_site = get_ip_from_context (uw_context);
/* call_site is a direct index into the call-site table, with two special /* call_site is a direct index into the call-site table, with two special
values : -1 for no-action and 0 for "terminate". The latter should never values : -1 for no-action and 0 for "terminate". The latter should never
show up for Ada. To test for the former, beware that _Unwind_Ptr might show up for Ada. To test for the former, beware that _Unwind_Ptr might
...@@ -705,17 +700,16 @@ get_call_site_action_for (_Unwind_Context *uw_context, ...@@ -705,17 +700,16 @@ get_call_site_action_for (_Unwind_Context *uw_context,
if ((int)call_site < 0) if ((int)call_site < 0)
{ {
action->kind = nothing; action->kind = nothing;
return;
} }
else if (call_site == 0) else if (call_site == 0)
{ {
db (DB_ERR, "========> Err, null call_site for Ada/sjlj\n"); db (DB_ERR, "========> Err, null call_site for Ada/sjlj\n");
action->kind = nothing; action->kind = nothing;
return;
} }
else else
{ {
_uleb128_t cs_lp, cs_action; _uleb128_t cs_lp, cs_action;
const unsigned char *p = region->call_site_table;
/* Let the caller know there may be an action to take, but let it /* Let the caller know there may be an action to take, but let it
determine the kind. */ determine the kind. */
...@@ -725,13 +719,13 @@ get_call_site_action_for (_Unwind_Context *uw_context, ...@@ -725,13 +719,13 @@ get_call_site_action_for (_Unwind_Context *uw_context,
made of leb128 values, the encoding length of which is variable. We made of leb128 values, the encoding length of which is variable. We
can't merely compute an offset from the index, then, but have to read can't merely compute an offset from the index, then, but have to read
all the entries before the one of interest. */ all the entries before the one of interest. */
p = region->call_site_table;
const unsigned char *p = region->call_site_table; do
{
do { p = read_uleb128 (p, &cs_lp);
p = read_uleb128 (p, &cs_lp); p = read_uleb128 (p, &cs_action);
p = read_uleb128 (p, &cs_action); }
} while (--call_site); while (--call_site);
action->landing_pad = cs_lp + 1; action->landing_pad = cs_lp + 1;
...@@ -739,20 +733,17 @@ get_call_site_action_for (_Unwind_Context *uw_context, ...@@ -739,20 +733,17 @@ get_call_site_action_for (_Unwind_Context *uw_context,
action->table_entry = region->action_table + cs_action - 1; action->table_entry = region->action_table + cs_action - 1;
else else
action->table_entry = 0; action->table_entry = 0;
return;
} }
} }
#else /* !__USING_SJLJ_EXCEPTIONS__ */ #else /* !__USING_SJLJ_EXCEPTIONS__ */
static void static void
get_call_site_action_for (_Unwind_Context *uw_context, get_call_site_action_for (_Unwind_Ptr ip,
region_descriptor *region, region_descriptor *region,
action_descriptor *action) action_descriptor *action)
{ {
const unsigned char *p = region->call_site_table; const unsigned char *p = region->call_site_table;
_Unwind_Ptr ip = get_ip_from_context (uw_context);
/* Unless we are able to determine otherwise... */ /* Unless we are able to determine otherwise... */
action->kind = nothing; action->kind = nothing;
...@@ -824,24 +815,28 @@ extern Exception_Code Import_Code_For (_Unwind_Ptr eid); ...@@ -824,24 +815,28 @@ extern Exception_Code Import_Code_For (_Unwind_Ptr eid);
extern Exception_Id EID_For (_GNAT_Exception * e); extern Exception_Id EID_For (_GNAT_Exception * e);
static int static enum action_kind
is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception) is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception)
{ {
if (choice == GNAT_ALL_OTHERS)
return handler;
if (propagated_exception->common.exception_class == GNAT_EXCEPTION_CLASS) if (propagated_exception->common.exception_class == GNAT_EXCEPTION_CLASS)
{ {
/* Pointer to the GNAT exception data corresponding to the propagated /* Pointer to the GNAT exception data corresponding to the propagated
occurrence. */ occurrence. */
_Unwind_Ptr E = (_Unwind_Ptr) EID_For (propagated_exception); _Unwind_Ptr E = (_Unwind_Ptr) EID_For (propagated_exception);
if (choice == GNAT_UNHANDLED_OTHERS)
return unhandler;
E = (_Unwind_Ptr) EID_For (propagated_exception);
/* Base matching rules: An exception data (id) matches itself, "when /* Base matching rules: An exception data (id) matches itself, "when
all_others" matches anything and "when others" matches anything all_others" matches anything and "when others" matches anything
unless explicitly stated otherwise in the propagated occurrence. */ unless explicitly stated otherwise in the propagated occurrence. */
if (choice == E || (choice == GNAT_OTHERS && Is_Handled_By_Others (E)))
bool is_handled = return handler;
choice == E
|| (choice == GNAT_OTHERS && Is_Handled_By_Others (E))
|| choice == GNAT_ALL_OTHERS
|| choice == GNAT_UNHANDLED_OTHERS;
/* In addition, on OpenVMS, Non_Ada_Error matches VMS exceptions, and we /* In addition, on OpenVMS, Non_Ada_Error matches VMS exceptions, and we
may have different exception data pointers that should match for the may have different exception data pointers that should match for the
...@@ -854,43 +849,44 @@ is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception) ...@@ -854,43 +849,44 @@ is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception)
# define Non_Ada_Error system__aux_dec__non_ada_error # define Non_Ada_Error system__aux_dec__non_ada_error
extern struct Exception_Data Non_Ada_Error; extern struct Exception_Data Non_Ada_Error;
is_handled |= if ((Language_For (E) == 'V'
(Language_For (E) == 'V' && choice != GNAT_OTHERS
&& choice != GNAT_OTHERS && choice != GNAT_ALL_OTHERS && ((Language_For (choice) == 'V'
&& ((Language_For (choice) == 'V' && Import_Code_For (choice) != 0 && Import_Code_For (choice) != 0
&& Import_Code_For (choice) == Import_Code_For (E)) && Import_Code_For (choice) == Import_Code_For (E))
|| choice == (_Unwind_Ptr)&Non_Ada_Error)); || choice == (_Unwind_Ptr)&Non_Ada_Error)))
return handler;
#endif #endif
return is_handled;
} }
else else
{ {
# define Foreign_Exception system__exceptions__foreign_exception; # define Foreign_Exception system__exceptions__foreign_exception
extern struct Exception_Data Foreign_Exception; extern struct Exception_Data Foreign_Exception;
return choice == GNAT_ALL_OTHERS if (choice == GNAT_ALL_OTHERS
|| choice == GNAT_OTHERS || choice == GNAT_OTHERS
|| choice == (_Unwind_Ptr)&Foreign_Exception; || choice == (_Unwind_Ptr) &Foreign_Exception)
return handler;
} }
return nothing;
} }
/* Fill out the ACTION to be taken from propagating UW_EXCEPTION up to /* Fill out the ACTION to be taken from propagating UW_EXCEPTION up to
UW_CONTEXT in REGION. */ UW_CONTEXT in REGION. */
static void static void
get_action_description_for (_Unwind_Context *uw_context, get_action_description_for (_Unwind_Ptr ip,
_Unwind_Exception *uw_exception, _Unwind_Exception *uw_exception,
_Unwind_Action uw_phase, _Unwind_Action uw_phase,
region_descriptor *region, region_descriptor *region,
action_descriptor *action) action_descriptor *action)
{ {
_GNAT_Exception * gnat_exception = (_GNAT_Exception *) uw_exception; _GNAT_Exception *gnat_exception = (_GNAT_Exception *) uw_exception;
/* Search the call site table first, which may get us a landing pad as well /* Search the call site table first, which may get us a landing pad as well
as the head of an action record list. */ as the head of an action record list. */
get_call_site_action_for (uw_context, region, action); get_call_site_action_for (ip, region, action);
db_action_for (action, uw_context); db_action_for (action, ip);
/* If there is not even a call_site entry, we are done. */ /* If there is not even a call_site entry, we are done. */
if (action->kind == nothing) if (action->kind == nothing)
...@@ -954,9 +950,9 @@ get_action_description_for (_Unwind_Context *uw_context, ...@@ -954,9 +950,9 @@ get_action_description_for (_Unwind_Context *uw_context,
matches the one we are propagating. */ matches the one we are propagating. */
_Unwind_Ptr choice = get_ttype_entry_for (region, ar_filter); _Unwind_Ptr choice = get_ttype_entry_for (region, ar_filter);
if (is_handled_by (choice, gnat_exception)) action->kind = is_handled_by (choice, gnat_exception);
if (action->kind != nothing)
{ {
action->kind = handler;
action->ttype_filter = ar_filter; action->ttype_filter = ar_filter;
return; return;
} }
...@@ -1006,6 +1002,7 @@ setup_to_install (_Unwind_Context *uw_context, ...@@ -1006,6 +1002,7 @@ setup_to_install (_Unwind_Context *uw_context,
automatic backtraces upon exception raise, as provided through the automatic backtraces upon exception raise, as provided through the
GNAT.Traceback facilities. */ GNAT.Traceback facilities. */
extern void __gnat_notify_handled_exception (void); extern void __gnat_notify_handled_exception (void);
extern void __gnat_notify_unhandled_exception (void);
/* Below is the eh personality routine per se. We currently assume that only /* Below is the eh personality routine per se. We currently assume that only
GNU-Ada exceptions are met. */ GNU-Ada exceptions are met. */
...@@ -1072,6 +1069,7 @@ PERSONALITY_FUNCTION (version_arg_t version_arg, ...@@ -1072,6 +1069,7 @@ PERSONALITY_FUNCTION (version_arg_t version_arg,
_Unwind_Action uw_phases = (_Unwind_Action) phases_arg; _Unwind_Action uw_phases = (_Unwind_Action) phases_arg;
region_descriptor region; region_descriptor region;
action_descriptor action; action_descriptor action;
_Unwind_Ptr ip;
/* Check that we're called from the ABI context we expect, with a major /* Check that we're called from the ABI context we expect, with a major
possible variation on VMS for IA64. */ possible variation on VMS for IA64. */
...@@ -1104,7 +1102,8 @@ PERSONALITY_FUNCTION (version_arg_t version_arg, ...@@ -1104,7 +1102,8 @@ PERSONALITY_FUNCTION (version_arg_t version_arg,
will tell us if there is some lsda, call_site, action and/or ttype data will tell us if there is some lsda, call_site, action and/or ttype data
for the associated ip. */ for the associated ip. */
get_region_description_for (uw_context, &region); get_region_description_for (uw_context, &region);
db_region_for (&region, uw_context); ip = get_ip_from_context (uw_context);
db_region_for (&region, ip);
/* No LSDA => no handlers or cleanups => we shall unwind further up. */ /* No LSDA => no handlers or cleanups => we shall unwind further up. */
if (! region.lsda) if (! region.lsda)
...@@ -1112,9 +1111,8 @@ PERSONALITY_FUNCTION (version_arg_t version_arg, ...@@ -1112,9 +1111,8 @@ PERSONALITY_FUNCTION (version_arg_t version_arg,
/* Search the call-site and action-record tables for the action associated /* Search the call-site and action-record tables for the action associated
with this IP. */ with this IP. */
get_action_description_for (uw_context, uw_exception, uw_phases, get_action_description_for (ip, uw_exception, uw_phases, &region, &action);
&region, &action); db_action_for (&action, ip);
db_action_for (&action, uw_context);
/* Whatever the phase, if there is nothing relevant in this frame, /* Whatever the phase, if there is nothing relevant in this frame,
unwinding should just go on. */ unwinding should just go on. */
...@@ -1137,7 +1135,10 @@ PERSONALITY_FUNCTION (version_arg_t version_arg, ...@@ -1137,7 +1135,10 @@ PERSONALITY_FUNCTION (version_arg_t version_arg,
phase starts, which ensures the stack is still intact. phase starts, which ensures the stack is still intact.
First, setup the Ada occurrence. */ First, setup the Ada occurrence. */
__gnat_setup_current_excep (uw_exception); __gnat_setup_current_excep (uw_exception);
__gnat_notify_handled_exception (); if (action.kind == unhandler)
__gnat_notify_unhandled_exception ();
else
__gnat_notify_handled_exception ();
return _URC_HANDLER_FOUND; return _URC_HANDLER_FOUND;
} }
...@@ -1157,13 +1158,16 @@ PERSONALITY_FUNCTION (version_arg_t version_arg, ...@@ -1157,13 +1158,16 @@ PERSONALITY_FUNCTION (version_arg_t version_arg,
return _URC_INSTALL_CONTEXT; return _URC_INSTALL_CONTEXT;
} }
/* Callback routine called by Unwind_ForcedUnwind to execute all the cleanup
before exiting the task. */
_Unwind_Reason_Code _Unwind_Reason_Code
__gnat_cleanupunwind_handler (int version, __gnat_cleanupunwind_handler (int version ATTRIBUTE_UNUSED,
_Unwind_Action phases, _Unwind_Action phases,
_Unwind_Exception_Class eclass, _Unwind_Exception_Class eclass ATTRIBUTE_UNUSED,
struct _Unwind_Exception *exception, struct _Unwind_Exception *exception,
struct _Unwind_Context *context, struct _Unwind_Context *context ATTRIBUTE_UNUSED,
void *arg) void *arg ATTRIBUTE_UNUSED)
{ {
/* Terminate when the end of the stack is reached. */ /* Terminate when the end of the stack is reached. */
if ((phases & _UA_END_OF_STACK) != 0 if ((phases & _UA_END_OF_STACK) != 0
...@@ -1184,46 +1188,28 @@ __gnat_cleanupunwind_handler (int version, ...@@ -1184,46 +1188,28 @@ __gnat_cleanupunwind_handler (int version,
/* Define the consistently named wrappers imported by Propagate_Exception. */ /* Define the consistently named wrappers imported by Propagate_Exception. */
#ifdef __USING_SJLJ_EXCEPTIONS__
#undef _Unwind_RaiseException
_Unwind_Reason_Code _Unwind_Reason_Code
__gnat_Unwind_RaiseException (_Unwind_Exception *e) __gnat_Unwind_RaiseException (_Unwind_Exception *e)
{ {
#ifdef __USING_SJLJ_EXCEPTIONS__
return _Unwind_SjLj_RaiseException (e); return _Unwind_SjLj_RaiseException (e);
} #else
#undef _Unwind_ForcedUnwind
_Unwind_Reason_Code
__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e,
void * handler,
void * argument)
{
return _Unwind_SjLj_ForcedUnwind (e, handler, argument);
}
#else /* __USING_SJLJ_EXCEPTIONS__ */
_Unwind_Reason_Code
__gnat_Unwind_RaiseException (_Unwind_Exception *e)
{
return _Unwind_RaiseException (e); return _Unwind_RaiseException (e);
#endif
} }
_Unwind_Reason_Code _Unwind_Reason_Code
__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e, __gnat_Unwind_ForcedUnwind (_Unwind_Exception *e,
void * handler, void *handler,
void * argument) void *argument)
{ {
#ifdef __USING_SJLJ_EXCEPTIONS__
return _Unwind_SjLj_ForcedUnwind (e, handler, argument);
#else
return _Unwind_ForcedUnwind (e, handler, argument); return _Unwind_ForcedUnwind (e, handler, argument);
#endif
} }
#endif /* __USING_SJLJ_EXCEPTIONS__ */
#ifdef __SEH__ #ifdef __SEH__
#define STATUS_USER_DEFINED (1U << 29) #define STATUS_USER_DEFINED (1U << 29)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Header File * * C Header File *
* * * *
* Copyright (C) 1992-2011, Free Software Foundation, Inc. * * Copyright (C) 1992-2012, Free Software Foundation, Inc. *
* * * *
* 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- *
...@@ -37,16 +37,7 @@ extern "C" { ...@@ -37,16 +37,7 @@ extern "C" {
typedef unsigned Exception_Code; typedef unsigned Exception_Code;
struct Exception_Data struct Exception_Data;
{
char Not_Handled_By_Others;
char Lang;
int Name_Length;
char *Full_Name, *Htable_Ptr;
Exception_Code Import_Code;
void (*Raise_Hook)(void);
};
typedef struct Exception_Data *Exception_Id; typedef struct Exception_Data *Exception_Id;
extern void _gnat_builtin_longjmp (void *, int); extern void _gnat_builtin_longjmp (void *, int);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Implementation File * * C Implementation File *
* * * *
* Copyright (C) 2004-2011, Free Software Foundation, Inc. * * Copyright (C) 2004-2012, Free Software Foundation, Inc. *
* * * *
* 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- *
...@@ -64,7 +64,7 @@ trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data) ...@@ -64,7 +64,7 @@ trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data)
{ {
char * pc; char * pc;
#if defined (__ia64__) && defined (__hpux__) #if defined (__ia64__) && defined (__hpux__) && defined (USE_LIBUNWIND_EXCEPTIONS)
/* Work around problem with _Unwind_GetIP on ia64 HP-UX. */ /* Work around problem with _Unwind_GetIP on ia64 HP-UX. */
uwx_get_reg ((struct uwx_env *) uw_context, UWX_REG_IP, (uint64_t *) &pc); uwx_get_reg ((struct uwx_env *) uw_context, UWX_REG_IP, (uint64_t *) &pc);
#else #else
......
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