From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 8D95B3858D37 for ; Wed, 19 Apr 2023 14:06:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D95B3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-32a249b416fso39178065ab.1 for ; Wed, 19 Apr 2023 07:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1681913195; x=1684505195; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0Bf8LLAB4gXRbPtoWH0k9WBe6WV/g1OsSWsjClZoSmY=; b=ZQfnufFq3o/U+6UAfb1mqokWMB+3mw8RGFFVMbVPiROF622eC7PAqxNvYfP6bCQXoQ VhgUU/J8L6di+2r7WNVSnL04nWn1wGMDY5zbNsBb1f8Nqz8yJkwr9pHzxmttbh3DWx0X FoiCbd+rvZoSz3wK945/zshS8+3VEi4I14h4BATklRupz+wy63sxzUcNbwrNtdYOoXAg qEtg3mGlKp8vt61t0GbpWiESJHw+Q8Xm3A2BbwbayuDUVKdq1byzb+dVxK4AHYV0ZHYR 28fffEmNqyPEmYPaPxpnofzuBAHFETHOoQoBamHHNOXF0+O/hm9Ho6O7ZnBLPA2SnFGi uNfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913195; x=1684505195; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0Bf8LLAB4gXRbPtoWH0k9WBe6WV/g1OsSWsjClZoSmY=; b=Py7yXdteTY5ulvZgrWuJPQ7PMU3o9FhxaYCW/UvbsP7HdFTA1kUBcS/eaCEwL6llDL 7enxDNFcVx40mYrBPDOcIf8CYkhRPdkjOPi4rt/DyuvGMrVIQnhr47qjT9DPGXy3JMNg hpiSB+pjCLqZXgAdjby3Ts0aIid1k/Obu8+ku6ZvLpkJ/GuP+SnR/MM4dFL+FDo7Wj2h fcqIl+H5vKVYQl5uisOtn8toUcGBFSoxZbX8Mj8c0j6OQhxE07lz0lnRvDC5Nn1weqoW SpCMXa1uIsTSn3zPGjRsmPUVcTdeRuXKIu2BAh+f7TIhvyz8Y4+JRbUHnXG2hCskLaiM Y9Jg== X-Gm-Message-State: AAQBX9djBkWHWkIMrbnIW9xxGUgIOlE6y9TqO3cR3VCLBXiVhYeIisQQ F/an4k4Kz9+cesj/jMLLwTpjWQORwpfVTrQ/O4DiBg== X-Google-Smtp-Source: AKy350bTMkSmj1s+bHopyyCzgWpkVZ1QKGSsjBly53U5VnqYdWCzkqAwkCI+5K3FJXqJdwrmgsuJ3A== X-Received: by 2002:a92:d64f:0:b0:32c:3272:ffd9 with SMTP id x15-20020a92d64f000000b0032c3272ffd9mr43242ilp.5.1681913195490; Wed, 19 Apr 2023 07:06:35 -0700 (PDT) Received: from localhost.localdomain (71-211-191-82.hlrn.qwest.net. [71.211.191.82]) by smtp.gmail.com with ESMTPSA id r20-20020a92c5b4000000b00327392e5504sm4567441ilt.68.2023.04.19.07.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:06:34 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Remove adjust_type_signedness Date: Wed, 19 Apr 2023 08:06:28 -0600 Message-Id: <20230419140628.2037051-1-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I happened across adjust_type_signedness, which may be used to modify a type when printing an Ada value. Modifying a type like this is a bad idea -- they should normally be considered immutable. Removing this function still passes both the dejagnu and internal AdaCore tests, though, so this patch drops it. As this was reviewed internally, and only affect Ada, I am checking it in. --- gdb/ada-valprint.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 02ae46bce9e..24a7ea2ba79 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -37,15 +37,6 @@ static int print_field_values (struct value *, struct value *, -/* Make TYPE unsigned if its range of values includes no negatives. */ -static void -adjust_type_signedness (struct type *type) -{ - if (type != NULL && type->code () == TYPE_CODE_RANGE - && type->bounds ()->low.const_val () >= 0) - type->set_is_unsigned (true); -} - /* Assuming TYPE is a simple array type, prints its lower bound on STREAM, if non-standard (i.e., other than 1 for numbers, other than lower bound of index type for enumerated type). Returns 1 if something printed, @@ -652,7 +643,6 @@ print_field_values (struct value *value, struct value *outer_value, int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; - adjust_type_signedness (type->field (i).type ()); v = ada_value_primitive_packed_val (value, nullptr, bit_pos / HOST_CHAR_BIT, -- 2.39.1