From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway34.websitewelcome.com (gateway34.websitewelcome.com [192.185.150.114]) by sourceware.org (Postfix) with ESMTPS id B508D386100B for ; Sun, 21 Feb 2021 03:16:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B508D386100B 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 cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 444A320CADF4 for ; Sat, 20 Feb 2021 21:16:50 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id DfEolhCb3HPnUDfEol7wTS; Sat, 20 Feb 2021 21:16:50 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=237uBnxP2YzI3V2UKAKu8saOPsykYm/zEwGZ0rDnPOU=; b=hfBvW8t1fAIUXfPqQEEyCkW/5g HOjoF48SCUyGVdlravzh+dUtqydymj+CjbTlmWKjk5/L8ZRuhYf0WpM6RV9Nntesc0BoxRLamBbMJ fcD70A6pMIUUprmJEua1tSzEN; Received: from 97-122-70-152.hlrn.qwest.net ([97.122.70.152]:56692 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lDfEo-001OUW-17; Sat, 20 Feb 2021 20:16:50 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 1/5] Create new file dwarf2/sect-names.h Date: Sat, 20 Feb 2021 20:16:43 -0700 Message-Id: <20210221031647.949270-2-tom@tromey.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210221031647.949270-1-tom@tromey.com> References: <20210221031647.949270-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.122.70.152 X-Source-L: No X-Exim-ID: 1lDfEo-001OUW-17 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-70-152.hlrn.qwest.net (localhost.localdomain) [97.122.70.152]:56692 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3034.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NEUTRAL, TXREP 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, 21 Feb 2021 03:16:52 -0000 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 * 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 . */ + +#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