Back to index

cell-binutils  2.17cvs20070401
dwarf.h
Go to the documentation of this file.
00001 /* dwwrf.h - DWARF support header file
00002    Copyright 2005
00003    Free Software Foundation, Inc.
00004 
00005 This file is part of GNU Binutils.
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 2 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, write to the Free Software
00019 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 #include "bfd.h"
00022 #include "elf/dwarf2.h"
00023 
00024 #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
00025 /* We can't use any bfd types here since readelf may define BFD64 and
00026    objdump may not.  */
00027 typedef unsigned long long dwarf_vma;
00028 typedef unsigned long long dwarf_size_type;
00029 #else
00030 typedef unsigned long dwarf_vma;
00031 typedef unsigned long dwarf_size_type;
00032 #endif
00033 
00034 struct dwarf_section
00035 {
00036   const char *name;
00037   unsigned char *start;
00038   dwarf_vma address;
00039   dwarf_size_type size;
00040 };
00041 
00042 /* A structure containing the name of a debug section
00043    and a pointer to a function that can decode it.  */
00044 struct dwarf_section_display
00045 {
00046   struct dwarf_section section;
00047   int (*display) (struct dwarf_section *, void *);
00048   unsigned int relocate : 1;
00049   unsigned int eh_frame : 1;
00050 };
00051 
00052 enum dwarf_section_display_enum {
00053   abbrev = 0,
00054   aranges,
00055   frame,
00056   info,
00057   line,
00058   pubnames,
00059   eh_frame,
00060   macinfo,
00061   str,
00062   loc,
00063   pubtypes,
00064   ranges,
00065   static_func,
00066   static_vars,
00067   types,
00068   weaknames,
00069   max
00070 };
00071 
00072 extern struct dwarf_section_display debug_displays [];
00073 
00074 /* This structure records the information that
00075    we extract from the.debug_info section.  */
00076 typedef struct
00077 {
00078   unsigned int   pointer_size;
00079   unsigned long  cu_offset;
00080   unsigned long       base_address;
00081   /* This is an array of offsets to the location list table.  */
00082   unsigned long *loc_offsets;
00083   int         *have_frame_base;
00084   unsigned int   num_loc_offsets;
00085   unsigned int   max_loc_offsets;
00086   unsigned long *range_lists;
00087   unsigned int   num_range_lists;
00088   unsigned int   max_range_lists;
00089 }
00090 debug_info;
00091 
00092 extern dwarf_vma (*byte_get) (unsigned char *, int);
00093 extern dwarf_vma byte_get_little_endian (unsigned char *, int);
00094 extern dwarf_vma byte_get_big_endian (unsigned char *, int);
00095 
00096 extern dwarf_vma eh_addr_size;
00097 extern int is_relocatable;
00098 
00099 extern int do_debug_info;
00100 extern int do_debug_abbrevs;
00101 extern int do_debug_lines;
00102 extern int do_debug_pubnames;
00103 extern int do_debug_aranges;
00104 extern int do_debug_ranges;
00105 extern int do_debug_frames;
00106 extern int do_debug_frames_interp;
00107 extern int do_debug_macinfo;
00108 extern int do_debug_str;
00109 extern int do_debug_loc;
00110 
00111 extern int load_debug_section (enum dwarf_section_display_enum,
00112                             void *);
00113 extern void free_debug_section (enum dwarf_section_display_enum);
00114 
00115 extern void free_debug_memory (void);
00116 
00117 void *cmalloc (size_t, size_t);
00118 void *xcmalloc (size_t, size_t);
00119 void *xcrealloc (void *, size_t, size_t);
00120 
00121 void error (const char *, ...) ATTRIBUTE_PRINTF_1;
00122 void warn (const char *, ...) ATTRIBUTE_PRINTF_1;