aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/debug_a.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/debug_a.adb')
-rw-r--r--gcc/ada/debug_a.adb25
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/ada/debug_a.adb b/gcc/ada/debug_a.adb
index d3a1424..8a8ccc6 100644
--- a/gcc/ada/debug_a.adb
+++ b/gcc/ada/debug_a.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -23,11 +23,12 @@
-- --
------------------------------------------------------------------------------
-with Atree; use Atree;
-with Debug; use Debug;
-with Sinfo; use Sinfo;
-with Sinput; use Sinput;
-with Output; use Output;
+with Atree; use Atree;
+with Debug; use Debug;
+with Sinfo; use Sinfo;
+with Sinfo.Nodes; use Sinfo.Nodes;
+with Sinput; use Sinput;
+with Output; use Output;
package body Debug_A is
@@ -46,6 +47,12 @@ package body Debug_A is
-- recursion levels, we just don't reset the right value on exit, which
-- is not crucial, since this is only for debugging.
+ -- Note that Current_Error_Node must be maintained unconditionally (not
+ -- only when Debug_Flag_A is True), because we want to print a correct sloc
+ -- in bug boxes. Also, Current_Error_Node is not just used for printing bug
+ -- boxes. For example, an incorrect Current_Error_Node can cause some code
+ -- in Rtsfind to malfunction.
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -75,8 +82,6 @@ package body Debug_A is
-- Now push the new element
- -- Why is this done unconditionally???
-
Debug_A_Depth := Debug_A_Depth + 1;
if Debug_A_Depth <= Max_Node_Ids then
@@ -103,8 +108,6 @@ package body Debug_A is
-- We look down the stack to find something with a decent Sloc. (If
-- we find nothing, just leave it unchanged which is not so terrible)
- -- This seems nasty overhead for the normal case ???
-
for J in reverse 1 .. Integer'Min (Max_Node_Ids, Debug_A_Depth) loop
if Sloc (Node_Ids (J)) > No_Location then
Current_Error_Node := Node_Ids (J);
@@ -130,8 +133,6 @@ package body Debug_A is
procedure Debug_Output_Astring is
Vbars : constant String := "|||||||||||||||||||||||||";
- -- Should be constant, removed because of GNAT 1.78 bug ???
-
begin
if Debug_A_Depth > Vbars'Length then
for I in Vbars'Length .. Debug_A_Depth loop