From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 1C2823857C53 for ; Mon, 6 Jul 2020 13:38:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1C2823857C53 X-ASG-Debug-ID: 1594042722-0c856e4374aa4d0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id M2ojlG2KXzexIaFA (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 06 Jul 2020 09:38:42 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) by smtp.ebox.ca (Postfix) with ESMTP id 5569B441D64; Mon, 6 Jul 2020 09:38:42 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 173-246-6-90.qc.cable.ebox.net[173.246.6.90] X-Barracuda-Apparent-Source-IP: 173.246.6.90 X-Barracuda-RBL-IP: 173.246.6.90 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 06/12] gdb: remove TYPE_LOW_BOUND_UNDEFINED and TYPE_HIGH_BOUND_UNDEFINED Date: Mon, 6 Jul 2020 09:38:27 -0400 X-ASG-Orig-Subj: [PATCH 06/12] gdb: remove TYPE_LOW_BOUND_UNDEFINED and TYPE_HIGH_BOUND_UNDEFINED Message-Id: <20200706133833.145408-7-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200706133833.145408-1-simon.marchi@polymtl.ca> References: <20200706133833.145408-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1594042722 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3751 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.83013 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 13:38:44 -0000 From: Simon Marchi Remove the macros, use the getters of `struct dynamic_prop` instead. gdb/ChangeLog: * gdbtypes.h (TYPE_LOW_BOUND_UNDEFINED, TYPE_HIGH_BOUND_UNDEFINED): Remove. Update all callers to get the bound property's kind and check against PROP_UNDEFINED. Change-Id: I6a7641ac1aa3fa7fca0c21f00556f185f2e2d68c --- gdb/ada-tasks.c | 4 ++-- gdb/eval.c | 3 ++- gdb/gdbtypes.c | 7 ++++--- gdb/gdbtypes.h | 8 ++------ 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index 7870a7847ad6..27b458767a79 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -896,8 +896,8 @@ ada_tasks_inferior_data_sniffer (struct ada_tasks_inferior_data *data) && eltype->code () == TYPE_CODE_PTR) idxtype = check_typedef (type->index_type ()); if (idxtype != NULL - && !TYPE_LOW_BOUND_UNDEFINED (idxtype) - && !TYPE_HIGH_BOUND_UNDEFINED (idxtype)) + && idxtype->bounds ()->low.kind () != PROP_UNDEFINED + && idxtype->bounds ()->high.kind () != PROP_UNDEFINED) { data->known_tasks_element = eltype; data->known_tasks_length = diff --git a/gdb/eval.c b/gdb/eval.c index 2191e190927e..dacd46da44fa 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -3212,7 +3212,8 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos, type = value_type (val); if (type->code () == TYPE_CODE_ARRAY && is_dynamic_type (type->index_type ()) - && TYPE_HIGH_BOUND_UNDEFINED (type->index_type ())) + && (type->index_type ()->bounds ()->high.kind () + == PROP_UNDEFINED)) return allocate_optimized_out_value (size_type); } else diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 507d2f6dacbe..227f696b7363 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -5117,10 +5117,11 @@ recursive_dump_type (struct type *type, int spaces) { printfi_filtered (spaces, "low %s%s high %s%s\n", plongest (type->bounds ()->low.const_val ()), - TYPE_LOW_BOUND_UNDEFINED (type) ? " (undefined)" : "", + (type->bounds ()->low.kind () == PROP_UNDEFINED + ? " (undefined)" : ""), plongest (type->bounds ()->high.const_val ()), - TYPE_HIGH_BOUND_UNDEFINED (type) - ? " (undefined)" : ""); + (type->bounds ()->high.kind () == PROP_UNDEFINED + ? " (undefined)" : "")); } switch (TYPE_SPECIFIC_FIELD (type)) diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 044af479727f..2d277ac688d0 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1594,10 +1594,6 @@ extern unsigned type_align (struct type *); space in struct type. */ extern bool set_type_align (struct type *, ULONGEST); -#define TYPE_LOW_BOUND_UNDEFINED(range_type) \ - (TYPE_LOW_BOUND_KIND(range_type) == PROP_UNDEFINED) -#define TYPE_HIGH_BOUND_UNDEFINED(range_type) \ - (TYPE_HIGH_BOUND_KIND(range_type) == PROP_UNDEFINED) #define TYPE_HIGH_BOUND_KIND(range_type) \ ((range_type)->bounds ()->high.kind ()) #define TYPE_LOW_BOUND_KIND(range_type) \ @@ -1637,9 +1633,9 @@ extern bool set_type_align (struct type *, ULONGEST); index type. */ #define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ - TYPE_HIGH_BOUND_UNDEFINED((arraytype)->index_type ()) + ((arraytype)->index_type ()->bounds ()->high.kind () == PROP_UNDEFINED) #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ - TYPE_LOW_BOUND_UNDEFINED((arraytype)->index_type ()) + ((arraytype)->index_type ()->bounds ()->low.kind () == PROP_UNDEFINED) #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ ((arraytype)->index_type ()->bounds ()->high.const_val ()) -- 2.27.0