From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116090 invoked by alias); 23 Jul 2019 08:13:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 115996 invoked by uid 89); 23 Jul 2019 08:13:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,WEIRD_QUOTING autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1611 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Jul 2019 08:13:52 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D7E16116B77; Tue, 23 Jul 2019 04:13:50 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eFE884PYrDOG; Tue, 23 Jul 2019 04:13:50 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id C68B6116B70; Tue, 23 Jul 2019 04:13:50 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4862) id C5EDA6B0; Tue, 23 Jul 2019 04:13:50 -0400 (EDT) Date: Tue, 23 Jul 2019 08:13:00 -0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Minor tweak to -gnatR output Message-ID: <20190723081350.GA95272@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg01483.txt.bz2 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 378 This makes sure that the numbers present in the -gnatR output are printed in decimal format in all cases, since the hexadecimal format is not compatible with the JSON syntax. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-07-23 Eric Botcazou gcc/ada/ * repinfo.adb (List_Component_Layout): Pass Decimal to UI_Write. (Write_Val): Likewise. --h31gzZEtNLTqOjlF Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" Content-length: 1684 --- gcc/ada/repinfo.adb +++ gcc/ada/repinfo.adb @@ -1150,7 +1150,7 @@ package body Repinfo is if Ekind (Ent) = E_Discriminant then Spaces (Indent); Write_Str (" ""discriminant"": "); - UI_Write (Discriminant_Number (Ent)); + UI_Write (Discriminant_Number (Ent), Decimal); Write_Line (","); end if; Spaces (Indent); @@ -1181,7 +1181,7 @@ package body Repinfo is Spaces (Max_Spos_Length - 2); if Starting_Position /= Uint_0 then - UI_Write (Starting_Position); + UI_Write (Starting_Position, Decimal); Write_Str (" + "); end if; @@ -1205,7 +1205,7 @@ package body Repinfo is Sbit := Sbit - SSU; end if; - UI_Write (Sbit); + UI_Write (Sbit, Decimal); if List_Representation_Info_To_JSON then Write_Line (", "); @@ -1227,13 +1227,13 @@ package body Repinfo is Lbit := Sbit + Esiz - 1; if List_Representation_Info_To_JSON then - UI_Write (Esiz); + UI_Write (Esiz, Decimal); else if Lbit >= 0 and then Lbit < 10 then Write_Char (' '); end if; - UI_Write (Lbit); + UI_Write (Lbit, Decimal); end if; -- The test for Esize (Ent) not Uint_0 here is an annoying special @@ -2414,7 +2414,7 @@ package body Repinfo is end if; else - UI_Write (Val); + UI_Write (Val, Decimal); end if; end Write_Val; --h31gzZEtNLTqOjlF--