From patchwork Tue Dec 19 20:15:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 25024 Received: (qmail 52903 invoked by alias); 19 Dec 2017 20:16:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 52880 invoked by uid 89); 19 Dec 2017 20:16:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:14.3.352, H*r:ip*14.3.352.0, 1108, HX-AuditID:sk:c1b4fb2 X-HELO: sesbmg23.ericsson.net Received: from sesbmg23.ericsson.net (HELO sesbmg23.ericsson.net) (193.180.251.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Dec 2017 20:16:16 +0000 Received: from ESESSHC017.ericsson.se (Unknown_Domain [153.88.183.69]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id D2.DD.13339.D83793A5; Tue, 19 Dec 2017 21:16:13 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.69) with Microsoft SMTP Server (TLS) id 14.3.352.0; Tue, 19 Dec 2017 21:15:59 +0100 Received: from [10.0.0.110] (192.222.251.162) by AM3PR07MB306.eurprd07.prod.outlook.com (2a01:111:e400:881b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.10; Tue, 19 Dec 2017 20:15:54 +0000 Subject: Re: [PATCH/RFA] Do not emit "field_type" var if not needed on "maint print c-tdesc" To: Sergio Durigan Junior , GDB Patches References: <20171219191817.7554-1-sergiodj@redhat.com> From: Simon Marchi Message-ID: <9ed3a5f3-f8ea-9a87-d201-40cfb0abd67e@ericsson.com> Date: Tue, 19 Dec 2017 15:15:45 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171219191817.7554-1-sergiodj@redhat.com> X-ClientProxiedBy: BN6PR10CA0021.namprd10.prod.outlook.com (2603:10b6:405:1::31) To AM3PR07MB306.eurprd07.prod.outlook.com (2a01:111:e400:881b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6c1a92a-7f1a-4d9a-8d0a-08d5471d4f86 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:AM3PR07MB306; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB306; 3:gYFYDcnvbvtJ2U+ieCOmBu/g3L0vqEms/7UEVdGmjF67XpQiCxyZfJrkM1IqaWN0aQtGYAEfjfbPvTgjHE3tWBjg+VdX9J/Ef8X+FLS311s4tWOFTtnvABXQ9KhCh6ZPPsk+LJwAe68o7FIBmjvWwIvHyZrnnHDhKSjehimxxHRLM4bUnrZSryF6KMh4+qtlSJc8f1Aqxk0XjlLv+WTjUPzxgJb8irC5TUUIPvX3cdjvxcfZFwLEiZ1vbeka0mcF; 25:Ybsl4ZInupS5ZggjaxCLo6RSvF4kmSuZkgws5YLe/pWmCRIMVGmuT6NXuoPWdZ2v0dcUyEX5qz/OYd/mweZAiL0qFBKNz8fjUScX75dTd2PbiyHOBQ5b2ngU4SqDXIWZClx1uaQMb3bzoPXDtEDEJhTTFaWEjI2bUDJKYDM/7eJByl18hOB+eE6BeSDv4nGxLG65AJtITBm3h1Qq/Ctpj9LQX97DI5ghA9nofXM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p8PRvSGL+uoYU/DnzKsHIqR/2fS1/gj8EevPBVYo4g36XjWDKIgqfKW7/JpG/Yry0azKKvVxrzJT5fxJVITGHLQsP71GpRHmc+pxsJYd/YV5/AhCu1T4HyDO8EUZdkxGj4PHBwS/sgRLH+fh2PwwIjnolgyLhwIlP5YWixsivr0MVkILhORCE+yaHcgzNv7qd5b/K X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(37575265505322); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231023)(3002001)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(6072148)(201708071742011); SRVR:AM3PR07MB306; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM3PR07MB306; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(366004)(396003)(376002)(346002)(39860400002)(24454002)(199004)(189003)(377424004)(50466002)(16526018)(105586002)(106356001)(36756003)(47776003)(6666003)(2950100002)(110136005)(64126003)(25786009)(66066001)(65956001)(65806001)(58126008)(316002)(16576012)(4001150100001)(53946003)(53936002)(6486002)(77096006)(6246003)(8936002)(229853002)(31696002)(97736004)(575784001)(86362001)(52116002)(31686004)(65826007)(83506002)(76176011)(81166006)(8676002)(2486003)(23676004)(52146003)(7736002)(81156014)(68736007)(59450400001)(53546011)(305945005)(386003)(3846002)(2906002)(6116002)(230700001)(5660300001)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR07MB306; H:[10.0.0.110]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTT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ifb+NCa5xrP60W2GYyLGDHcwuQVzaq/1pjkfA0WJU5YSjLs7Ey4idoCzco28b SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 20:15:54.7884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6c1a92a-7f1a-4d9a-8d0a-08d5471d4f86 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR07MB306 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes On 2017-12-19 02:18 PM, Sergio Durigan Junior wrote: > While fiddling a bit with -Wunused-variable, I noticed that "maint > print c-tdesc" was always generating code for the > "tdesc_type *field_type" variable, even when it wasn't used. This is > caught by GCC when using -Wunused-variable, of course. So I modified > the "print_c_tdesc" class to check whether "field_type" will be needed > or not. > > In order to do the check, I basically copied the logic implemented on > "void visit (const tdesc_type_with_fields *type)", specifically the > "switch" part, and simplified it to determine which types need > "field_type". It's on a new simple function called > "need_field_type". Then, we can simply call this function when > deciding whether to print "field_type", and that's it. > > I've also regenerated all the C files under gdb/features/, and as > expected only those that don't need "field_type" were modified. I fiddled with this when I made my series about C++ifying tdesc, but removed it from the series since I thought it wasn't that important. I'm not against fixing it though. I think it would be nice if we used "-Wunused-variable -Wno-error=unused-variable", in which case your patch would avoid some warnings/noise. However, I don't really like the fact that this approach duplicates the logic. A simpler way would be to emit the field lazily when we actually need it, see patch below for an example. There's a bit more collateral damage in the generated files, since some declarations change place. We would need to do the same for the other variable declarations. Another solution I thought of would be to use a new scope every time we have an assignment and declare the variable in each scope. For example, this tdesc_type_with_fields *type_with_fields; type_with_fields = tdesc_create_union (feature, "vec128"); tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); tdesc_add_field (type_with_fields, "v2_double", field_type); field_type = tdesc_named_type (feature, "v16i8"); tdesc_add_field (type_with_fields, "v16_int8", field_type); field_type = tdesc_named_type (feature, "v8i16"); tdesc_add_field (type_with_fields, "v8_int16", field_type); field_type = tdesc_named_type (feature, "v4i32"); tdesc_add_field (type_with_fields, "v4_int32", field_type); field_type = tdesc_named_type (feature, "v2i64"); tdesc_add_field (type_with_fields, "v2_int64", field_type); field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); would become { tdesc_type_with_fields *type_with_fields = tdesc_create_union (feature, "vec128"); { tdesc_type *field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); } { tdesc_type *field_type = tdesc_named_type (feature, "v2d"); tdesc_add_field (type_with_fields, "v2_double", field_type); } ... } That should avoid the need to any logic to track which variables have been declared. It would make the generated code a bit more verbose, but I don't think it matters. Simon From b7542ac9ed04ac9d124b5bcc3fd564266f43e665 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 19 Dec 2017 15:03:02 -0500 Subject: [PATCH] print_c_tdesc: print field_type declaration lazily --- gdb/features/aarch64-core.c | 1 - gdb/features/aarch64-fpu.c | 2 +- gdb/features/arc-arcompact.c | 1 - gdb/features/arc-v2.c | 1 - gdb/features/arm/arm-with-iwmmxt.c | 2 +- gdb/features/i386/32bit-core.c | 1 - gdb/features/i386/32bit-mpx.c | 2 +- gdb/features/i386/32bit-sse.c | 2 +- gdb/features/i386/64bit-avx512.c | 2 +- gdb/features/i386/64bit-core.c | 1 - gdb/features/i386/64bit-mpx.c | 2 +- gdb/features/i386/64bit-sse.c | 2 +- gdb/features/i386/x32-core.c | 1 - gdb/features/or1k.c | 1 - gdb/features/rs6000/powerpc-7400.c | 2 +- gdb/features/rs6000/powerpc-altivec32.c | 2 +- gdb/features/rs6000/powerpc-altivec32l.c | 2 +- gdb/features/rs6000/powerpc-altivec64.c | 2 +- gdb/features/rs6000/powerpc-altivec64l.c | 2 +- gdb/features/rs6000/powerpc-cell32l.c | 2 +- gdb/features/rs6000/powerpc-cell64l.c | 2 +- gdb/features/rs6000/powerpc-isa205-altivec32l.c | 2 +- gdb/features/rs6000/powerpc-isa205-altivec64l.c | 2 +- gdb/features/rs6000/powerpc-isa205-vsx32l.c | 2 +- gdb/features/rs6000/powerpc-isa205-vsx64l.c | 2 +- gdb/features/rs6000/powerpc-vsx32.c | 2 +- gdb/features/rs6000/powerpc-vsx32l.c | 2 +- gdb/features/rs6000/powerpc-vsx64.c | 2 +- gdb/features/rs6000/powerpc-vsx64l.c | 2 +- gdb/features/s390-gs-linux64.c | 2 +- gdb/features/s390-tevx-linux64.c | 2 +- gdb/features/s390-vx-linux64.c | 2 +- gdb/features/s390x-gs-linux64.c | 2 +- gdb/features/s390x-tevx-linux64.c | 2 +- gdb/features/s390x-vx-linux64.c | 2 +- gdb/target-descriptions.c | 38 ++++++++++++++----------- 36 files changed, 50 insertions(+), 51 deletions(-) diff --git a/gdb/features/aarch64-core.c b/gdb/features/aarch64-core.c index 618a7ef..3707b7e 100644 --- a/gdb/features/aarch64-core.c +++ b/gdb/features/aarch64-core.c @@ -10,7 +10,6 @@ create_feature_aarch64_core (struct target_desc *result, long regnum) feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.core", "aarch64-core.xml"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_flags (feature, "cpsr_flags", 4); tdesc_add_flag (type_with_fields, 0, "SP"); tdesc_add_flag (type_with_fields, 1, ""); diff --git a/gdb/features/aarch64-fpu.c b/gdb/features/aarch64-fpu.c index 7328eb1..cac3981 100644 --- a/gdb/features/aarch64-fpu.c +++ b/gdb/features/aarch64-fpu.c @@ -47,8 +47,8 @@ create_feature_aarch64_fpu (struct target_desc *result, long regnum) tdesc_create_vector (feature, "v1i", element_type, 1); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vnd"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v2d"); tdesc_add_field (type_with_fields, "f", field_type); field_type = tdesc_named_type (feature, "v2u"); diff --git a/gdb/features/arc-arcompact.c b/gdb/features/arc-arcompact.c index 79b6889..f81f0a2 100644 --- a/gdb/features/arc-arcompact.c +++ b/gdb/features/arc-arcompact.c @@ -52,7 +52,6 @@ initialize_tdesc_arc_arcompact (void) feature = tdesc_create_feature (result, "org.gnu.gdb.arc.aux-minimal"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_flags (feature, "status32_type", 4); tdesc_add_flag (type_with_fields, 0, "H"); tdesc_add_bitfield (type_with_fields, "E", 1, 2); diff --git a/gdb/features/arc-v2.c b/gdb/features/arc-v2.c index 9908b4c..b2254b2 100644 --- a/gdb/features/arc-v2.c +++ b/gdb/features/arc-v2.c @@ -52,7 +52,6 @@ initialize_tdesc_arc_v2 (void) feature = tdesc_create_feature (result, "org.gnu.gdb.arc.aux-minimal"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_flags (feature, "status32_type", 4); tdesc_add_flag (type_with_fields, 0, "H"); tdesc_add_bitfield (type_with_fields, "E", 1, 4); diff --git a/gdb/features/arm/arm-with-iwmmxt.c b/gdb/features/arm/arm-with-iwmmxt.c index 5d6c357..8729285 100644 --- a/gdb/features/arm/arm-with-iwmmxt.c +++ b/gdb/features/arm/arm-with-iwmmxt.c @@ -45,8 +45,8 @@ initialize_tdesc_arm_with_iwmmxt (void) tdesc_create_vector (feature, "iwmmxt_v2u32", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "iwmmxt_vec64i"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "iwmmxt_v8u8"); tdesc_add_field (type_with_fields, "u8", field_type); field_type = tdesc_named_type (feature, "iwmmxt_v4u16"); diff --git a/gdb/features/i386/32bit-core.c b/gdb/features/i386/32bit-core.c index de2ce47..294e86d 100644 --- a/gdb/features/i386/32bit-core.c +++ b/gdb/features/i386/32bit-core.c @@ -10,7 +10,6 @@ create_feature_i386_32bit_core (struct target_desc *result, long regnum) feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "32bit-core.xml"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4); tdesc_add_flag (type_with_fields, 0, "CF"); tdesc_add_flag (type_with_fields, 1, ""); diff --git a/gdb/features/i386/32bit-mpx.c b/gdb/features/i386/32bit-mpx.c index 38910d3..8f1be3a 100644 --- a/gdb/features/i386/32bit-mpx.c +++ b/gdb/features/i386/32bit-mpx.c @@ -10,8 +10,8 @@ create_feature_i386_32bit_mpx (struct target_desc *result, long regnum) feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx", "32bit-mpx.xml"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_struct (feature, "br128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint64"); tdesc_add_field (type_with_fields, "lbound", field_type); field_type = tdesc_named_type (feature, "uint64"); diff --git a/gdb/features/i386/32bit-sse.c b/gdb/features/i386/32bit-sse.c index 1c8a7e8..cf48960 100644 --- a/gdb/features/i386/32bit-sse.c +++ b/gdb/features/i386/32bit-sse.c @@ -29,8 +29,8 @@ create_feature_i386_32bit_sse (struct target_desc *result, long regnum) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/i386/64bit-avx512.c b/gdb/features/i386/64bit-avx512.c index a565f42..e103e43 100644 --- a/gdb/features/i386/64bit-avx512.c +++ b/gdb/features/i386/64bit-avx512.c @@ -29,8 +29,8 @@ create_feature_i386_64bit_avx512 (struct target_desc *result, long regnum) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/i386/64bit-core.c b/gdb/features/i386/64bit-core.c index f4cad06..9e39ee4 100644 --- a/gdb/features/i386/64bit-core.c +++ b/gdb/features/i386/64bit-core.c @@ -10,7 +10,6 @@ create_feature_i386_64bit_core (struct target_desc *result, long regnum) feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "64bit-core.xml"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4); tdesc_add_flag (type_with_fields, 0, "CF"); tdesc_add_flag (type_with_fields, 1, ""); diff --git a/gdb/features/i386/64bit-mpx.c b/gdb/features/i386/64bit-mpx.c index f8730b4..725e76a 100644 --- a/gdb/features/i386/64bit-mpx.c +++ b/gdb/features/i386/64bit-mpx.c @@ -10,8 +10,8 @@ create_feature_i386_64bit_mpx (struct target_desc *result, long regnum) feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx", "64bit-mpx.xml"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_struct (feature, "br128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint64"); tdesc_add_field (type_with_fields, "lbound", field_type); field_type = tdesc_named_type (feature, "uint64"); diff --git a/gdb/features/i386/64bit-sse.c b/gdb/features/i386/64bit-sse.c index e4f99c2..2859217 100644 --- a/gdb/features/i386/64bit-sse.c +++ b/gdb/features/i386/64bit-sse.c @@ -29,8 +29,8 @@ create_feature_i386_64bit_sse (struct target_desc *result, long regnum) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/i386/x32-core.c b/gdb/features/i386/x32-core.c index acafc7d..c268e11 100644 --- a/gdb/features/i386/x32-core.c +++ b/gdb/features/i386/x32-core.c @@ -10,7 +10,6 @@ create_feature_i386_x32_core (struct target_desc *result, long regnum) feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core", "x32-core.xml"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_flags (feature, "i386_eflags", 4); tdesc_add_flag (type_with_fields, 0, "CF"); tdesc_add_flag (type_with_fields, 1, ""); diff --git a/gdb/features/or1k.c b/gdb/features/or1k.c index 929a5f9..9169cae 100644 --- a/gdb/features/or1k.c +++ b/gdb/features/or1k.c @@ -16,7 +16,6 @@ initialize_tdesc_or1k (void) feature = tdesc_create_feature (result, "org.gnu.gdb.or1k.group0"); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_flags (feature, "sr_flags", 4); tdesc_add_flag (type_with_fields, 0, "SM"); tdesc_add_flag (type_with_fields, 1, "TEE"); diff --git a/gdb/features/rs6000/powerpc-7400.c b/gdb/features/rs6000/powerpc-7400.c index ba9f12c..58f8a69 100644 --- a/gdb/features/rs6000/powerpc-7400.c +++ b/gdb/features/rs6000/powerpc-7400.c @@ -152,8 +152,8 @@ initialize_tdesc_powerpc_7400 (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-altivec32.c b/gdb/features/rs6000/powerpc-altivec32.c index 9cb83ca..bbb36c8 100644 --- a/gdb/features/rs6000/powerpc-altivec32.c +++ b/gdb/features/rs6000/powerpc-altivec32.c @@ -104,8 +104,8 @@ initialize_tdesc_powerpc_altivec32 (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-altivec32l.c b/gdb/features/rs6000/powerpc-altivec32l.c index afaf8ed..81862cb 100644 --- a/gdb/features/rs6000/powerpc-altivec32l.c +++ b/gdb/features/rs6000/powerpc-altivec32l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_altivec32l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-altivec64.c b/gdb/features/rs6000/powerpc-altivec64.c index 94041e1..f7a7c72 100644 --- a/gdb/features/rs6000/powerpc-altivec64.c +++ b/gdb/features/rs6000/powerpc-altivec64.c @@ -104,8 +104,8 @@ initialize_tdesc_powerpc_altivec64 (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-altivec64l.c b/gdb/features/rs6000/powerpc-altivec64l.c index c7ed171..ce0bc86 100644 --- a/gdb/features/rs6000/powerpc-altivec64l.c +++ b/gdb/features/rs6000/powerpc-altivec64l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_altivec64l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-cell32l.c b/gdb/features/rs6000/powerpc-cell32l.c index 390d7b2..74c42f9 100644 --- a/gdb/features/rs6000/powerpc-cell32l.c +++ b/gdb/features/rs6000/powerpc-cell32l.c @@ -110,8 +110,8 @@ initialize_tdesc_powerpc_cell32l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-cell64l.c b/gdb/features/rs6000/powerpc-cell64l.c index 39890ba..cbfda4c 100644 --- a/gdb/features/rs6000/powerpc-cell64l.c +++ b/gdb/features/rs6000/powerpc-cell64l.c @@ -110,8 +110,8 @@ initialize_tdesc_powerpc_cell64l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-isa205-altivec32l.c b/gdb/features/rs6000/powerpc-isa205-altivec32l.c index 203bb4a..09f5c07 100644 --- a/gdb/features/rs6000/powerpc-isa205-altivec32l.c +++ b/gdb/features/rs6000/powerpc-isa205-altivec32l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_isa205_altivec32l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-isa205-altivec64l.c b/gdb/features/rs6000/powerpc-isa205-altivec64l.c index 8f66a16..246fcef 100644 --- a/gdb/features/rs6000/powerpc-isa205-altivec64l.c +++ b/gdb/features/rs6000/powerpc-isa205-altivec64l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_isa205_altivec64l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-isa205-vsx32l.c b/gdb/features/rs6000/powerpc-isa205-vsx32l.c index fc0f615..2a6e232 100644 --- a/gdb/features/rs6000/powerpc-isa205-vsx32l.c +++ b/gdb/features/rs6000/powerpc-isa205-vsx32l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_isa205_vsx32l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-isa205-vsx64l.c b/gdb/features/rs6000/powerpc-isa205-vsx64l.c index 3313d04..d0e32f2 100644 --- a/gdb/features/rs6000/powerpc-isa205-vsx64l.c +++ b/gdb/features/rs6000/powerpc-isa205-vsx64l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_isa205_vsx64l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-vsx32.c b/gdb/features/rs6000/powerpc-vsx32.c index 1a824a8..9eafb1c 100644 --- a/gdb/features/rs6000/powerpc-vsx32.c +++ b/gdb/features/rs6000/powerpc-vsx32.c @@ -104,8 +104,8 @@ initialize_tdesc_powerpc_vsx32 (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-vsx32l.c b/gdb/features/rs6000/powerpc-vsx32l.c index f5bf11e..f08df14 100644 --- a/gdb/features/rs6000/powerpc-vsx32l.c +++ b/gdb/features/rs6000/powerpc-vsx32l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_vsx32l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-vsx64.c b/gdb/features/rs6000/powerpc-vsx64.c index 601df39..7991115 100644 --- a/gdb/features/rs6000/powerpc-vsx64.c +++ b/gdb/features/rs6000/powerpc-vsx64.c @@ -104,8 +104,8 @@ initialize_tdesc_powerpc_vsx64 (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/rs6000/powerpc-vsx64l.c b/gdb/features/rs6000/powerpc-vsx64l.c index d34bd81..1726e67 100644 --- a/gdb/features/rs6000/powerpc-vsx64l.c +++ b/gdb/features/rs6000/powerpc-vsx64l.c @@ -108,8 +108,8 @@ initialize_tdesc_powerpc_vsx64l (void) tdesc_create_vector (feature, "v16i8", element_type, 16); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "uint128"); tdesc_add_field (type_with_fields, "uint128", field_type); field_type = tdesc_named_type (feature, "v4f"); diff --git a/gdb/features/s390-gs-linux64.c b/gdb/features/s390-gs-linux64.c index 126835b..1416183 100644 --- a/gdb/features/s390-gs-linux64.c +++ b/gdb/features/s390-gs-linux64.c @@ -135,8 +135,8 @@ initialize_tdesc_s390_gs_linux64 (void) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/s390-tevx-linux64.c b/gdb/features/s390-tevx-linux64.c index a9ee9e1..ae62e8d 100644 --- a/gdb/features/s390-tevx-linux64.c +++ b/gdb/features/s390-tevx-linux64.c @@ -135,8 +135,8 @@ initialize_tdesc_s390_tevx_linux64 (void) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/s390-vx-linux64.c b/gdb/features/s390-vx-linux64.c index b6c5dda..d3ec081 100644 --- a/gdb/features/s390-vx-linux64.c +++ b/gdb/features/s390-vx-linux64.c @@ -113,8 +113,8 @@ initialize_tdesc_s390_vx_linux64 (void) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/s390x-gs-linux64.c b/gdb/features/s390x-gs-linux64.c index 5ab3e3d..d253a09 100644 --- a/gdb/features/s390x-gs-linux64.c +++ b/gdb/features/s390x-gs-linux64.c @@ -119,8 +119,8 @@ initialize_tdesc_s390x_gs_linux64 (void) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/s390x-tevx-linux64.c b/gdb/features/s390x-tevx-linux64.c index e5ecedf..1ac3249 100644 --- a/gdb/features/s390x-tevx-linux64.c +++ b/gdb/features/s390x-tevx-linux64.c @@ -119,8 +119,8 @@ initialize_tdesc_s390x_tevx_linux64 (void) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/features/s390x-vx-linux64.c b/gdb/features/s390x-vx-linux64.c index 1f24349..2e3d382 100644 --- a/gdb/features/s390x-vx-linux64.c +++ b/gdb/features/s390x-vx-linux64.c @@ -97,8 +97,8 @@ initialize_tdesc_s390x_vx_linux64 (void) tdesc_create_vector (feature, "v2i64", element_type, 2); tdesc_type_with_fields *type_with_fields; - tdesc_type *field_type; type_with_fields = tdesc_create_union (feature, "vec128"); + tdesc_type *field_type; field_type = tdesc_named_type (feature, "v4f"); tdesc_add_field (type_with_fields, "v4_float", field_type); field_type = tdesc_named_type (feature, "v2d"); diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 88ac55f..85f0138 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -1894,13 +1894,6 @@ public: m_printed_type_with_fields = true; } - if (!type->fields.empty () - && !m_printed_field_type) - { - printf_unfiltered (" tdesc_type *field_type;\n"); - m_printed_field_type = true; - } - switch (type->kind) { case TDESC_TYPE_STRUCT: @@ -1949,8 +1942,8 @@ public: } else { - printf_unfiltered - (" field_type = tdesc_named_type (feature, \"%s\");\n", + printf_field_type_assignment + ("tdesc_named_type (feature, \"%s\");\n", type_name); printf_unfiltered (" tdesc_add_typed_bitfield (type_with_fields, \"%s\"," @@ -1962,10 +1955,8 @@ public: { gdb_assert (f.end == -1); gdb_assert (type->kind == TDESC_TYPE_STRUCT); - printf_unfiltered - (" field_type = tdesc_named_type (feature," - " \"%s\");\n", - type_name); + printf_field_type_assignment + ("tdesc_named_type (feature, \"%s\");\n", type_name); printf_unfiltered (" tdesc_add_field (type_with_fields, \"%s\", field_type);\n", f.name.c_str ()); @@ -1978,9 +1969,8 @@ public: type->name.c_str ()); for (const tdesc_type_field &f : type->fields) { - printf_unfiltered - (" field_type = tdesc_named_type (feature, \"%s\");\n", - f.type->name.c_str ()); + printf_field_type_assignment + ("tdesc_named_type (feature, \"%s\");\n", f.type->name.c_str ()); printf_unfiltered (" tdesc_add_field (type_with_fields, \"%s\", field_type);\n", f.name.c_str ()); @@ -2018,6 +2008,22 @@ protected: std::string m_filename_after_features; private: + void printf_field_type_assignment (const char *fmt, ...) + { + if (!m_printed_field_type) + { + printf_unfiltered (" tdesc_type *field_type;\n"); + m_printed_field_type = true; + } + + printf_unfiltered (" field_type = "); + + va_list args; + va_start (args, fmt); + vprintf_unfiltered (fmt, args); + va_end (args); + } + char *m_function; /* Did we print "struct tdesc_type *element_type;" yet? */