public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 1/5] Create new file dwarf2/sect-names.h
Date: Sat, 20 Feb 2021 20:16:43 -0700	[thread overview]
Message-ID: <20210221031647.949270-2-tom@tromey.com> (raw)
In-Reply-To: <20210221031647.949270-1-tom@tromey.com>

This creates a new file, dwarf2/sect-names.h, and moves some
DWARF-specific type definitions from symfile.h into it.

gdb/ChangeLog
2021-02-20  Tom Tromey  <tom@tromey.com>

	* xcoffread.c: Include sect-names.h.
	* symfile.h (struct dwarf2_section_names, struct
	dwarf2_debug_sections): Move to dwarf2/sect-names.h.
	* dwarf2/sect-names.h: New file, from symfile.h.
	* dwarf2/read.c: Include sect-names.h.
---
 gdb/ChangeLog           |  8 +++++
 gdb/dwarf2/read.c       |  1 +
 gdb/dwarf2/sect-names.h | 68 +++++++++++++++++++++++++++++++++++++++++
 gdb/symfile.h           | 46 +---------------------------
 gdb/xcoffread.c         |  1 +
 5 files changed, 79 insertions(+), 45 deletions(-)
 create mode 100644 gdb/dwarf2/sect-names.h

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 51bf0fbeea5..d747286f2e3 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -40,6 +40,7 @@
 #include "dwarf2/dwz.h"
 #include "dwarf2/macro.h"
 #include "dwarf2/die.h"
+#include "dwarf2/sect-names.h"
 #include "dwarf2/stringify.h"
 #include "bfd.h"
 #include "elf-bfd.h"
diff --git a/gdb/dwarf2/sect-names.h b/gdb/dwarf2/sect-names.h
new file mode 100644
index 00000000000..63cf2cafef7
--- /dev/null
+++ b/gdb/dwarf2/sect-names.h
@@ -0,0 +1,68 @@
+/* DWARF 2 section names.
+
+   Copyright (C) 1990-2021 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef GDB_DWARF2_SECT_NAMES_H
+#define GDB_DWARF2_SECT_NAMES_H
+
+/* Names for a dwarf2 debugging section.  The field NORMAL is the normal
+   section name (usually from the DWARF standard), while the field COMPRESSED
+   is the name of compressed sections.  If your object file format doesn't
+   support compressed sections, the field COMPRESSED can be NULL.  Likewise,
+   the debugging section is not supported, the field NORMAL can be NULL too.
+   It doesn't make sense to have a NULL NORMAL field but a non-NULL COMPRESSED
+   field.  */
+
+struct dwarf2_section_names {
+  const char *normal;
+  const char *compressed;
+};
+
+/* List of names for dward2 debugging sections.  Also most object file formats
+   use the standardized (ie ELF) names, some (eg XCOFF) have customized names
+   due to restrictions.
+   The table for the standard names is defined in dwarf2read.c.  Please
+   update all instances of dwarf2_debug_sections if you add a field to this
+   structure.  It is always safe to use { NULL, NULL } in this case.  */
+
+struct dwarf2_debug_sections {
+  struct dwarf2_section_names info;
+  struct dwarf2_section_names abbrev;
+  struct dwarf2_section_names line;
+  struct dwarf2_section_names loc;
+  struct dwarf2_section_names loclists;
+  struct dwarf2_section_names macinfo;
+  struct dwarf2_section_names macro;
+  struct dwarf2_section_names str;
+  struct dwarf2_section_names str_offsets;
+  struct dwarf2_section_names line_str;
+  struct dwarf2_section_names ranges;
+  struct dwarf2_section_names rnglists;
+  struct dwarf2_section_names types;
+  struct dwarf2_section_names addr;
+  struct dwarf2_section_names frame;
+  struct dwarf2_section_names eh_frame;
+  struct dwarf2_section_names gdb_index;
+  struct dwarf2_section_names debug_names;
+  struct dwarf2_section_names debug_aranges;
+  /* This field has no meaning, but exists solely to catch changes to
+     this structure which are not reflected in some instance.  */
+  int sentinel;
+};
+
+#endif /* GDB_DWARF2_SECT_NAMES_H */
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 23e2ad8c3a9..7f5545dc5ba 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -554,51 +554,7 @@ extern void generic_load (const char *args, int from_tty);
 
 /* From dwarf2read.c */
 
-/* Names for a dwarf2 debugging section.  The field NORMAL is the normal
-   section name (usually from the DWARF standard), while the field COMPRESSED
-   is the name of compressed sections.  If your object file format doesn't
-   support compressed sections, the field COMPRESSED can be NULL.  Likewise,
-   the debugging section is not supported, the field NORMAL can be NULL too.
-   It doesn't make sense to have a NULL NORMAL field but a non-NULL COMPRESSED
-   field.  */
-
-struct dwarf2_section_names {
-  const char *normal;
-  const char *compressed;
-};
-
-/* List of names for dward2 debugging sections.  Also most object file formats
-   use the standardized (ie ELF) names, some (eg XCOFF) have customized names
-   due to restrictions.
-   The table for the standard names is defined in dwarf2read.c.  Please
-   update all instances of dwarf2_debug_sections if you add a field to this
-   structure.  It is always safe to use { NULL, NULL } in this case.  */
-
-struct dwarf2_debug_sections {
-  struct dwarf2_section_names info;
-  struct dwarf2_section_names abbrev;
-  struct dwarf2_section_names line;
-  struct dwarf2_section_names loc;
-  struct dwarf2_section_names loclists;
-  struct dwarf2_section_names macinfo;
-  struct dwarf2_section_names macro;
-  struct dwarf2_section_names str;
-  struct dwarf2_section_names str_offsets;
-  struct dwarf2_section_names line_str;
-  struct dwarf2_section_names ranges;
-  struct dwarf2_section_names rnglists;
-  struct dwarf2_section_names types;
-  struct dwarf2_section_names addr;
-  struct dwarf2_section_names frame;
-  struct dwarf2_section_names eh_frame;
-  struct dwarf2_section_names gdb_index;
-  struct dwarf2_section_names debug_names;
-  struct dwarf2_section_names debug_aranges;
-  /* This field has no meaning, but exists solely to catch changes to
-     this structure which are not reflected in some instance.  */
-  int sentinel;
-};
-
+struct dwarf2_debug_sections;
 extern int dwarf2_has_info (struct objfile *,
 			    const struct dwarf2_debug_sections *,
 			    bool = false);
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index cd93943a812..b1768702e26 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -47,6 +47,7 @@
 #include "expression.h"
 #include "complaints.h"
 #include "psympriv.h"
+#include "dwarf2/sect-names.h"
 
 #include "gdb-stabs.h"
 
-- 
2.26.2


  reply	other threads:[~2021-02-21  3:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21  3:16 [PATCH 0/5] Some minor dwz-handling improvements & cleanups Tom Tromey
2021-02-21  3:16 ` Tom Tromey [this message]
2021-02-21  3:16 ` [PATCH 2/5] Change section_is_p to a method on dwarf2_section_names Tom Tromey
2021-02-21  3:16 ` [PATCH 3/5] Avoid crash on missing dwz file Tom Tromey
2021-02-21 16:23   ` Tom Tromey
2021-02-21 17:19     ` Tom Tromey
2021-02-21  3:16 ` [PATCH 4/5] Include scoped_fd.h in debuginfod-support.h Tom Tromey
2021-02-21  3:16 ` [PATCH 5/5] Move dwarf2_get_dwz_file to dwarf2/dwz.h Tom Tromey
2021-03-06 16:28 ` [PATCH 0/5] Some minor dwz-handling improvements & cleanups Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210221031647.949270-2-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).