Skip to content

Commit 6c968fb

Browse files
committed
UA21-001 Don't change indentation when trace is not active.
Change-Id: I41d453f5debeb3c567404001f116dbde11fb25e6
1 parent 6187600 commit 6c968fb

File tree

1 file changed

+33
-9
lines changed

1 file changed

+33
-9
lines changed

src/gnatcoll-projects.adb

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,10 @@ package body GNATCOLL.Projects is
14291429

14301430
begin
14311431
if Is_Aggregate_Project (Self) then
1432-
Increase_Indent (Me, "Library file for an aggregate project");
1432+
if Active (Me) then
1433+
Increase_Indent (Me, "Library file for an aggregate project");
1434+
end if;
1435+
14331436
declare
14341437
Aggregated : Aggregated_Project_List;
14351438
P : Project_Type;
@@ -1455,7 +1458,10 @@ package body GNATCOLL.Projects is
14551458
end loop;
14561459
end;
14571460

1458-
Decrease_Indent (Me, "Done Library file for aggregate project");
1461+
if Active (Me) then
1462+
Decrease_Indent (Me, "Done Library file for aggregate project");
1463+
end if;
1464+
14591465
return;
14601466
end if;
14611467

@@ -5620,7 +5626,10 @@ package body GNATCOLL.Projects is
56205626

56215627
<<Unwind>>
56225628
-- Unwinding nested external references if any.
5623-
Increase_Indent (Me_SV, "Unwind nested external references");
5629+
if Active (Me_SV) then
5630+
Increase_Indent (Me_SV, "Unwind nested external references");
5631+
end if;
5632+
56245633
declare
56255634
Expression : Project_Node_Id;
56265635

@@ -5639,8 +5648,11 @@ package body GNATCOLL.Projects is
56395648
while Expr /= Empty_Project_Node loop
56405649
Expr := First_Term (Expr, T);
56415650
if Next_Term (Expr, T) /= Empty_Project_Node then
5642-
Decrease_Indent (Me_SV,
5643-
"Unwind terminated: Not canonical nesting");
5651+
if Active (Me_SV) then
5652+
Decrease_Indent
5653+
(Me_SV, "Unwind terminated: Not canonical nesting");
5654+
end if;
5655+
56445656
return;
56455657
end if;
56465658

@@ -5667,7 +5679,10 @@ package body GNATCOLL.Projects is
56675679
Expr := External_Default_Of (Expr, T);
56685680
Expression := Expr;
56695681
else
5670-
Decrease_Indent (Me_SV, "Unwind finished");
5682+
if Active (Me_SV) then
5683+
Decrease_Indent (Me_SV, "Unwind finished");
5684+
end if;
5685+
56715686
return;
56725687
end if;
56735688
end loop;
@@ -8327,7 +8342,10 @@ package body GNATCOLL.Projects is
83278342
Free (Self.Gnatls);
83288343
Self.Gnatls := new String'(Gnatls);
83298344

8330-
Increase_Indent (Me, "Executing " & Gnatls & " -v");
8345+
if Active (Me) then
8346+
Increase_Indent (Me, "Executing " & Gnatls & " -v");
8347+
end if;
8348+
83318349
begin
83328350
Spawn_Gnatls
83338351
(Project_Environment'Class (Self), Fd, Gnatls_Args, Errors);
@@ -8350,7 +8368,10 @@ package body GNATCOLL.Projects is
83508368
"sure they are in your ADA_PROJECT_PATH");
83518369
end if;
83528370

8353-
Decrease_Indent (Me);
8371+
if Active (Me) then
8372+
Decrease_Indent (Me);
8373+
end if;
8374+
83548375
return;
83558376
end if;
83568377

@@ -8376,7 +8397,10 @@ package body GNATCOLL.Projects is
83768397
end if;
83778398

83788399
Free (Gnatls_Args);
8379-
Decrease_Indent (Me);
8400+
8401+
if Active (Me) then
8402+
Decrease_Indent (Me);
8403+
end if;
83808404
end Set_Path_From_Gnatls;
83818405

83828406
---------------------------------

0 commit comments

Comments
 (0)