]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: move dwarf2_cu::section to cu.c
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 11 May 2026 15:40:28 +0000 (11:40 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 13 May 2026 15:46:00 +0000 (11:46 -0400)
Following the previous patch that moves the dwo_unit structure from
dwarf2/read.c to dwarf2/dwo.h, dwarf2_cu::section has no reason to be
implemented in dwarf2/read.c anymore.  Move it to dwarf2/cu.c.

Change-Id: I67e2bb42d878ac18e4bf3460d75f1394477a46ce
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/cu.c
gdb/dwarf2/read.c

index c3bfd15f14a1e467a651355ba170afe66c3a4549..3c89bd960d56d91ad5493d37c1494a2c41bc34c7 100644 (file)
@@ -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
 {
index 46aa0201cc633b1530afb72022b74afaae3dec72..4d797b0e29b91cc8c51b37a8601306074a18d641 100644 (file)
@@ -5765,19 +5765,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.