2000-07-03 Christopher Faylor <cgf@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / gdb-stabs.h
CommitLineData
c906108c
SS
1/* Definitions for symbol-reading containing "stabs", for GDB.
2 Copyright 1992 Free Software Foundation, Inc.
3 Contributed by Cygnus Support. Written by John Gilmore.
4
c5aa993b 5 This file is part of GDB.
c906108c 6
c5aa993b
JM
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
c906108c 11
c5aa993b
JM
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
c906108c 16
c5aa993b
JM
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
c906108c
SS
21
22/* This file exists to hold the common definitions required of most of
23 the symbol-readers that end up using stabs. The common use of
24 these `symbol-type-specific' customizations of the generic data
25 structures makes the stabs-oriented symbol readers able to call
26 each others' functions as required. */
27
28#if !defined (GDBSTABS_H)
29#define GDBSTABS_H
30
c221dafc 31#define SECT_OFF_MAX 40 /* Count of possible values */
c906108c
SS
32
33/* The stab_section_info chain remembers info from the ELF symbol table,
34 while psymtabs are being built for the other symbol tables in the
35 objfile. It is destroyed at the complation of psymtab-reading.
36 Any info that was used from it has been copied into psymtabs. */
37
c5aa993b
JM
38struct stab_section_info
39 {
40 char *filename;
41 CORE_ADDR sections[SECT_OFF_MAX];
42 struct stab_section_info *next;
43 int found; /* Count of times it's found in searching */
44 };
c906108c
SS
45
46/* Information is passed among various dbxread routines for accessing
47 symbol files. A pointer to this structure is kept in the sym_stab_info
48 field of the objfile struct. */
c5aa993b
JM
49
50struct dbx_symfile_info
51 {
52 CORE_ADDR text_addr; /* Start of text section */
53 int text_size; /* Size of text section */
54 int symcount; /* How many symbols are there in the file */
55 char *stringtab; /* The actual string table */
56 int stringtab_size; /* Its size */
57 file_ptr symtab_offset; /* Offset in file to symbol table */
58 int symbol_size; /* Bytes in a single symbol */
59 struct stab_section_info *stab_section_info; /* section starting points
60 of the original .o files before linking. */
61
62 /* See stabsread.h for the use of the following. */
63 struct header_file *header_files;
64 int n_header_files;
65 int n_allocated_header_files;
66
67 /* Pointers to BFD sections. These are used to speed up the building of
68 minimal symbols. */
69 asection *text_section;
70 asection *data_section;
71 asection *bss_section;
72 };
c906108c
SS
73
74#define DBX_SYMFILE_INFO(o) ((o)->sym_stab_info)
75#define DBX_TEXT_ADDR(o) (DBX_SYMFILE_INFO(o)->text_addr)
76#define DBX_TEXT_SIZE(o) (DBX_SYMFILE_INFO(o)->text_size)
77#define DBX_SYMCOUNT(o) (DBX_SYMFILE_INFO(o)->symcount)
78#define DBX_STRINGTAB(o) (DBX_SYMFILE_INFO(o)->stringtab)
79#define DBX_STRINGTAB_SIZE(o) (DBX_SYMFILE_INFO(o)->stringtab_size)
80#define DBX_SYMTAB_OFFSET(o) (DBX_SYMFILE_INFO(o)->symtab_offset)
81#define DBX_SYMBOL_SIZE(o) (DBX_SYMFILE_INFO(o)->symbol_size)
82#define DBX_TEXT_SECTION(o) (DBX_SYMFILE_INFO(o)->text_section)
83#define DBX_DATA_SECTION(o) (DBX_SYMFILE_INFO(o)->data_section)
84#define DBX_BSS_SECTION(o) (DBX_SYMFILE_INFO(o)->bss_section)
85
86#endif /* GDBSTABS_H */
This page took 0.06094 seconds and 4 git commands to generate.