The debugger doesn't allow stepping into a subprogram when the
subprogram has a class-wide precondition (or postcondition). The
compiler generates wrappers for such subprograms and creates a new
"class-wide clone" of the subprogram, and the Needs_Debug_Info flag
isn't set on the clone subprogram's entity.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-03 Gary Dismukes <dismu...@adacore.com>
gcc/ada/
* sem_util.adb (Build_Class_Wide_Clone_Decl): Call
Set_Debug_Info_Needed to set the Needs_Debug_Info flag on
Clone_Id if the flag is set on Spec_Id.
--- gcc/ada/sem_util.adb
+++ gcc/ada/sem_util.adb
@@ -1618,6 +1618,13 @@ package body Sem_Util is
-- wrapper call to inherited operation.
Set_Class_Wide_Clone (Spec_Id, Clone_Id);
+
+ -- Inherit debug info flag from Spec_Id to Clone_Id to allow debugging
+ -- of the class-wide clone subprogram.
+
+ if Needs_Debug_Info (Spec_Id) then
+ Set_Debug_Info_Needed (Clone_Id);
+ end if;
end Build_Class_Wide_Clone_Decl;
-----------------------------