From patchwork Wed Apr 19 14:06:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 68010 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9FC003857354 for ; Wed, 19 Apr 2023 14:07:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FC003857354 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681913224; bh=0Bf8LLAB4gXRbPtoWH0k9WBe6WV/g1OsSWsjClZoSmY=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=pJTZVEGA0VdG+qb4fT3GncUqV51yEEduIqHvRHNKzFQWMFlh47sPbBFDiSTvqTYlY b1BTzXTxNzj31Y4gGNxDVpIiyM+v/YQa9UaWCEn/ZTDjTK3cotVnim5zuotCZ40WJE Vp5K37paeIBxLlEmGIMknRvqhlKfZ53D2yniJGNY= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-32a249b416fso39178065ab.1 for ; Wed, 19 Apr 2023 07:06:36 -0700 (PDT) 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) 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 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 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-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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,