Version 1.1 of ais/ai-00282.txt

Unformatted version of ais/ai-00282.txt version 1.1
Other versions for file ais/ai-00282.txt

!standard 10.03 (00)          01-12-26 AI95-00282/01
!class amendment 01-12-26
!status work item 01-12-26
!status received 01-12-11
!priority Low
!difficulty Medium
!subject Ada unit information symbols
!summary
(TBD.)
!problem
When trying to trace an Ada program, there exists no reliable means to precisely know which part of the code emits a particular trace.
!proposal
Create a special package where calls to its functions are replaced at compile time by the corresponding values.
package Ada.Compilation_Unit is -- Returns the name of the file function File_Name return String;
-- Returns the line number where its call is made function Line_Number return String; function Line_Number return Natural;
-- Returns the full Ada path of the enclosing scope function Scope_Path return String;
-- Returns the Ada simple name of the enclosing scope function Scope_Name return String;
end Ada.Compilation_Unit;
!discussion
This is a common problem. Some existing Ada compilers provide some of the desired information by various means, but a standard solution would be preferable.
!example
!ACATS test
!appendix

!topic Ada unit information symbols
!reference RM95-10.1.1
!from Bernard Maudry
!discussion

When trying to trace an Ada program, there exists no reliable mean to precisely
know which part of the code emits a particular trace.

I propose to create a special package where calls to its functions are replaced
at compile time by the corresponding values.

package Ada.Compilation_Unit is
  -- Returns the name of the file
  function File_Name return String;

  -- Returns the line number where its call is made
  function Line_Number return String;
  function Line_Number return Natural;

  -- Returns the full Ada path of the enclosing scope
  function Scope_Path return String;

  -- Returns the Ada simple name of the enclosing scope
  function Scope_Name return String;

end Ada.Compilation_Unit;

*************************************************************

From: David C. Hoos, Sr.
Date: December 18, 2001 10:17 AM

Another nice addition to a package such as this would
be the date and time it was compiled, and the compiler
switches used.

*************************************************************


Questions? Ask the ACAA Technical Agent