The compiler suppresses debugging information on predefined units that are
inlined in the code, because stepping into run-time units often complicates
debugging activity. We  make an exception for calls that appear in the source,
when the unit is part of the Ada hierarchy, to facilitate monitoring of storage
management.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-11-20  Ed Schonberg  <schonb...@adacore.com>

        * exp_ch6.adb (Expand_Call, Inlined_Subprogram): Do not suppress
        debugging information for a call to a predefined unit, if the
        call comes from source and the unit is in the Ada hierarchy.

Index: exp_ch6.adb
===================================================================
--- exp_ch6.adb (revision 217828)
+++ exp_ch6.adb (working copy)
@@ -3720,7 +3720,17 @@
                  (Unit_File_Name (Get_Source_Unit (Sloc (Subp))))
               and then In_Extended_Main_Source_Unit (N)
             then
-               Set_Needs_Debug_Info (Subp, False);
+               --  We make an exception for calls to the Ada hierarchy if call
+               --  comes from source, because some user applications need the
+               --  debugging information for such calls.
+
+               if Comes_From_Source (Call_Node)
+                 and then Name_Buffer (1 .. 2) = "a-"
+               then
+                  null;
+               else
+                  Set_Needs_Debug_Info (Subp, False);
+               end if;
             end if;
 
          --  Front end expansion of simple functions returning unconstrained

Reply via email to