Commit | Line | Data |
---|---|---|
2670f34d JG |
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 | ||
5 | This file is part of GDB. | |
6 | ||
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. | |
11 | ||
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. | |
16 | ||
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., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
20 | ||
624afa76 JK |
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. */ | |
2670f34d JG |
26 | |
27 | #if !defined (GDBSTABS_H) | |
28 | #define GDBSTABS_H | |
29 | ||
30 | /* Offsets in the psymtab's section_offsets array for various kinds of | |
31 | stabs symbols. Every psymtab built from stabs will have these offsets | |
32 | filled in by these guidelines, so that when actually reading symbols, the | |
33 | proper offset can simply be selected and added to the symbol value. */ | |
34 | ||
35 | #define SECT_OFF_TEXT 0 | |
36 | #define SECT_OFF_DATA 1 | |
37 | #define SECT_OFF_BSS 2 | |
38 | #define SECT_OFF_RODATA 3 | |
39 | #define SECT_OFF_MAX 4 /* Count of possible values */ | |
40 | ||
41 | /* The stab_section_info chain remembers info from the ELF symbol table, | |
42 | while psymtabs are being built for the other symbol tables in the | |
43 | objfile. It is destroyed at the complation of psymtab-reading. | |
44 | Any info that was used from it has been copied into psymtabs. */ | |
45 | ||
46 | struct stab_section_info { | |
47 | char *filename; | |
48 | CORE_ADDR sections[SECT_OFF_MAX]; | |
49 | struct stab_section_info *next; | |
50 | int found; /* Count of times it's found in searching */ | |
51 | }; | |
52 | ||
53 | /* Information is passed among various dbxread routines for accessing | |
965a5c32 | 54 | symbol files. A pointer to this structure is kept in the sym_stab_info |
2670f34d JG |
55 | field of the objfile struct. */ |
56 | ||
57 | struct dbx_symfile_info { | |
58 | asection *text_sect; /* Text section accessor */ | |
59 | int symcount; /* How many symbols are there in the file */ | |
60 | char *stringtab; /* The actual string table */ | |
61 | int stringtab_size; /* Its size */ | |
d5931d79 | 62 | file_ptr symtab_offset; /* Offset in file to symbol table */ |
2670f34d JG |
63 | int symbol_size; /* Bytes in a single symbol */ |
64 | struct stab_section_info *stab_section_info; /* section starting points | |
65 | of the original .o files before linking. */ | |
2670f34d JG |
66 | }; |
67 | ||
965a5c32 | 68 | #define DBX_SYMFILE_INFO(o) ((struct dbx_symfile_info *)((o)->sym_stab_info)) |
2670f34d JG |
69 | #define DBX_TEXT_SECT(o) (DBX_SYMFILE_INFO(o)->text_sect) |
70 | #define DBX_SYMCOUNT(o) (DBX_SYMFILE_INFO(o)->symcount) | |
71 | #define DBX_STRINGTAB(o) (DBX_SYMFILE_INFO(o)->stringtab) | |
72 | #define DBX_STRINGTAB_SIZE(o) (DBX_SYMFILE_INFO(o)->stringtab_size) | |
73 | #define DBX_SYMTAB_OFFSET(o) (DBX_SYMFILE_INFO(o)->symtab_offset) | |
74 | #define DBX_SYMBOL_SIZE(o) (DBX_SYMFILE_INFO(o)->symbol_size) | |
2670f34d JG |
75 | |
76 | #endif /* GDBSTABS_H */ |