aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/erroutc.adb
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2020-07-10 16:52:03 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-20 03:21:32 -0400
commitbe273749fa010ad65af1eba98875c7383295a750 (patch)
treee6767851d18ffd0b32664b18e8f1952cc2f0f9c2 /gcc/ada/erroutc.adb
parentbc60bb5eb9b18315b1af7ffa408969690720f8b1 (diff)
downloadgcc-be273749fa010ad65af1eba98875c7383295a750.zip
gcc-be273749fa010ad65af1eba98875c7383295a750.tar.gz
gcc-be273749fa010ad65af1eba98875c7383295a750.tar.bz2
[Ada] Display source code pointing at locations in messages for GNATprove
gcc/ada/ * errout.adb: (Error_Msg-Internal): Pass the location for a line insertion if any in the message. (Output_Messages: Add display of source code lines if -gnatdF is set. (Write_Source_Code_Line): Code clean up. * erroutc.adb (Prescan_Message): Apply prescan for continuation lines when -gnatdF is set, and record presence of line insertion. * erroutc.ads (Has_Insertion_Line): New global for prescan. (Error_Msg_Object): Add field to record line insertion if present. * errutil.adb (Error_Msg): Pass no location for Insertion_Sloc.
Diffstat (limited to 'gcc/ada/erroutc.adb')
-rw-r--r--gcc/ada/erroutc.adb11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
index df174f6..93f53bb 100644
--- a/gcc/ada/erroutc.adb
+++ b/gcc/ada/erroutc.adb
@@ -814,9 +814,9 @@ package body Erroutc is
J : Natural;
begin
- -- Nothing to do for continuation line
+ -- Nothing to do for continuation line, unless -gnatdF is set
- if Msg (Msg'First) = '\' then
+ if not Debug_Flag_FF and then Msg (Msg'First) = '\' then
return;
end if;
@@ -826,6 +826,7 @@ package body Erroutc is
Is_Unconditional_Msg := False;
Is_Warning_Msg := False;
Has_Double_Exclam := False;
+ Has_Insertion_Line := False;
-- Check style message
@@ -903,6 +904,12 @@ package body Erroutc is
J := J + 1;
end if;
+ -- Insertion line (# insertion)
+
+ elsif Msg (J) = '#' then
+ Has_Insertion_Line := True;
+ J := J + 1;
+
-- Non-serious error (| insertion)
elsif Msg (J) = '|' then