1 /* DWARF 2 location expression support for GDB. 2 3 Copyright (C) 2003, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. 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 3 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, see <http://www.gnu.org/licenses/>. */ 19 20 #if !defined (DWARF2LOC_H) 21 #define DWARF2LOC_H 22 23 struct symbol_computed_ops; 24 struct objfile; 25 struct dwarf2_per_cu_data; 26 27 /* This header is private to the DWARF-2 reader. It is shared between 28 dwarf2read.c and dwarf2loc.c. */ 29 30 /* Return the OBJFILE associated with the compilation unit CU. */ 31 struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu); 32 33 /* Return the address size given in the compilation unit header for CU. */ 34 CORE_ADDR dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu); 35 36 /* The symbol location baton types used by the DWARF-2 reader (i.e. 37 SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct 38 dwarf2_locexpr_baton" is for a symbol with a single location 39 expression; "struct dwarf2_loclist_baton" is for a symbol with a 40 location list. */ 41 42 struct dwarf2_locexpr_baton 43 { 44 /* Pointer to the start of the location expression. */ 45 gdb_byte *data; 46 47 /* Length of the location expression. */ 48 unsigned long size; 49 50 /* The compilation unit containing the symbol whose location 51 we're computing. */ 52 struct dwarf2_per_cu_data *per_cu; 53 }; 54 55 struct dwarf2_loclist_baton 56 { 57 /* The initial base address for the location list, based on the compilation 58 unit. */ 59 CORE_ADDR base_address; 60 61 /* Pointer to the start of the location list. */ 62 gdb_byte *data; 63 64 /* Length of the location list. */ 65 unsigned long size; 66 67 /* The compilation unit containing the symbol whose location 68 we're computing. */ 69 struct dwarf2_per_cu_data *per_cu; 70 }; 71 72 extern const struct symbol_computed_ops dwarf2_locexpr_funcs; 73 extern const struct symbol_computed_ops dwarf2_loclist_funcs; 74 75 #endif /* dwarf2loc.h */ 76