public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Move die_info to new header
@ 2020-03-26 15:33 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2020-03-26 15:33 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c2d50fd0b30f640301c3736038bec82b40a3f0dc

commit c2d50fd0b30f640301c3736038bec82b40a3f0dc
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Mar 26 09:28:08 2020 -0600

    Move die_info to new header
    
    This moves struct die_info to a new header, dwarf2/die.h.
    
    gdb/ChangeLog
    2020-03-26  Tom Tromey  <tom@tromey.com>
    
            * dwarf2/read.c (struct die_info): Move to die.h.
            * dwarf2/die.h: New file.

Diff:
---
 gdb/ChangeLog     |  5 +++++
 gdb/dwarf2/die.h  | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/dwarf2/read.c | 40 +----------------------------------
 3 files changed, 68 insertions(+), 39 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bc524e1133e..51ebd3c52b5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-26  Tom Tromey  <tom@tromey.com>
+
+	* dwarf2/read.c (struct die_info): Move to die.h.
+	* dwarf2/die.h: New file.
+
 2020-03-26  Tom Tromey  <tom@tromey.com>
 
 	* dwarf2/line-header.h (dwarf_decode_line_header): Declare.
diff --git a/gdb/dwarf2/die.h b/gdb/dwarf2/die.h
new file mode 100644
index 00000000000..f8826a276e8
--- /dev/null
+++ b/gdb/dwarf2/die.h
@@ -0,0 +1,62 @@
+/* DWARF DIEs
+
+   Copyright (C) 2003-2020 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_DIE_H
+#define GDB_DWARF2_DIE_H
+
+/* This data structure holds a complete die structure.  */
+struct die_info
+{
+  /* DWARF-2 tag for this DIE.  */
+  ENUM_BITFIELD(dwarf_tag) tag : 16;
+
+  /* Number of attributes */
+  unsigned char num_attrs;
+
+  /* True if we're presently building the full type name for the
+     type derived from this DIE.  */
+  unsigned char building_fullname : 1;
+
+  /* True if this die is in process.  PR 16581.  */
+  unsigned char in_process : 1;
+
+  /* True if this DIE has children.  */
+  unsigned char has_children : 1;
+
+  /* Abbrev number */
+  unsigned int abbrev;
+
+  /* Offset in .debug_info or .debug_types section.  */
+  sect_offset sect_off;
+
+  /* The dies in a compilation unit form an n-ary tree.  PARENT
+     points to this die's parent; CHILD points to the first child of
+     this node; and all the children of a given node are chained
+     together via their SIBLING fields.  */
+  struct die_info *child;	/* Its first child, if any.  */
+  struct die_info *sibling;	/* Its next sibling, if any.  */
+  struct die_info *parent;	/* Its parent, if any.  */
+
+  /* An array of attributes, with NUM_ATTRS elements.  There may be
+     zero, but it's not common and zero-sized arrays are not
+     sufficiently portable C.  */
+  struct attribute attrs[1];
+};
+
+#endif /* GDB_DWARF2_DIE_H */
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index ff5fa74997c..bdf3a89aa22 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -39,6 +39,7 @@
 #include "dwarf2/line-header.h"
 #include "dwarf2/dwz.h"
 #include "dwarf2/macro.h"
+#include "dwarf2/die.h"
 #include "bfd.h"
 #include "elf-bfd.h"
 #include "symtab.h"
@@ -1045,45 +1046,6 @@ struct partial_die_info : public allocate_on_obstack
     }
   };
 
-/* This data structure holds a complete die structure.  */
-struct die_info
-  {
-    /* DWARF-2 tag for this DIE.  */
-    ENUM_BITFIELD(dwarf_tag) tag : 16;
-
-    /* Number of attributes */
-    unsigned char num_attrs;
-
-    /* True if we're presently building the full type name for the
-       type derived from this DIE.  */
-    unsigned char building_fullname : 1;
-
-    /* True if this die is in process.  PR 16581.  */
-    unsigned char in_process : 1;
-
-    /* True if this DIE has children.  */
-    unsigned char has_children : 1;
-
-    /* Abbrev number */
-    unsigned int abbrev;
-
-    /* Offset in .debug_info or .debug_types section.  */
-    sect_offset sect_off;
-
-    /* The dies in a compilation unit form an n-ary tree.  PARENT
-       points to this die's parent; CHILD points to the first child of
-       this node; and all the children of a given node are chained
-       together via their SIBLING fields.  */
-    struct die_info *child;	/* Its first child, if any.  */
-    struct die_info *sibling;	/* Its next sibling, if any.  */
-    struct die_info *parent;	/* Its parent, if any.  */
-
-    /* An array of attributes, with NUM_ATTRS elements.  There may be
-       zero, but it's not common and zero-sized arrays are not
-       sufficiently portable C.  */
-    struct attribute attrs[1];
-  };
-
 /* FIXME: We might want to set this from BFD via bfd_arch_bits_per_byte,
    but this would require a corresponding change in unpack_field_as_long
    and friends.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-26 15:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 15:33 [binutils-gdb] Move die_info to new header Tom Tromey

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).