* coffread.c (coff_symfile_init): Use set_objfile_data.
[deliverable/binutils-gdb.git] / gdb / gdb-stabs.h
CommitLineData
c906108c 1/* Definitions for symbol-reading containing "stabs", for GDB.
0b302171
JB
2 Copyright (C) 1992-1993, 1995-1997, 1999-2000, 2007-2012 Free
3 Software Foundation, Inc.
c906108c
SS
4 Contributed by Cygnus Support. Written by John Gilmore.
5
c5aa993b 6 This file is part of GDB.
c906108c 7
c5aa993b
JM
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
a9762ec7 10 the Free Software Foundation; either version 3 of the License, or
c5aa993b 11 (at your option) any later version.
c906108c 12
c5aa993b
JM
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
c906108c 17
c5aa993b 18 You should have received a copy of the GNU General Public License
a9762ec7 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c
SS
20
21/* This file exists to hold the common definitions required of most of
22 the symbol-readers that end up using stabs. The common use of
23 these `symbol-type-specific' customizations of the generic data
24 structures makes the stabs-oriented symbol readers able to call
25 each others' functions as required. */
26
27#if !defined (GDBSTABS_H)
28#define GDBSTABS_H
29
d2f4b8fe
TT
30/* The tag used to find the DBX info attached to an objfile. This is
31 global because it is referenced by several modules. */
32extern const struct objfile_data *dbx_objfile_data_key;
33
c906108c
SS
34/* The stab_section_info chain remembers info from the ELF symbol table,
35 while psymtabs are being built for the other symbol tables in the
36 objfile. It is destroyed at the complation of psymtab-reading.
37 Any info that was used from it has been copied into psymtabs. */
38
c5aa993b
JM
39struct stab_section_info
40 {
41 char *filename;
c5aa993b 42 struct stab_section_info *next;
0963b4bd 43 int found; /* Count of times it's found in searching. */
a39a16c4
MM
44 size_t num_sections;
45 CORE_ADDR sections[1];
c5aa993b 46 };
c906108c
SS
47
48/* Information is passed among various dbxread routines for accessing
d2f4b8fe
TT
49 symbol files. A pointer to this structure is kept in the objfile,
50 using the dbx_objfile_data_key. */
c5aa993b
JM
51
52struct dbx_symfile_info
53 {
54 CORE_ADDR text_addr; /* Start of text section */
55 int text_size; /* Size of text section */
56 int symcount; /* How many symbols are there in the file */
57 char *stringtab; /* The actual string table */
58 int stringtab_size; /* Its size */
59 file_ptr symtab_offset; /* Offset in file to symbol table */
60 int symbol_size; /* Bytes in a single symbol */
3e43a32a
MS
61 struct stab_section_info *stab_section_info; /* Section starting points
62 of the original .o files
63 before linking. */
c5aa993b 64
0963b4bd 65 /* See stabsread.h for the use of the following. */
c5aa993b
JM
66 struct header_file *header_files;
67 int n_header_files;
68 int n_allocated_header_files;
69
70 /* Pointers to BFD sections. These are used to speed up the building of
71 minimal symbols. */
72 asection *text_section;
73 asection *data_section;
74 asection *bss_section;
086df311
DJ
75
76 /* Pointer to the separate ".stab" section, if there is one. */
77 asection *stab_section;
c5aa993b 78 };
c906108c 79
d2f4b8fe
TT
80#define DBX_SYMFILE_INFO(o) \
81 ((struct dbx_symfile_info *) objfile_data ((o), dbx_objfile_data_key))
c906108c
SS
82#define DBX_TEXT_ADDR(o) (DBX_SYMFILE_INFO(o)->text_addr)
83#define DBX_TEXT_SIZE(o) (DBX_SYMFILE_INFO(o)->text_size)
84#define DBX_SYMCOUNT(o) (DBX_SYMFILE_INFO(o)->symcount)
85#define DBX_STRINGTAB(o) (DBX_SYMFILE_INFO(o)->stringtab)
86#define DBX_STRINGTAB_SIZE(o) (DBX_SYMFILE_INFO(o)->stringtab_size)
87#define DBX_SYMTAB_OFFSET(o) (DBX_SYMFILE_INFO(o)->symtab_offset)
88#define DBX_SYMBOL_SIZE(o) (DBX_SYMFILE_INFO(o)->symbol_size)
89#define DBX_TEXT_SECTION(o) (DBX_SYMFILE_INFO(o)->text_section)
90#define DBX_DATA_SECTION(o) (DBX_SYMFILE_INFO(o)->data_section)
91#define DBX_BSS_SECTION(o) (DBX_SYMFILE_INFO(o)->bss_section)
086df311 92#define DBX_STAB_SECTION(o) (DBX_SYMFILE_INFO(o)->stab_section)
c906108c
SS
93
94#endif /* GDBSTABS_H */
This page took 0.894887 seconds and 4 git commands to generate.