GDB (API)
/home/stan/gdb/src/gdb/gdb-stabs.h
Go to the documentation of this file.
00001 /* Definitions for symbol-reading containing "stabs", for GDB.
00002    Copyright (C) 1992-2013 Free Software Foundation, Inc.
00003    Contributed by Cygnus Support.  Written by John Gilmore.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 /* This file exists to hold the common definitions required of most of
00021    the symbol-readers that end up using stabs.  The common use of
00022    these `symbol-type-specific' customizations of the generic data
00023    structures makes the stabs-oriented symbol readers able to call
00024    each others' functions as required.  */
00025 
00026 #if !defined (GDBSTABS_H)
00027 #define GDBSTABS_H
00028 
00029 /* The tag used to find the DBX info attached to an objfile.  This is
00030    global because it is referenced by several modules.  */
00031 extern const struct objfile_data *dbx_objfile_data_key;
00032 
00033 /* The stab_section_info chain remembers info from the ELF symbol table,
00034    while psymtabs are being built for the other symbol tables in the 
00035    objfile.  It is destroyed at the complation of psymtab-reading.
00036    Any info that was used from it has been copied into psymtabs.  */
00037 
00038 struct stab_section_info
00039   {
00040     char *filename;
00041     struct stab_section_info *next;
00042     int found;                  /* Count of times it's found in searching.  */
00043     size_t num_sections;
00044     CORE_ADDR sections[1];
00045   };
00046 
00047 /* Information is passed among various dbxread routines for accessing
00048    symbol files.  A pointer to this structure is kept in the objfile,
00049    using the dbx_objfile_data_key.  */
00050 
00051 struct dbx_symfile_info
00052   {
00053     CORE_ADDR text_addr;        /* Start of text section */
00054     int text_size;              /* Size of text section */
00055     int symcount;               /* How many symbols are there in the file */
00056     char *stringtab;            /* The actual string table */
00057     int stringtab_size;         /* Its size */
00058     file_ptr symtab_offset;     /* Offset in file to symbol table */
00059     int symbol_size;            /* Bytes in a single symbol */
00060     struct stab_section_info *stab_section_info;    /* Section starting points
00061                                                        of the original .o files
00062                                                        before linking.  */
00063 
00064     /* See stabsread.h for the use of the following.  */
00065     struct header_file *header_files;
00066     int n_header_files;
00067     int n_allocated_header_files;
00068 
00069     /* Pointers to BFD sections.  These are used to speed up the building of
00070        minimal symbols.  */
00071     asection *text_section;
00072     asection *data_section;
00073     asection *bss_section;
00074 
00075     /* Pointer to the separate ".stab" section, if there is one.  */
00076     asection *stab_section;
00077   };
00078 
00079 #define DBX_SYMFILE_INFO(o) \
00080   ((struct dbx_symfile_info *) objfile_data ((o), dbx_objfile_data_key))
00081 #define DBX_TEXT_ADDR(o)        (DBX_SYMFILE_INFO(o)->text_addr)
00082 #define DBX_TEXT_SIZE(o)        (DBX_SYMFILE_INFO(o)->text_size)
00083 #define DBX_SYMCOUNT(o)         (DBX_SYMFILE_INFO(o)->symcount)
00084 #define DBX_STRINGTAB(o)        (DBX_SYMFILE_INFO(o)->stringtab)
00085 #define DBX_STRINGTAB_SIZE(o)   (DBX_SYMFILE_INFO(o)->stringtab_size)
00086 #define DBX_SYMTAB_OFFSET(o)    (DBX_SYMFILE_INFO(o)->symtab_offset)
00087 #define DBX_SYMBOL_SIZE(o)      (DBX_SYMFILE_INFO(o)->symbol_size)
00088 #define DBX_TEXT_SECTION(o)     (DBX_SYMFILE_INFO(o)->text_section)
00089 #define DBX_DATA_SECTION(o)     (DBX_SYMFILE_INFO(o)->data_section)
00090 #define DBX_BSS_SECTION(o)      (DBX_SYMFILE_INFO(o)->bss_section)
00091 #define DBX_STAB_SECTION(o)     (DBX_SYMFILE_INFO(o)->stab_section)
00092 
00093 #endif /* GDBSTABS_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines