1 /* dwwrf.h - DWARF support header file 2 Copyright 2005 3 Free Software Foundation, Inc. 4 5 This file is part of GNU Binutils. 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 20 21 #include "dwarf2.h" 22 23 typedef unsigned long dwarf_vma; 24 typedef unsigned long dwarf_size_type; 25 26 struct dwarf_section 27 { 28 const char *name; 29 unsigned char *start; 30 dwarf_vma address; 31 dwarf_size_type size; 32 }; 33 34 /* A structure containing the name of a debug section 35 and a pointer to a function that can decode it. */ 36 struct dwarf_section_display 37 { 38 struct dwarf_section section; 39 int (*display) (struct dwarf_section *, void *); 40 unsigned int relocate : 1; 41 unsigned int eh_frame : 1; 42 }; 43 44 enum dwarf_section_display_enum { 45 abbrev = 0, 46 aranges, 47 frame, 48 info, 49 line, 50 pubnames, 51 eh_frame, 52 macinfo, 53 str, 54 loc, 55 pubtypes, 56 ranges, 57 static_func, 58 static_vars, 59 types, 60 weaknames, 61 max 62 }; 63 64 extern struct dwarf_section_display debug_displays []; 65 66 /* This structure records the information that 67 we extract from the.debug_info section. */ 68 typedef struct 69 { 70 unsigned int pointer_size; 71 unsigned long cu_offset; 72 unsigned long base_address; 73 /* This is an array of offsets to the location list table. */ 74 unsigned long *loc_offsets; 75 int *have_frame_base; 76 unsigned int num_loc_offsets; 77 unsigned int max_loc_offsets; 78 #ifdef SORT_LOCATION_LIST_OFFSETS 79 unsigned long last_loc_offset; /* used to determine whether loc offsets are sorted */ 80 #endif 81 unsigned long *range_lists; 82 unsigned int num_range_lists; 83 unsigned int max_range_lists; 84 } 85 debug_info; 86 87 extern dwarf_vma (*byte_get) (unsigned char *, int); 88 extern dwarf_vma byte_get_little_endian (unsigned char *, int); 89 extern dwarf_vma byte_get_big_endian (unsigned char *, int); 90 91 extern dwarf_vma eh_addr_size; 92 extern int is_relocatable; 93 94 extern int do_debug_info; 95 extern int do_debug_abbrevs; 96 extern int do_debug_lines; 97 extern int do_debug_pubnames; 98 extern int do_debug_aranges; 99 extern int do_debug_ranges; 100 extern int do_debug_frames; 101 extern int do_debug_frames_interp; 102 extern int do_debug_macinfo; 103 extern int do_debug_str; 104 extern int do_debug_loc; 105 106 extern int load_debug_section (enum dwarf_section_display_enum, 107 void *); 108 extern void free_debug_section (enum dwarf_section_display_enum); 109 110 extern void free_debug_memory (void); 111 112 extern void base_value_pair_hook(void *data, int size, 113 int base, int begin, int end); 114 115 extern void value_hook(void *data, int size, int val); 116 117 extern void signed_value_hook(void *data, 118 int pointer_size, 119 int is_signed, 120 int val); 121 122 extern void init_dwarf_variables(void); 123