From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GdgQE4JX9miTVAAAWB0awg (envelope-from ) for ; Mon, 20 Oct 2025 11:38:42 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ua/28RtD; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 485FB1E0BC; Mon, 20 Oct 2025 11:38:42 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id F36B71E047 for ; Mon, 20 Oct 2025 11:38:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5BA0E3858413 for ; Mon, 20 Oct 2025 15:38:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BA0E3858413 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ua/28RtD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 882A93858C83 for ; Mon, 20 Oct 2025 15:31:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 882A93858C83 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 882A93858C83 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760974278; cv=none; b=IPfttzi63yvTfcLjyXRx9RcFpldK76c6RZ8gzH6Mw+2NogaQeWhGufcem/e3ciB+p3ht4lneKq9X92iHwt35Z9Sdldp1Xinb8my8JXuQJGdxq0AIWV7ALDWwuIU9KMFNatWm7TkH9/38X6gs/h/4yyDzW9A3o+4Q89awWBwFPoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760974278; c=relaxed/simple; bh=gW1QyTCUawUIHGZVv0bsrn8nOL9CfiNJPtu1CGrbWdA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sSnUvvxwobe4FDS5sC7P8ekHPQ3SB5tNxjkf/ZWxMpoHkSAJBzyzVjQFEruX1THOev8MRA4FFWTaQq9+tffDGn1fi84oe1/BL1dVyvqZucZ/p84vNb43AI3pMSe53iG6RUAuqonKMa9rf5ZrKn5cQNxvlFI9Cl9XzqfT2Xr0XCs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 882A93858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760974278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bDA6OK+eRc0qLv8IJ4Hm7vIN37EryMSoJRrPYAVndF0=; b=Ua/28RtDKkJeTunfgq9/togi+4LEc+xaEPzLDTyuS65fvBWvFct4NOcnWIG33J2LnVaTe2 gbTzIJBAXwyIN/8YSbR3yu+sWhxxoxEN00rGI/ttSjWZ4ON1OD+TfxOyVKDIWwLq0qugfX WnomvSq1oBV/UQaBvm3yibborin3y54= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-542-EdeIfr1QOjCMC5-ElkTmsQ-1; Mon, 20 Oct 2025 11:31:16 -0400 X-MC-Unique: EdeIfr1QOjCMC5-ElkTmsQ-1 X-Mimecast-MFC-AGG-ID: EdeIfr1QOjCMC5-ElkTmsQ_1760974275 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 195A21956050; Mon, 20 Oct 2025 15:31:15 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.25]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4B08C18003FC; Mon, 20 Oct 2025 15:31:13 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen , Eli Zaretskii , Tom Tromey Subject: [PATCH v2 8/8] gdb: remove support for dbx from GDB Date: Mon, 20 Oct 2025 12:28:52 -0300 Message-ID: <20251020152853.28195-9-guinevere@redhat.com> In-Reply-To: <20251020152853.28195-1-guinevere@redhat.com> References: <20251020152853.28195-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: nGOQcoQRSaJtg3GTA2vYjlecWKPusCw-fbIFpVrIF2c_1760974275 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org With the removal of stabs support, reading a dbx inferior has become a no-op and GDB is unable to perform sybmolic debugging in such inferiors. As such, this commit removes the files that work on it with spotty support. Reviewed-By: Eli Zaretskii Approved-By: Tom Tromey --- gdb/Makefile.in | 6 +- gdb/NEWS | 2 + gdb/configure | 6 +- gdb/configure.ac | 4 +- gdb/dbxread.c | 260 ----------------------------------------------- gdb/gdb-stabs.h | 176 -------------------------------- 6 files changed, 11 insertions(+), 443 deletions(-) delete mode 100644 gdb/dbxread.c delete mode 100644 gdb/gdb-stabs.h diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 381c064bc4e..c9cd98a75a8 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -917,7 +917,6 @@ ALL_TARGET_OBS = \ # Object files for reading specific types of debug information. coff_SRCS = coffread.c coff-pe-read.c -dbx_SRCS = dbxread.c elf_SRCS = elfread.c stap-probe.c dtrace-probe.c macho_SRCS = machoread.c mips_SRCS = mipsread.c @@ -1469,7 +1468,10 @@ HFILES_NO_SRCDIR = \ gdb-demangle.h \ gdb_expat.h \ gdb_proc_service.h \ - gdb-stabs.h \ + gdb_vfork.h \ + gdb_wchar.h \ + gdbarch.h \ + gdbcore.h \ gdbthread.h \ gdbtypes.h \ gdb_vfork.h \ diff --git a/gdb/NEWS b/gdb/NEWS index 2c94e786f41..097d8da350b 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -33,6 +33,8 @@ * Support for stabs debug information has been removed. +* Support for the binary file format dbx has been removed. + * New targets GNU/Linux/MicroBlaze (gdbserver) microblazeel-*linux* diff --git a/gdb/configure b/gdb/configure index 04bb60f9f1f..fa86e67a690 100755 --- a/gdb/configure +++ b/gdb/configure @@ -1651,8 +1651,8 @@ Optional Features: alternative target configurations --enable-binary-file-formats=FORMATS enable support for selected file formats (default - 'all') available formats: coff, dbx, elf, macho, - mips, xcoff, all + 'all') available formats: coff, elf, macho, mips, + xcoff, all --enable-gdb-mdebug-support Enable support for the mdebug debuginfo format (default 'yes') @@ -31848,7 +31848,7 @@ WIN32LIBS="$WIN32LIBS $WIN32APILIBS" # Object files to be used when building with support for all file formats. # This should not have elf or macho, as support for those formats depends # on BFD enabling them as well. -all_binary_file_srcs="\$(dbx_SRCS) \$(mips_SRCS) \$(coff_SRCS) \$(xcoff_SRCS)" +all_binary_file_srcs="\$(mips_SRCS) \$(coff_SRCS) \$(xcoff_SRCS)" bfd_supports_elf=no # Add ELF support to GDB, but only if BFD includes ELF support. diff --git a/gdb/configure.ac b/gdb/configure.ac index 5e5a3a01d06..b0db7fef6f0 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -194,7 +194,7 @@ esac]) AC_ARG_ENABLE(binary_file_formats, AS_HELP_STRING([--enable-binary-file-formats=FORMATS], [enable support for selected file formats (default 'all') - available formats: coff, dbx, elf, macho, mips, xcoff, all]), + available formats: coff, elf, macho, mips, xcoff, all]), [case "${enableval}" in yes | "") AC_MSG_ERROR(enable-binary-file-formats option must specify file formats or 'all') ;; @@ -1998,7 +1998,7 @@ WIN32LIBS="$WIN32LIBS $WIN32APILIBS" # Object files to be used when building with support for all file formats. # This should not have elf or macho, as support for those formats depends # on BFD enabling them as well. -all_binary_file_srcs="\$(dbx_SRCS) \$(mips_SRCS) \$(coff_SRCS) \$(xcoff_SRCS)" +all_binary_file_srcs="\$(mips_SRCS) \$(coff_SRCS) \$(xcoff_SRCS)" bfd_supports_elf=no # Add ELF support to GDB, but only if BFD includes ELF support. diff --git a/gdb/dbxread.c b/gdb/dbxread.c deleted file mode 100644 index e003a909fe8..00000000000 --- a/gdb/dbxread.c +++ /dev/null @@ -1,260 +0,0 @@ -/* Read dbx symbol tables and convert to internal format, for GDB. - Copyright (C) 1986-2025 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 . */ - -/* This module provides three functions: dbx_symfile_init, - which initializes to read a symbol file; dbx_new_init, which - discards existing cached information when all symbols are being - discarded; and dbx_symfile_read, which reads a symbol table - from a file. - - dbx_symfile_read only does the minimum work necessary for letting the - user "name" things symbolically; it does not read the entire symtab. - Instead, it reads the external and static symbols and puts them in partial - symbol tables. When more extensive information is requested of a - file, the corresponding partial symbol table is mutated into a full - fledged symbol table by going back and reading the symbols - for real. dbx_psymtab_to_symtab() is the function that does this */ - - -#include -#include "symtab.h" -#include "target.h" -#include "libaout.h" -#include "objfiles.h" -#include "buildsym-legacy.h" -#include "gdb-stabs.h" -#include "cp-support.h" -#include "c-lang.h" -#include "psymtab.h" -#include "block.h" -#include "aout/aout64.h" -#include "aout/stab_gnu.h" - -/* Local function prototypes. */ - -static void dbx_symfile_init (struct objfile *); - -static void dbx_new_init (struct objfile *); - -static void dbx_symfile_read (struct objfile *, symfile_add_flags); - -static void dbx_symfile_finish (struct objfile *); - - -#if 0 -static struct type ** -explicit_lookup_type (int real_filenum, int index) -{ - struct header_file *f = &HEADER_FILES (dbxread_objfile)[real_filenum]; - - if (index >= f->length) - { - f->length *= 2; - f->vector = (struct type **) - xrealloc (f->vector, f->length * sizeof (struct type *)); - memset (&f->vector[f->length / 2], - '\0', f->length * sizeof (struct type *) / 2); - } - return &f->vector[index]; -} -#endif - - -const registry::key dbx_objfile_data_key; - -/* This could leak memory, but it will be removed soon, so it - shouldn't have a large impact. */ -dbx_symfile_info::~dbx_symfile_info () -{ -} - -/* Scan and build partial symbols for a symbol file. - We have been initialized by a call to dbx_symfile_init, which - put all the relevant info into a "struct dbx_symfile_info", - hung off the objfile structure. */ - -static void -dbx_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) -{ -} - -/* Initialize anything that needs initializing when a completely new - symbol file is specified (not just adding some symbols from another - file, e.g. a shared library). */ - -static void -dbx_new_init (struct objfile *ignore) -{ -} - - -/* dbx_symfile_init () - is the dbx-specific initialization routine for reading symbols. - It is passed a struct objfile which contains, among other things, - the BFD for the file whose symbols are being read, and a slot for a pointer - to "private data" which we fill with goodies. - - We read the string table into malloc'd space and stash a pointer to it. - - Since BFD doesn't know how to read debug symbols in a format-independent - way (and may never do so...), we have to do it ourselves. We will never - be called unless this is an a.out (or very similar) file. - FIXME, there should be a cleaner peephole into the BFD environment here. */ - -#define DBX_STRINGTAB_SIZE_SIZE sizeof(long) /* FIXME */ - -static void -dbx_symfile_init (struct objfile *objfile) -{ - int val; - bfd *sym_bfd = objfile->obfd.get (); - const char *name = bfd_get_filename (sym_bfd); - asection *text_sect; - unsigned char size_temp[DBX_STRINGTAB_SIZE_SIZE]; - - /* Allocate struct to keep track of the symfile. */ - dbx_objfile_data_key.emplace (objfile); - - DBX_TEXT_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".text"); - DBX_DATA_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".data"); - DBX_BSS_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".bss"); - - /* FIXME POKING INSIDE BFD DATA STRUCTURES. */ -#define STRING_TABLE_OFFSET (sym_bfd->origin + obj_str_filepos (sym_bfd)) -#define SYMBOL_TABLE_OFFSET (sym_bfd->origin + obj_sym_filepos (sym_bfd)) - - /* FIXME POKING INSIDE BFD DATA STRUCTURES. */ - - text_sect = bfd_get_section_by_name (sym_bfd, ".text"); - if (!text_sect) - error (_("Can't find .text section in symbol file")); - DBX_TEXT_ADDR (objfile) = bfd_section_vma (text_sect); - DBX_TEXT_SIZE (objfile) = bfd_section_size (text_sect); - - DBX_SYMBOL_SIZE (objfile) = obj_symbol_entry_size (sym_bfd); - DBX_SYMCOUNT (objfile) = bfd_get_symcount (sym_bfd); - DBX_SYMTAB_OFFSET (objfile) = SYMBOL_TABLE_OFFSET; - - /* Read the string table and stash it away in the objfile_obstack. - When we blow away the objfile the string table goes away as well. - Note that gdb used to use the results of attempting to malloc the - string table, based on the size it read, as a form of sanity check - for botched byte swapping, on the theory that a byte swapped string - table size would be so totally bogus that the malloc would fail. Now - that we put in on the objfile_obstack, we can't do this since gdb gets - a fatal error (out of virtual memory) if the size is bogus. We can - however at least check to see if the size is less than the size of - the size field itself, or larger than the size of the entire file. - Note that all valid string tables have a size greater than zero, since - the bytes used to hold the size are included in the count. */ - - if (STRING_TABLE_OFFSET == 0) - { - /* It appears that with the existing bfd code, STRING_TABLE_OFFSET - will never be zero, even when there is no string table. This - would appear to be a bug in bfd. */ - DBX_STRINGTAB_SIZE (objfile) = 0; - DBX_STRINGTAB (objfile) = NULL; - } - else - { - val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, SEEK_SET); - if (val < 0) - perror_with_name (name); - - memset (size_temp, 0, sizeof (size_temp)); - val = bfd_read (size_temp, sizeof (size_temp), sym_bfd); - if (val < 0) - { - perror_with_name (name); - } - else if (val == 0) - { - /* With the existing bfd code, STRING_TABLE_OFFSET will be set to - EOF if there is no string table, and attempting to read the size - from EOF will read zero bytes. */ - DBX_STRINGTAB_SIZE (objfile) = 0; - DBX_STRINGTAB (objfile) = NULL; - } - else - { - /* Read some data that would appear to be the string table size. - If there really is a string table, then it is probably the right - size. Byteswap if necessary and validate the size. Note that - the minimum is DBX_STRINGTAB_SIZE_SIZE. If we just read some - random data that happened to be at STRING_TABLE_OFFSET, because - bfd can't tell us there is no string table, the sanity checks may - or may not catch this. */ - DBX_STRINGTAB_SIZE (objfile) = bfd_h_get_32 (sym_bfd, size_temp); - - if (DBX_STRINGTAB_SIZE (objfile) < sizeof (size_temp) - || DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd)) - error (_("ridiculous string table size (%d bytes)."), - DBX_STRINGTAB_SIZE (objfile)); - - DBX_STRINGTAB (objfile) = - (char *) obstack_alloc (&objfile->objfile_obstack, - DBX_STRINGTAB_SIZE (objfile)); - OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile)); - - /* Now read in the string table in one big gulp. */ - - val = bfd_seek (sym_bfd, STRING_TABLE_OFFSET, SEEK_SET); - if (val < 0) - perror_with_name (name); - val = bfd_read (DBX_STRINGTAB (objfile), - DBX_STRINGTAB_SIZE (objfile), - sym_bfd); - if (val != DBX_STRINGTAB_SIZE (objfile)) - perror_with_name (name); - } - } -} - -/* Perform any local cleanups required when we are done with a particular - objfile. I.E, we are in the process of discarding all symbol information - for an objfile, freeing up all memory held for it, and unlinking the - objfile struct from the global list of known objfiles. */ - -static void -dbx_symfile_finish (struct objfile *objfile) -{ -} - - - - - - -static const struct sym_fns aout_sym_fns = -{ - dbx_new_init, /* init anything gbl to entire symtab */ - dbx_symfile_init, /* read initial info, setup for sym_read() */ - dbx_symfile_read, /* read a symbol file into symtab */ - dbx_symfile_finish, /* finished with file, cleanup */ - default_symfile_offsets, /* parse user's offsets to internal form */ - default_symfile_segments, /* Get segment information from a file. */ - NULL, - default_symfile_relocate, /* Relocate a debug section. */ - NULL, /* sym_probe_fns */ -}; - -INIT_GDB_FILE (dbxread) -{ - add_symtab_fns (bfd_target_aout_flavour, &aout_sym_fns); -} diff --git a/gdb/gdb-stabs.h b/gdb/gdb-stabs.h deleted file mode 100644 index 99091295773..00000000000 --- a/gdb/gdb-stabs.h +++ /dev/null @@ -1,176 +0,0 @@ -/* Definitions for symbol-reading containing "stabs", for GDB. - Copyright (C) 1992-2025 Free Software Foundation, Inc. - Contributed by Cygnus Support. Written by John Gilmore. - - 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_GDB_STABS_H -#define GDB_GDB_STABS_H - -/* During initial symbol reading, we need to have a structure to keep - track of which psymtabs have which bincls in them. This structure - is used during reading to setup the list of dependencies within each - partial symbol table. */ -struct legacy_psymtab; - -struct header_file_location -{ - header_file_location (const char *name_, int instance_, - legacy_psymtab *pst_) - : name (name_), - instance (instance_), - pst (pst_) - { - } - - const char *name; /* Name of header file */ - int instance; /* See above */ - legacy_psymtab *pst; /* Partial symtab that has the - BINCL/EINCL defs for this file. */ -}; - -/* This file exists to hold the common definitions required of most of - the symbol-readers that end up using stabs. The common use of - these `symbol-type-specific' customizations of the generic data - structures makes the stabs-oriented symbol readers able to call - each others' functions as required. */ - -struct stabsread_context { - /* Remember what we deduced to be the source language of this psymtab. */ - enum language psymtab_language = language_unknown; - - /* The size of each symbol in the symbol file (in external form). - This is set by dbx_symfile_read when building psymtabs, and by - dbx_psymtab_to_symtab when building symtabs. */ - unsigned symbol_size = 0; - - /* This is the offset of the symbol table in the executable file. */ - unsigned symbol_table_offset = 0; - - /* This is the offset of the string table in the executable file. */ - unsigned string_table_offset = 0; - - /* For elf+stab executables, the n_strx field is not a simple index - into the string table. Instead, each .o file has a base offset in - the string table, and the associated symbols contain offsets from - this base. The following two variables contain the base offset for - the current and next .o files. */ - unsigned int file_string_table_offset = 0; - - /* .o and NLM files contain unrelocated addresses which are based at - 0. When non-zero, this flag disables some of the special cases for - Solaris elf+stab text addresses at location 0. */ - int symfile_relocatable = 0; - - /* When set, we are processing a .o file compiled by sun acc. This is - misnamed; it refers to all stabs-in-elf implementations which use - N_UNDF the way Sun does, including Solaris gcc. Hopefully all - stabs-in-elf implementations ever invented will choose to be - compatible. */ - unsigned char processing_acc_compilation = 0; - - /* The lowest text address we have yet encountered. This is needed - because in an a.out file, there is no header field which tells us - what address the program is actually going to be loaded at, so we - need to make guesses based on the symbols (which *are* relocated to - reflect the address it will be loaded at). */ - unrelocated_addr lowest_text_address; - - /* Non-zero if there is any line number info in the objfile. Prevents - dbx_end_psymtab from discarding an otherwise empty psymtab. */ - int has_line_numbers = 0; - - /* The list of bincls. */ - std::vector bincl_list; - - /* Name of last function encountered. Used in Solaris to approximate - object file boundaries. */ - const char *last_function_name = nullptr; - - /* The address in memory of the string table of the object file we are - reading (which might not be the "main" object file, but might be a - shared library or some other dynamically loaded thing). This is - set by read_dbx_symtab when building psymtabs, and by - read_ofile_symtab when building symtabs, and is used only by - next_symbol_text. FIXME: If that is true, we don't need it when - building psymtabs, right? */ - char *stringtab_global = nullptr; - - /* These variables are used to control fill_symbuf when the stabs - symbols are not contiguous (as may be the case when a COFF file is - linked using --split-by-reloc). */ - const std::vector *symbuf_sections; - size_t sect_idx = 0; - unsigned int symbuf_left = 0; - unsigned int symbuf_read = 0; - - /* This variable stores a global stabs buffer, if we read stabs into - memory in one chunk in order to process relocations. */ - bfd_byte *stabs_data = nullptr; -}; - - -/* Information is passed among various dbxread routines for accessing - symbol files. A pointer to this structure is kept in the objfile, - using the dbx_objfile_data_key. */ - -struct dbx_symfile_info - { - ~dbx_symfile_info (); - - CORE_ADDR text_addr = 0; /* Start of text section */ - int text_size = 0; /* Size of text section */ - int symcount = 0; /* How many symbols are there in the file */ - char *stringtab = nullptr; /* The actual string table */ - int stringtab_size = 0; /* Its size */ - file_ptr symtab_offset = 0; /* Offset in file to symbol table */ - int symbol_size = 0; /* Bytes in a single symbol */ - - stabsread_context ctx; /* Context for the symfile being read. */ - - /* See stabsread.h for the use of the following. */ - struct header_file *header_files = nullptr; - int n_header_files = 0; - int n_allocated_header_files = 0; - - /* Pointers to BFD sections. These are used to speed up the building of - minimal symbols. */ - asection *text_section = nullptr; - asection *data_section = nullptr; - asection *bss_section = nullptr; - - /* Pointer to the separate ".stab" section, if there is one. */ - asection *stab_section = nullptr; - }; - -/* The tag used to find the DBX info attached to an objfile. This is - global because it is referenced by several modules. */ -extern const registry::key dbx_objfile_data_key; - -#define DBX_SYMFILE_INFO(o) (dbx_objfile_data_key.get (o)) -#define DBX_TEXT_ADDR(o) (DBX_SYMFILE_INFO(o)->text_addr) -#define DBX_TEXT_SIZE(o) (DBX_SYMFILE_INFO(o)->text_size) -#define DBX_SYMCOUNT(o) (DBX_SYMFILE_INFO(o)->symcount) -#define DBX_STRINGTAB(o) (DBX_SYMFILE_INFO(o)->stringtab) -#define DBX_STRINGTAB_SIZE(o) (DBX_SYMFILE_INFO(o)->stringtab_size) -#define DBX_SYMTAB_OFFSET(o) (DBX_SYMFILE_INFO(o)->symtab_offset) -#define DBX_SYMBOL_SIZE(o) (DBX_SYMFILE_INFO(o)->symbol_size) -#define DBX_TEXT_SECTION(o) (DBX_SYMFILE_INFO(o)->text_section) -#define DBX_DATA_SECTION(o) (DBX_SYMFILE_INFO(o)->data_section) -#define DBX_BSS_SECTION(o) (DBX_SYMFILE_INFO(o)->bss_section) -#define DBX_STAB_SECTION(o) (DBX_SYMFILE_INFO(o)->stab_section) - -#endif /* GDB_GDB_STABS_H */ -- 2.51.0