Patchwork [Ada] Enable debug info generation for Postcondition procedures

login
register
mail settings
Submitter Arnaud Charlet
Date June 14, 2010, 10:10 a.m.
Message ID <20100614101050.GA13577@adacore.com>
Download mbox | patch
Permalink /patch/55510/
State New
Headers show

Comments

Arnaud Charlet - June 14, 2010, 10:10 a.m.
Implicitly generated postcondition procedures are now marked as requiring
debug info, for improved support for decision coverage analysis.

No simple test available.

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

2010-06-14  Gary Dismukes  <dismukes@adacore.com>

	* sem_ch6.adb (Analyze_Subprogram_Body_Helper): Set Debug_Info_Needed
	on the entity of an implicitly generated postcondition procedure.

Patch

Index: sem_ch6.adb
===================================================================
--- sem_ch6.adb	(revision 160713)
+++ sem_ch6.adb	(working copy)
@@ -2030,10 +2030,13 @@ 
          end if;
       end if;
 
-      --  Mark presence of postcondition proc in current scope
+      --  Mark presence of postcondition procedure in current scope and mark
+      --  the procedure itself as needing debug info. The latter is important
+      --  when analyzing decision coverage (for example, for MC/DC coverage).
 
       if Chars (Body_Id) = Name_uPostconditions then
          Set_Has_Postconditions (Current_Scope);
+         Set_Debug_Info_Needed (Body_Id);
       end if;
 
       --  Place subprogram on scope stack, and make formals visible. If there