From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4CpqJvrYAmcTxAMAWB0awg (envelope-from ) for ; Sun, 06 Oct 2024 14:37:46 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JvGYA8kV; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 96BD51E355; Sun, 6 Oct 2024 14:37:46 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 F10C51E05C for ; Sun, 6 Oct 2024 14:37:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A416E3858CD9 for ; Sun, 6 Oct 2024 18:37:45 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 5B5F93858C41 for ; Sun, 6 Oct 2024 18:37:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B5F93858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B5F93858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728239838; cv=none; b=Hc5KCPO2YAdwE2lH6/EMEcvIcGNe9a+ZkUDijCKCUAM+1oMX4U/gn2qKxrOWIAz3VUdCPU0UC3JNspyK1RfzbOfPUcKodAMWz1uz42hgAlX1kILw04xiF20IOmoQX0rUifiQ5fphzMhuL9Oul9k+YhL4I687d2ZlFW9/Zx++9eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728239838; c=relaxed/simple; bh=5r4HaaVaIjsWJbEjDCn5DfNtobZVsACdmJhhV0114Mk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Ljdcy9vnXiXQMCwmerdjK3qIQmTMivQ2wr/vZkrtmNFbK2TeAlHhWRIUdW8GhjvIVr1qEqAIuYKkMotR0F0X3KuEATM2Xe6wpQOd49cN4lZc6wD38bXV/NS46RFeoJICWDUTFA3FwB4/MCd8JArd5zBM8qtgv2/74l8hE7HGOyM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728239836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Pui/GNcwo+BDPV2nmD8kV2q4hlli2+l+u9CBhN+jktE=; b=JvGYA8kVubNKrL2XmS2XUjXD7WOv23NbIjopSf7alQOz2gCy7Vur3HfKNRrA9ztwUcmcCx 6iMZHK3SfCPY/dRqYdTCpmFXAcqM68mVGTsWsCJ9ofnP0C7t35j4baEFODd2RqNzK9VkGd QmB21CZXmcVlcMbhG0lVaMVDKxohrBo= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-499-dh6_motgOR-GEv1WSMDVZA-1; Sun, 06 Oct 2024 14:37:14 -0400 X-MC-Unique: dh6_motgOR-GEv1WSMDVZA-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a8d15eff783so299019066b.3 for ; Sun, 06 Oct 2024 11:37:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728239833; x=1728844633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pui/GNcwo+BDPV2nmD8kV2q4hlli2+l+u9CBhN+jktE=; b=km8C1KceTaycC7AqN5uOTJP5OK/EcdkOGpppyJ3JcXH2dJvQZGjD+czjaIommJCi3p 4AXzsRG2ryAlgFb4MR+7ra3i14opM12a0KdHzBFeUSo7QPxkOUe0b34+0SaiBgXrFouv 9b8Wt7IAf7G/UayBb7/VmJjlJBNqHetkFLEG7Pi0Gj+GkeGLYEW3k4NCWWG6Ug/0jb6V 2ZCKNAuwadSoMnjZyKu4fqLhLKmxxVvDAwIK4e5VozcOhsl2C9WUO1AWxqVdKqTxtI5J eaki8TgeTBrTYT1dww/swswvho1Xsh7ffAot90XWqmFxoIg8Rz0YPeqUXMEv7da5V+Uc o1cw== X-Gm-Message-State: AOJu0YzSNlhNECoZnyspXQEV3eMm05pdYlVaaHT4sgX1ve7NLvza/KpU /jxQzJyEag0xktwMXpSn+80Y1EOuyaBrKMaYOL9hvw+X7SGy7ygJDpryVczr8mCgS4I+kc95P24 gnTGCGLmyxYlyvaZvcu89W2iZU6KtZSCPSH2x2wudqa2VJMJHHWSXopCBU8EuWjpndYWcl5YhNP McgmiZBWrSDp1H8xiZo/HriSNTStfYtQyXV5tTOYrDiAk= X-Received: by 2002:a17:907:cca3:b0:a99:50b8:9a10 with SMTP id a640c23a62f3a-a9950b89d61mr185516266b.64.1728239833388; Sun, 06 Oct 2024 11:37:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFJeauAGFWa1yi/41hbZoS5OSKX8W332t/fo5vyUqm94uKg1trC+qWuRU+8zYjNsOjWAO8HQ== X-Received: by 2002:a17:907:cca3:b0:a99:50b8:9a10 with SMTP id a640c23a62f3a-a9950b89d61mr185514166b.64.1728239832912; Sun, 06 Oct 2024 11:37:12 -0700 (PDT) Received: from localhost (243.223.159.143.dyn.plus.net. [143.159.223.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a992e78507bsm285039366b.130.2024.10.06.11.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Oct 2024 11:37:12 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/3] gdb: make use of set_tdesc_osabi overload in features/ files Date: Sun, 6 Oct 2024 19:37:06 +0100 Message-Id: <805ec50236bae86f1e7e1d77ceff99763ec00ba4.1728239729.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 There are two versions of the set_tdesc_osabi function in GDB: void set_tdesc_osabi (struct target_desc *target_desc, const char *name) { set_tdesc_osabi (target_desc, osabi_from_tdesc_string (name)); } void set_tdesc_osabi (struct target_desc *target_desc, enum gdb_osabi osabi) { target_desc->osabi = osabi; } In the gdb/features/ files we call the second of these functions, like this: set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux")); This can be replaced with a call to the first set_tdesc_osabi function, so lets do that. I think that this makes the features/ code slightly simpler and easier to understand. There should be no user visible changes after this commit. --- gdb/features/mips-dsp-linux.c | 2 +- gdb/features/mips-linux.c | 2 +- gdb/features/or1k-linux.c | 2 +- gdb/features/sparc/sparc32-solaris.c | 2 +- gdb/features/sparc/sparc64-solaris.c | 2 +- gdb/target-descriptions.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/features/mips-dsp-linux.c b/gdb/features/mips-dsp-linux.c index d8e40283caf..17d30aac68f 100644 --- a/gdb/features/mips-dsp-linux.c +++ b/gdb/features/mips-dsp-linux.c @@ -11,7 +11,7 @@ initialize_tdesc_mips_dsp_linux (void) target_desc_up result = allocate_target_description (); set_tdesc_architecture (result.get (), bfd_scan_arch ("mips")); - set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux")); + set_tdesc_osabi (result.get (), "GNU/Linux"); struct tdesc_feature *feature; diff --git a/gdb/features/mips-linux.c b/gdb/features/mips-linux.c index f93eef5e41d..a43526db24e 100644 --- a/gdb/features/mips-linux.c +++ b/gdb/features/mips-linux.c @@ -11,7 +11,7 @@ initialize_tdesc_mips_linux (void) target_desc_up result = allocate_target_description (); set_tdesc_architecture (result.get (), bfd_scan_arch ("mips")); - set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux")); + set_tdesc_osabi (result.get (), "GNU/Linux"); struct tdesc_feature *feature; diff --git a/gdb/features/or1k-linux.c b/gdb/features/or1k-linux.c index 24731458de2..551b38f59c0 100644 --- a/gdb/features/or1k-linux.c +++ b/gdb/features/or1k-linux.c @@ -11,7 +11,7 @@ initialize_tdesc_or1k_linux (void) target_desc_up result = allocate_target_description (); set_tdesc_architecture (result.get (), bfd_scan_arch ("or1k")); - set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("GNU/Linux")); + set_tdesc_osabi (result.get (), "GNU/Linux"); struct tdesc_feature *feature; diff --git a/gdb/features/sparc/sparc32-solaris.c b/gdb/features/sparc/sparc32-solaris.c index dce96851f96..ce57abaaaf2 100644 --- a/gdb/features/sparc/sparc32-solaris.c +++ b/gdb/features/sparc/sparc32-solaris.c @@ -11,7 +11,7 @@ initialize_tdesc_sparc32_solaris (void) target_desc_up result = allocate_target_description (); set_tdesc_architecture (result.get (), bfd_scan_arch ("sparc")); - set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("Solaris")); + set_tdesc_osabi (result.get (), "Solaris"); struct tdesc_feature *feature; diff --git a/gdb/features/sparc/sparc64-solaris.c b/gdb/features/sparc/sparc64-solaris.c index d030df63c6c..92cc88cd5cf 100644 --- a/gdb/features/sparc/sparc64-solaris.c +++ b/gdb/features/sparc/sparc64-solaris.c @@ -11,7 +11,7 @@ initialize_tdesc_sparc64_solaris (void) target_desc_up result = allocate_target_description (); set_tdesc_architecture (result.get (), bfd_scan_arch ("sparc:v9")); - set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("Solaris")); + set_tdesc_osabi (result.get (), "Solaris"); struct tdesc_feature *feature; diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index d78da14918f..c165750c6c5 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -1318,7 +1318,7 @@ class print_c_tdesc : public tdesc_element_visitor && tdesc_osabi (e) < GDB_OSABI_INVALID) { gdb_printf - (" set_tdesc_osabi (result.get (), osabi_from_tdesc_string (\"%s\"));\n", + (" set_tdesc_osabi (result.get (), \"%s\");\n", gdbarch_osabi_name (tdesc_osabi (e))); gdb_printf ("\n"); } -- 2.25.4