Commit b278d7e5 authored by Maxime Perrotin's avatar Maxime Perrotin

Add function for debug output

parent 0a76f465
......@@ -86,7 +86,7 @@ package body TASTE.Backend.Code_Generators is
& Assoc ("Unique_Languages", Unique_Languages)
& Assoc ("ASN1_Files", Get_ASN1_File_List)
& Assoc ("ASN1_Modules", Get_Module_List);
Put_Info ("Generating global Makefile");
Put_Debug ("Generating global Makefile");
Create (File => Output_File,
Mode => Out_File,
Name => Model.Configuration.Output_Dir.Element & "/Makefile");
......@@ -122,7 +122,7 @@ package body TASTE.Backend.Code_Generators is
begin
if not F.Context_Params.Is_Empty then
Create_Path (Output_Lang);
Put_Info ("Generating " & CP_File);
Put_Debug ("Generating " & CP_File);
Create (File => Output_File,
Mode => Out_File,
Name => Output_Lang & CP_File);
......@@ -183,7 +183,7 @@ package body TASTE.Backend.Code_Generators is
-- Create directory tree (output/function/language/src)
Create_Path (Output_Dir);
if File_Name /= "" then
Put_Info ("Generating " & Output_Dir & File_Name);
Put_Debug ("Generating " & Output_Dir & File_Name);
Create (File => Output_File,
Mode => Out_File,
Name => Output_Dir & File_Name);
......@@ -191,7 +191,7 @@ package body TASTE.Backend.Code_Generators is
Close (Output_File);
end if;
if Make_File /= "" then
Put_Info ("Generating " & Make_File & " for function "
Put_Debug ("Generating " & Make_File & " for function "
& To_String (F.Name));
Create (File => Output_File,
Mode => Out_File,
......@@ -218,7 +218,7 @@ package body TASTE.Backend.Code_Generators is
Output_Base : String;
Output_Sub : String := "src/") is
begin
Put_Info ("=== Generate code with templates from " & Prefix & " ===");
Put_Debug ("== Generate code with templates from " & Prefix & " ==");
for Each of Model.Interface_View.Flat_Functions loop
-- There can be multiple folders containing templates, iterate
declare
......
......@@ -434,8 +434,11 @@ package body TASTE.Concurrency_View is
Present : constant Boolean :=
(File_Name /= ""
and then Exists (Output_Dir & "/" & File_Name));
Trig_Tmpl : constant Translate_Set :=
+Assoc ("Filename_Is_Present", Present);
CV.Configuration.To_Template
& Assoc ("Filename_Is_Present", Present);
Trigger : constant Boolean :=
(Node_Name /= "interfaceview"
and then Exists (Path & "/trigger.tmplt") and then
......
......@@ -33,6 +33,13 @@ package body TASTE.Parser_Utils is
Put_Line (Red_Bold & "[ERROR] " & White_Bold & Error & No_Color);
end Put_Error;
procedure Put_Debug (Debug : String) is
begin
if Debug_Mode then
Put_Line (White_Bold & "[DEBUG] " & No_Color & Debug & No_Color);
end if;
end Put_Debug;
procedure Banner is
The_Banner : constant String :=
Yellow_Bold & "TASTE/Kazoo" & No_Color & " (Version "
......@@ -149,6 +156,7 @@ package body TASTE.Parser_Utils is
if Version then
raise Exit_From_Command_Line;
end if;
Debug_Mode := Result.Debug_Flag;
end Parse_Command_Line;
......@@ -280,4 +288,5 @@ package body TASTE.Parser_Utils is
-- Following is needed to parse the interface view
Ocarina.FE_AADL.Parser.Add_Pre_Prop_Sets := True;
end Initialize_Ocarina;
end TASTE.Parser_Utils;
......@@ -69,6 +69,7 @@ package TASTE.Parser_Utils is
procedure Put_Info (Info : String);
procedure Put_Error (Error : String);
procedure Put_Debug (Debug : String);
procedure Banner;
......@@ -152,5 +153,6 @@ package TASTE.Parser_Utils is
-- Define a vector for template_parser translate sets
package Translate_Sets is new Indefinite_Vectors (Natural, Translate_Set);
private
Debug_Mode : Boolean := False;
end TASTE.Parser_Utils;
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- POHIC
@@-- Debug
@@-- No_Stdlib
TRUE
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- POHIC
@@-- Debug
@@-- No_Stdlib
TRUE
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- POHIC
@@-- Debug
@@-- No_Stdlib
TRUE
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- POHIC
@@-- Debug
@@-- No_Stdlib
TRUE
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- Use_POHIC
@@-- Debug
@@-- No_Stdlib
@@IF@@ not @_Use_POHIC_@
TRUE
@@END_IF@@
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- Use_POHIC
@@-- Debug
@@-- No_Stdlib
@@IF@@ not @_Use_POHIC_@
TRUE
@@END_IF@@
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- Use_POHIC
@@-- Debug_Flag
@@-- No_Stdlib
@@IF@@ not @_Use_POHIC_@
TRUE
@@END_IF@@
@@-- The following boolean tags are available to decide if the file
@@-- shall be generated or not:
@@-- Filename_Is_Present
@@-- Skeletons
@@-- Glue
@@-- Use_POHIC
@@-- Debug_Flag
@@-- No_Stdlib
@@IF@@ not @_Use_POHIC_@
TRUE
@@END_IF@@
......@@ -7,6 +7,13 @@ all: test-parse
ocarina -x main.aadl && \
make -f Makefile.taste
c: # Polyorb_HI_C output
$(KAZOO) -p --gw --glue --debug -o output_pohic && \
make -C output_pohic && \
cp obsw.pr output_pohic/obsw/SDL/src && \
cd output_pohic/concurrency_view && \
ocarina -x main.aadl && \
make -f Makefile.taste
test-parse: clean
$(KAZOO) --gw \
......@@ -14,6 +21,16 @@ test-parse: clean
--glue \
--debug
test-parse-c: clean
$(KAZOO) -p --gw \
-o output \
--glue
buildsupport_pohic:
buildsupport -o buildsupport_pohic -p --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
buildsupport_pohiada:
buildsupport -o buildsupport_ada --aadlv2 --glue -i InterfaceView.aadl -c DeploymentView.aadl -d DataView.aadl ../common/ocarina_components.aadl ../common/TASTE_IV_Properties.aadl ../common/TASTE_DV_Properties.aadl
gdb: clean
gdb --args $(KAZOO) --gw \
-o output \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment