aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/debug.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-07-11 08:01:35 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-11 08:01:35 +0000
commit6c1657116a2c9cf7c0c14b6dfa7f8bbb7672d3c8 (patch)
tree572be91ebc39f65aecaf91662cfea4f628aef40b /gcc/ada/debug.adb
parentccf173059688499749a30b3252cc3c4ea4ab0d0c (diff)
downloadgcc-6c1657116a2c9cf7c0c14b6dfa7f8bbb7672d3c8.zip
gcc-6c1657116a2c9cf7c0c14b6dfa7f8bbb7672d3c8.tar.gz
gcc-6c1657116a2c9cf7c0c14b6dfa7f8bbb7672d3c8.tar.bz2
[Ada] New Repinfo.Input unit to read back JSON representation info.
For some time the Repinfo unit has been able to output the representation information in the JSON data interchange format in addition to the usual text and binary formats. The new Repinfo.Input unit makes it possible to read back this information under this format and make it available to clients, the main one being ASIS. The big advantage of using this approach over manipulating a binary blob is that the writer and the reader of the JSON representation need not be binary compatible, i.e. in practice need not be the same version of the compiler or ASIS for the same target. The patch also adds a -gnatd_j switch to read back the information in the compiler itself, which makes it easy to keep the writer and the reader in sync using only one tool, namely the compiler. The typical usage is: gcc -c p.ads -gnatR4js gcc -c p.ads -gnatd_j to exercise respectively the writer and the reader from the compiler. 2019-07-11 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * alloc.ads (Rep_JSON_Table_Initial): New constant. (Rep_JSON_Table_Increment): Likewise. * debug.adb: Document -gnatd_j switch. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add repinfo-input.o. * gnat1drv.adb: Add with clause for Repinfo.Input. Add with and use clauses for Sinput. (Read_JSON_Files_For_Repinfo): New procedure. (Gnat1drv1): Deal with -gnatd_j switch. * repinfo-input.ad[sb]: New unit. * snames.ads-tmpl (Name_Discriminant): New constant. (Name_Operands): Likewise. From-SVN: r273382
Diffstat (limited to 'gcc/ada/debug.adb')
-rw-r--r--gcc/ada/debug.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 44f0b9e..6df3d6f 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -154,7 +154,7 @@ package body Debug is
-- d_g
-- d_h
-- d_i Ignore activations and calls to instances for elaboration
- -- d_j
+ -- d_j Read JSON files and populate Repinfo tables (opposite of -gnatRjs)
-- d_k
-- d_l
-- d_m
@@ -988,6 +988,10 @@ package body Debug is
-- subprogram or task type defined in an external instance for both
-- the static and dynamic elaboration models.
+ -- d_j The compiler reads JSON files that would be generated by the same
+ -- compilation session if -gnatRjs was passed, in order to populate
+ -- the internal tables of the Repinfo unit from them.
+
-- d_p The compiler ignores calls to subprograms which verify the run-time
-- semantics of invariants and postconditions in both the static and
-- dynamic elaboration models.