From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway31.websitewelcome.com (gateway31.websitewelcome.com [192.185.143.38]) by sourceware.org (Postfix) with ESMTPS id 2225A385E029 for ; Sun, 22 Mar 2020 18:45:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2225A385E029 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway31.websitewelcome.com (Postfix) with ESMTP id C6D841A9FADE for ; Sun, 22 Mar 2020 13:45:28 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id G5bEjE0h2Sl8qG5bEjm0ye; Sun, 22 Mar 2020 13:45:28 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uAX2GnTUCUgpOXID8+LG3P9ypf/Oi53I0wQM8dT59ZE=; b=KKxsUTaJP6x/q13lp1yhgDSn/x IF1U3Smvq+rT6rCmu+9GHBzLr22P20dWriFs9Kj9NuvryiI+30QgO3W9AXMaPDJNREBUUmN2LM/kT KJxaadot+i0n8E2+pXP0NhuDR; Received: from 97-118-117-21.hlrn.qwest.net ([97.118.117.21]:48304 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jG5bE-000LNS-Jc; Sun, 22 Mar 2020 12:45:28 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 15/22] Move die_info to new header Date: Sun, 22 Mar 2020 12:45:16 -0600 Message-Id: <20200322184523.28959-16-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200322184523.28959-1-tom@tromey.com> References: <20200322184523.28959-1-tom@tromey.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.117.21 X-Source-L: No X-Exim-ID: 1jG5bE-000LNS-Jc X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-117-21.hlrn.qwest.net (bapiya.Home) [97.118.117.21]:48304 X-Source-Auth: tom+tromey.com X-Email-Count: 16 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-23.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP, URIBL_CSS, URIBL_CSS_A autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2020 18:45:31 -0000 This moves struct die_info to a new header, dwarf2/die.h. gdb/ChangeLog 2020-03-22 Tom Tromey * dwarf2/read.c (struct die_info): Move to die.h. * dwarf2/die.h: New file. --- gdb/ChangeLog | 5 ++++ gdb/dwarf2/die.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++ gdb/dwarf2/read.c | 40 +----------------------------- 3 files changed, 68 insertions(+), 39 deletions(-) create mode 100644 gdb/dwarf2/die.h 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 . */ + +#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 5d9fed2d827..8b9b6bc3ea0 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. */ -- 2.17.2