(Ada) "catch assert" spurious internal error
We noticed while debugging a program compiled without assertions
enabled and using an older compiler that inserting a catchpoint
on failed assertions would cause an internal error:
(gdb) catch assert
../../src/gdb/ada-lang.c:13321: internal-error: ada_exception_sal:
Assertion`sym != NULL' failed.
A problem internal to GDB has been detected,
This is due to a combination of factors:
1. With older versions of the compiler, the function used as a hook
was provided by a unit that's different from the unit which
provides the hooks for the other exception catchpoints.
2. The program either does not use any assertion, or is compiled
without the assertions enabled.
With newer versions of the compiler, all such functions are provided
by the same unit, so should normally always be available. However,
there can still be reasons why this is not the case. Consider, for
instance, the case of a runtime compiled with -ffunction-sections,
in which case the hook might be eliminated unless assertions are
used and enabled.
So this patch transforms the internal error into a simple error.
gdb/ChangeLog:
* ada-lang.c (ada_exception_sal): Replace gdb_assert calls
by calls to error.
No testcase added, as the existing testcase gdb.ada/catch_ex.exp
should trigger it when using an older version of GNAT as the Ada
compiler.