diff options
author | Alexandre Oliva <oliva@adacore.com> | 2019-08-02 15:40:32 -0300 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2019-08-02 15:40:32 -0300 |
commit | ca683e3a86d081fcf43685bee840086bd4c07443 (patch) | |
tree | 24e3b703237f1bf13fc5077adc17978bf7cc0c1f /gdb/ada-lang.c | |
parent | [GOLD] PowerPC64 pc-relative TLS support (diff) | |
download | binutils-gdb-ca683e3a86d081fcf43685bee840086bd4c07443.tar.gz binutils-gdb-ca683e3a86d081fcf43685bee840086bd4c07443.tar.bz2 binutils-gdb-ca683e3a86d081fcf43685bee840086bd4c07443.zip |
support Ada EH ABI v1
A new pair of hooks used by Ada exception handlers, for correct
release of reraised exception occurrences, involves the introduction
of new v1 symbols that GDB should use when available. The older, v0
ABI remains available in newer runtimes for bootstrapping purposes
only.
for gdb/ChangeLog
* ada-lang.c (exception_support_info_v0): Renamed from...
(default_exception_support_info): ... this. Create new
definition for v1.
(ada_has_this_exception_support): Look up catch_handlers_sym.
(ada_exception_support_info_sniffer): Try v0 after default.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 7a5cc4272c6..15a7a902b82 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -11867,13 +11867,26 @@ static CORE_ADDR ada_unhandled_exception_name_addr_from_raise (void); /* The following exception support info structure describes how to implement exception catchpoints with the latest version of the - Ada runtime (as of 2007-03-06). */ + Ada runtime (as of 2019-08-??). */ static const struct exception_support_info default_exception_support_info = { "__gnat_debug_raise_exception", /* catch_exception_sym */ "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ "__gnat_debug_raise_assert_failure", /* catch_assert_sym */ + "__gnat_begin_handler_v1", /* catch_handlers_sym */ + ada_unhandled_exception_name_addr +}; + +/* The following exception support info structure describes how to + implement exception catchpoints with an earlier version of the + Ada runtime (as of 2007-03-06) using v0 of the EH ABI. */ + +static const struct exception_support_info exception_support_info_v0 = +{ + "__gnat_debug_raise_exception", /* catch_exception_sym */ + "__gnat_unhandled_exception", /* catch_exception_unhandled_sym */ + "__gnat_debug_raise_assert_failure", /* catch_assert_sym */ "__gnat_begin_handler", /* catch_handlers_sym */ ada_unhandled_exception_name_addr }; @@ -11938,8 +11951,34 @@ ada_has_this_exception_support (const struct exception_support_info *einfo) /* Make sure that the symbol we found corresponds to a function. */ if (SYMBOL_CLASS (sym) != LOC_BLOCK) - error (_("Symbol \"%s\" is not a function (class = %d)"), - SYMBOL_LINKAGE_NAME (sym), SYMBOL_CLASS (sym)); + { + error (_("Symbol \"%s\" is not a function (class = %d)"), + SYMBOL_LINKAGE_NAME (sym), SYMBOL_CLASS (sym)); + return 0; + } + + sym = standard_lookup (einfo->catch_handlers_sym, NULL, VAR_DOMAIN); + if (sym == NULL) + { + struct bound_minimal_symbol msym + = lookup_minimal_symbol (einfo->catch_handlers_sym, NULL, NULL); + + if (msym.minsym && MSYMBOL_TYPE (msym.minsym) != mst_solib_trampoline) + error (_("Your Ada runtime appears to be missing some debugging " + "information.\nCannot insert Ada exception catchpoint " + "in this configuration.")); + + return 0; + } + + /* Make sure that the symbol we found corresponds to a function. */ + + if (SYMBOL_CLASS (sym) != LOC_BLOCK) + { + error (_("Symbol \"%s\" is not a function (class = %d)"), + SYMBOL_LINKAGE_NAME (sym), SYMBOL_CLASS (sym)); + return 0; + } return 1; } @@ -11966,6 +12005,13 @@ ada_exception_support_info_sniffer (void) return; } + /* Try the v0 exception suport info. */ + if (ada_has_this_exception_support (&exception_support_info_v0)) + { + data->exception_info = &exception_support_info_v0; + return; + } + /* Try our fallback exception suport info. */ if (ada_has_this_exception_support (&exception_support_info_fallback)) { |