From patchwork Mon Mar 16 23:19:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 131834 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id BE42B4BA23E8 for ; Mon, 16 Mar 2026 23:21:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE42B4BA23E8 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=lnW6f7yU X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 702E64BBCDCA for ; Mon, 16 Mar 2026 23:20:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 702E64BBCDCA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 702E64BBCDCA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773703258; cv=none; b=gECj5FJoRlIgucLsqgvds5+oEelVqnv+WHarkn3+CtlaX+4sVOI5UX+SGP9NJjsFQjgnZul4/VlIpoZlWUAgC7pMju66N/OMWonvjs9lL4DPOJ6A0SNvSEriDCetVuSy+BJxlxoUmeVNIighPheLUnZEnT3UDXD2ECIqLrx0tM4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773703258; c=relaxed/simple; bh=JJoW427m3Df0iqDpytr5vmnMkO0C1a8s1AMKZImH6Ds=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=npv4SBxfEnENBEPsHFcEynABjeJ74f680SEAYBg+RaG4SpEnkszTvUrTTzAIHK4uNhGdWXhVIjtOvkwH8qoIrDg68AlNuQ7KhyXocnRKzxPk7iF7ySSGCb9nvXINqSdVaNjprDEGp7O8fN5kxg/irZYhEeruiGJ7cSU4kIvNLM4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 702E64BBCDCA Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 62GNKqZr238301 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Mar 2026 19:20:56 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 62GNKqZr238301 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1773703257; bh=oxs5I76Hk2cq4YeGhU2g2cIPX/yOuFkwzMUCslfy2ck=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=lnW6f7yUa1ddCt58QLvwEKdG0smJFpFfR2/FIZn+gQMTSdkRKTwI6iZtLTy47nJzH ESAUy0sDBpAMHwtQUQ0HJZQOgh68cx/yFChlUR44ucIaMrhs6haFNsSQisFbDCfdCi WiTA4l5SzbJX+dmEeq0piYiKuxtkfVqCGtVBOWEgL92k4VXnuKpNgIeEqlBKnnhdN0 fycmh70thhonW6C4g2ffVhYtgPqh172f9h34fu5XpoHlkt5H34ILbIyJmleK6fBAT8 gDhFmHluwJEAPTfPGBYkdqPgZw6D5zJ8aYoDquZmYbH8cpXzxVHCrsUv6z8wf5+xAq CAWbwGSvagyCA== Received: by simark.ca (Postfix) id D1A2D1E0C3; Mon, 16 Mar 2026 19:20:51 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 3/8] gdb/dwarf: move dwarf2_cu::section to cu.c Date: Mon, 16 Mar 2026 19:19:21 -0400 Message-ID: <20260316232042.368080-4-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260316232042.368080-1-simon.marchi@polymtl.ca> References: <20260316232042.368080-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 16 Mar 2026 23:20:52 +0000 X-Spam-Status: No, score=-3034.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_NONE, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org 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~patchwork=sourceware.org@sourceware.org From: Simon Marchi Following the previous patch that moves the dwo_unit structure from dwarf2/read.c to dwarf2/read.h, dwarf2_cu::section has no reason to be implemented in dwarf2/read.c anymore. Move it to dwarf2/cu.c. Change-Id: I67e2bb42d878ac18e4bf3460d75f1394477a46ce --- gdb/dwarf2/cu.c | 11 +++++++++++ gdb/dwarf2/read.c | 14 +------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c index c3bfd15f14a1..3c89bd960d56 100644 --- a/gdb/dwarf2/cu.c +++ b/gdb/dwarf2/cu.c @@ -58,6 +58,17 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile) /* See cu.h. */ +const dwarf2_section_info & +dwarf2_cu::section () const +{ + if (this->dwo_unit != nullptr) + return *this->dwo_unit->section; + else + return *this->per_cu->section (); +} + +/* See cu.h. */ + struct type * dwarf2_cu::addr_sized_int_type (bool unsigned_p) const { diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index c13ea6c1622f..3a0602b4ac08 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -5806,19 +5806,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) } } -/* See cu.h. - - This function is defined in this file (instead of cu.c) because it needs - to see the definition of struct dwo_unit. */ - -const dwarf2_section_info & -dwarf2_cu::section () const -{ - if (this->dwo_unit != nullptr) - return *this->dwo_unit->section; - else - return *this->per_cu->section (); -} +/* See cu.h. */ /* See cu.h.