From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 2CDA53989035; Wed, 9 Jun 2021 05:54:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CDA53989035 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1317] Improve JSON examples. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: f700e4b0ee3ef53b48975cf89be26b9177e3a3f3 X-Git-Newrev: 59d6713a138edf60827189b27c6b4ce98069c196 Message-Id: <20210609055445.2CDA53989035@sourceware.org> Date: Wed, 9 Jun 2021 05:54:45 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 05:54:45 -0000 https://gcc.gnu.org/g:59d6713a138edf60827189b27c6b4ce98069c196 commit r12-1317-g59d6713a138edf60827189b27c6b4ce98069c196 Author: Martin Liska Date: Wed Jun 9 07:35:48 2021 +0200 Improve JSON examples. gcc/ChangeLog: * doc/gcov.texi: Create a proper JSON files. * doc/invoke.texi: Remove dots in order to make it a valid JSON object. Diff: --- gcc/doc/gcov.texi | 50 +++++++++++++++++++++++++------------------------- gcc/doc/invoke.texi | 3 +-- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi index 32b51f984bc..6a5760e5ebe 100644 --- a/gcc/doc/gcov.texi +++ b/gcc/doc/gcov.texi @@ -191,11 +191,11 @@ Structure of the JSON is following: @smallexample @{ - "current_working_directory": @var{current_working_directory}, - "data_file": @var{data_file}, - "format_version": @var{format_version}, - "gcc_version": @var{gcc_version} - "files": [@var{file}] + "current_working_directory": "foo/bar", + "data_file": "a.out", + "format_version": "1", + "gcc_version": "11.1.1 20210510" + "files": ["$file"] @} @end smallexample @@ -220,9 +220,9 @@ Each @var{file} has the following form: @smallexample @{ - "file": @var{file_name}, - "functions": [@var{function}], - "lines": [@var{line}] + "file": "a.c", + "functions": ["$function"], + "lines": ["$line"] @} @end smallexample @@ -237,15 +237,15 @@ Each @var{function} has the following form: @smallexample @{ - "blocks": @var{blocks}, - "blocks_executed": @var{blocks_executed}, - "demangled_name": "@var{demangled_name}, - "end_column": @var{end_column}, - "end_line": @var{end_line}, - "execution_count": @var{execution_count}, - "name": @var{name}, - "start_column": @var{start_column} - "start_line": @var{start_line} + "blocks": 2, + "blocks_executed": 2, + "demangled_name": "foo", + "end_column": 1, + "end_line": 4, + "execution_count": 1, + "name": "foo", + "start_column": 5, + "start_line": 1 @} @end smallexample @@ -289,11 +289,11 @@ Each @var{line} has the following form: @smallexample @{ - "branches": [@var{branch}], - "count": @var{count}, - "line_number": @var{line_number}, - "unexecuted_block": @var{unexecuted_block} - "function_name": @var{function_name}, + "branches": ["$branch"], + "count": 2, + "line_number": 15, + "unexecuted_block": false, + "function_name": "foo", @} @end smallexample @@ -320,9 +320,9 @@ Each @var{branch} has the following form: @smallexample @{ - "count": @var{count}, - "fallthrough": @var{fallthrough}, - "throw": @var{throw} + "count": 11, + "fallthrough": true, + "throw": false @} @end smallexample diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 6063e466c13..24dc0491901 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -5149,8 +5149,7 @@ might be printed in JSON form (after formatting) like this: @} ] "column-origin": 1, - @}, - @dots{} + @} ] @end smallexample