subtype Cond_Value_Type is Unsigned_Longword;
- -- TBK_API_PARAM as defined in TBKDEF.
+ -- TBK_API_PARAM as defined in TBKDEF
+
type Tbk_Api_Param is record
Length : Unsigned_Word;
T_Type : Unsigned_Byte;
pragma Convention (C, Tbk_Api_Param);
K_Version : constant Unsigned_Byte := 1;
- -- Current API version.
- K_Length : constant Unsigned_Word := 152;
- -- Length of the parameter.
+ -- Current API version
+
+ K_Length : constant Unsigned_Word := 152;
+ -- Length of the parameter
pragma Compile_Time_Error (Tbk_Api_Param'Size = K_Length * 8,
"Bad length for tbk_api_param");
- -- Sanity check.
+ -- Sanity check
function Symbolize (Param : Address) return Cond_Value_Type;
pragma Import (C, Symbolize, "TBK$I64_SYMBOLIZE");
Faulting_Fp => 0,
Filename_Desc => Null_Address,
Library_Module_Desc => Null_Address,
- Record_Number => Record_Number'Address,
- Image_Desc => Image_Dsc'Address,
- Module_Desc => Module_Dsc'Address,
- Routine_Desc => Routine_Dsc'Address,
- Listing_Lineno => Line_Number'Address,
- Rel_Pc => Null_Address,
- Image_Base_Addr => Null_Address,
- Module_Base_Addr => Null_Address,
- Malloc_Rtn => Null_Address,
- Free_Rtn => Null_Address,
- Symbolize_Flags => Null_Address,
- Reserved0 => (0, 0),
- Reserved1 => (0, 0),
- Reserved2 => (0, 0));
+ Record_Number => Record_Number'Address,
+ Image_Desc => Image_Dsc'Address,
+ Module_Desc => Module_Dsc'Address,
+ Routine_Desc => Routine_Dsc'Address,
+ Listing_Lineno => Line_Number'Address,
+ Rel_Pc => Null_Address,
+ Image_Base_Addr => Null_Address,
+ Module_Base_Addr => Null_Address,
+ Malloc_Rtn => Null_Address,
+ Free_Rtn => Null_Address,
+ Symbolize_Flags => Null_Address,
+ Reserved0 => (0, 0),
+ Reserved1 => (0, 0),
+ Reserved2 => (0, 0));
Status := Symbolize (Param'Address);
+ -- Check for success (marked by bit 0)
+
if (Status rem 2) = 1 then
-- Success
if Line_Number = 0 then
+
-- As GCC doesn't emit source file correlation, use record
-- number of line number is not set
Pos : Integer;
Routine_Name_D : constant String :=
- Decode_Ada_Name (Routine_Name.Buf
- (1 .. Natural (Routine_Name.Curlen)));
+ Decode_Ada_Name
+ (Routine_Name.Buf
+ (1 .. Natural (Routine_Name.Curlen)));
Lineno : constant String :=
- Unsigned_Longword'Image (Line_Number);
+ Unsigned_Longword'Image (Line_Number);
begin
Res (First .. Last) := (others => ' ');
First + 30 + Routine_Name_D'Length - 1) :=
Routine_Name_D;
- -- If routine name doesn't fit 20 characters, output
- -- the line number on next line at 50th position
+ -- If routine name doesn't fit 20 characters, output the line
+ -- number on next line at 50th position.
if Routine_Name_D'Length > 20 then
Pos := First + 30 + Routine_Name_D'Length;
Res (Last) := ASCII.LF;
Len := Last;
end;
+
+ -- Even status values
+
else
Res (Len + 1 .. Len + 6) := "ERROR" & ASCII.LF;
Len := Len + 6;
In_Tree => Data.Tree);
end case;
- Exception_List := Value_Of
- (Index => Lang,
- In_Array => Exceptions,
- In_Tree => Data.Tree);
+ Exception_List :=
+ Value_Of
+ (Index => Lang,
+ In_Array => Exceptions,
+ In_Tree => Data.Tree);
if Exception_List /= Nil_Variable_Value then
Element_Id := Exception_List.Values;
Element := Data.Tree.String_Elements.Table (Element_Id);
File_Name := Canonical_Case_File_Name (Element.Value);
- Source := Source_Files_Htable.Get
- (Data.Tree.Source_Files_HT, File_Name);
-
+ Source :=
+ Source_Files_Htable.Get
+ (Data.Tree.Source_Files_HT, File_Name);
while Source /= No_Source
- and then Source.Project /= Project
+ and then Source.Project /= Project
loop
Source := Source.Next_With_File_Name;
end loop;
Next_In_Lang : Source_Id := No_Source;
-- Link to another source of the same language in the same project
- Next_With_File_Name : Source_Id := No_Source;
+ Next_With_File_Name : Source_Id := No_Source;
-- Link to another source with the same base file name
end record;
Packages : Package_Table.Instance;
Projects : Project_List;
- Replaced_Sources : Replaced_Source_HTable.Instance;
+ Replaced_Sources : Replaced_Source_HTable.Instance;
-- The list of sources that have been replaced by sources with
-- different file names.
Units_HT : Units_Htable.Instance;
-- Unit name to Unit_Index (and from there to Source_Id)
- Source_Files_HT : Source_Files_Htable.Instance;
+ Source_Files_HT : Source_Files_Htable.Instance;
-- Base source file names to Source_Id list.
Source_Paths_HT : Source_Paths_Htable.Instance;
Imported_First : Boolean := False);
-- Call Action for each project imported directly or indirectly by project
-- By, as well as extended projects.
+ --
-- The order of processing depends on Imported_First:
- -- If False, Action is called according to the order of importation: if A
- -- imports B, directly or indirectly, Action will be called for A before
- -- it is called for B. If two projects import each other directly or
- -- indirectly (using at least one "limited with"), it is not specified
- -- for which of these two projects Action will be called first.
- -- The order is reversed if Imported_First is True.
+ --
+ -- If False, Action is called according to the order of importation: if A
+ -- imports B, directly or indirectly, Action will be called for A before
+ -- it is called for B. If two projects import each other directly or
+ -- indirectly (using at least one "limited with"), it is not specified
+ -- for which of these two projects Action will be called first.
+ --
+ -- The order is reversed if Imported_First is True
+ --
-- With_State may be used by Action to choose a behavior or to report some
-- global result.