From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aXdGILmvsWnABSQAWB0awg (envelope-from ) for ; Wed, 11 Mar 2026 14:08:57 -0400 Received: by simark.ca (Postfix, from userid 112) id 80F0F1E09A; Wed, 11 Mar 2026 14:08:57 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6D6E01E09A for ; Wed, 11 Mar 2026 14:08:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DEAC94B920D0 for ; Wed, 11 Mar 2026 18:08:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEAC94B920D0 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id A3C1A4BB58DC for ; Wed, 11 Mar 2026 18:08:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A3C1A4BB58DC Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A3C1A4BB58DC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773252510; cv=none; b=K/jqKkP1dSvoekMbTskOFGGBdh3iHhPJU9BMdi92FOfKqerklxPjSvqqskYTvXzRBVTHYfvpicALO31p4tNjNfeRsElQXSOJCzTAfFZAPjr6yyZQ8m2XkKPaOutBSF4IXTYKZQ/DRa35agmEUWMDV6Yc/GHV22aUb4eb6rTqBrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773252510; c=relaxed/simple; bh=F5x4y0I+02UNb+dys2e/X7gLy+fksCca+eq2nSxrS2w=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=vfx5OAPCCUzpNjJY+AgNJuDJqbrFSqaccbx6Se/wZfrj7F3yRk1/af9L9xpAMmv5GtITJYJ9FCuxpinfceBKsamLCHuC/K6cBRRW5upl7QyjQtYVzPMlKy2NQloFm+tXfAD9gH+08nFWYApEXfRaEYgaPCmO8p8gyWkkvY9GTls= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3C1A4BB58DC Received: by simark.ca (Postfix) id AA8031E0EC; Wed, 11 Mar 2026 14:08:27 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 05/23] gdb/dwarf: change attr_to_dynamic_prop to return bool Date: Wed, 11 Mar 2026 14:05:30 -0400 Message-ID: <20260311180825.720803-6-simon.marchi@efficios.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260311180825.720803-1-simon.marchi@efficios.com> References: <20260311180825.720803-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Change-Id: I80fc429cd15328c5dfd1f4e7f87ad83368bcb28d --- gdb/dwarf2/read.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 57945a24fb13..a8b2716e6649 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -892,9 +892,9 @@ static struct type *get_DW_AT_signature_type (struct die_info *, static dwarf2_cu *load_full_type_unit (signatured_type *sig_type, dwarf2_per_objfile *per_objfile); -static int attr_to_dynamic_prop (const struct attribute *attr, - struct die_info *die, struct dwarf2_cu *cu, - struct dynamic_prop *prop, struct type *type); +static bool attr_to_dynamic_prop (const struct attribute *attr, + struct die_info *die, struct dwarf2_cu *cu, + struct dynamic_prop *prop, struct type *type); /* memory allocation interface */ @@ -11500,12 +11500,12 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) if (attribute *attr = dwarf2_attr (die, DW_AT_byte_stride, cu); attr != nullptr) { - int stride_ok; struct type *prop_type = cu->addr_sized_int_type (false); byte_stride_prop = &stride_storage; - stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop, - prop_type); + bool stride_ok + = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop, prop_type); + if (!stride_ok) { complaint (_("unable to read array DW_AT_byte_stride " @@ -13376,9 +13376,9 @@ var_decl_name (struct die_info *die, struct dwarf2_cu *cu) /* Parse dwarf attribute if it's a block, reference or constant and put the resulting value of the attribute into struct bound_prop. - Returns 1 if ATTR could be resolved into PROP, 0 otherwise. */ + Returns true if ATTR could be resolved into PROP, false otherwise. */ -static int +static bool attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, struct dwarf2_cu *cu, struct dynamic_prop *prop, struct type *default_type) @@ -13391,7 +13391,7 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, gdb_assert (default_type != NULL); if (attr == NULL || prop == NULL) - return 0; + return false; if (attr->form_is_block ()) { @@ -13450,9 +13450,9 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, if (name != nullptr) { prop->set_variable_name (name); - return 1; + return true; } - return 0; + return false; } switch (target_attr->name) @@ -13483,7 +13483,7 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, { dwarf2_invalid_attrib_class_complaint ("DW_AT_location", "dynamic property"); - return 0; + return false; } break; case DW_AT_data_member_location: @@ -13491,7 +13491,7 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, { baton = find_field_create_baton (cu, target_die); if (baton == nullptr) - return 0; + return false; baton->property_type = read_type_die (target_die->parent, target_cu); @@ -13520,12 +13520,12 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, else goto invalid; - return 1; + return true; invalid: dwarf2_invalid_attrib_class_complaint (dwarf_form_name (attr->form), dwarf2_name (die, cu)); - return 0; + return false; } /* See read.h. */ -- 2.53.0