Commit | Line | Data |
---|---|---|
852483bc MK |
1 | /* DWARF 2 location expression support for GDB. |
2 | ||
4c38e0a4 JB |
3 | Copyright (C) 2003, 2005, 2007, 2008, 2009, 2010 |
4 | Free Software Foundation, Inc. | |
4c2df51b DJ |
5 | |
6 | This file is part of GDB. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 10 | the Free Software Foundation; either version 3 of the License, or |
4c2df51b DJ |
11 | (at your option) any later version. |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
4c2df51b DJ |
20 | |
21 | #if !defined (DWARF2LOC_H) | |
22 | #define DWARF2LOC_H | |
23 | ||
768a979c | 24 | struct symbol_computed_ops; |
ae0d2f24 UW |
25 | struct objfile; |
26 | struct dwarf2_per_cu_data; | |
8cf6f0b1 | 27 | struct dwarf2_loclist_baton; |
a67af2b9 | 28 | |
4c2df51b DJ |
29 | /* This header is private to the DWARF-2 reader. It is shared between |
30 | dwarf2read.c and dwarf2loc.c. */ | |
31 | ||
9aa1f1e3 TT |
32 | /* Return the OBJFILE associated with the compilation unit CU. If CU |
33 | came from a separate debuginfo file, then the master objfile is | |
34 | returned. */ | |
ae0d2f24 UW |
35 | struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu); |
36 | ||
37 | /* Return the address size given in the compilation unit header for CU. */ | |
38 | CORE_ADDR dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu); | |
39 | ||
9eae7c52 TT |
40 | /* Return the offset size given in the compilation unit header for CU. */ |
41 | int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu); | |
42 | ||
9aa1f1e3 TT |
43 | /* Return the text offset of the CU. The returned offset comes from |
44 | this CU's objfile. If this objfile came from a separate debuginfo | |
45 | file, then the offset may be different from the corresponding | |
46 | offset in the parent objfile. */ | |
47 | CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu); | |
48 | ||
8cf6f0b1 TT |
49 | /* Find a particular location expression from a location list. */ |
50 | const gdb_byte *dwarf2_find_location_expression | |
51 | (struct dwarf2_loclist_baton *baton, | |
52 | size_t *locexpr_length, | |
53 | CORE_ADDR pc); | |
54 | ||
5c631832 | 55 | struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block |
8cf6f0b1 TT |
56 | (unsigned int offset, struct dwarf2_per_cu_data *per_cu, |
57 | CORE_ADDR (*get_frame_pc) (void *baton), | |
58 | void *baton); | |
5c631832 | 59 | |
98bfdba5 PA |
60 | /* Evaluate a location description, starting at DATA and with length |
61 | SIZE, to find the current location of variable of TYPE in the context | |
62 | of FRAME. */ | |
63 | ||
64 | struct value *dwarf2_evaluate_loc_desc (struct type *type, | |
65 | struct frame_info *frame, | |
66 | const gdb_byte *data, | |
67 | unsigned short size, | |
68 | struct dwarf2_per_cu_data *per_cu); | |
69 | ||
0d53c4c4 DJ |
70 | /* The symbol location baton types used by the DWARF-2 reader (i.e. |
71 | SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct | |
72 | dwarf2_locexpr_baton" is for a symbol with a single location | |
73 | expression; "struct dwarf2_loclist_baton" is for a symbol with a | |
74 | location list. */ | |
4c2df51b DJ |
75 | |
76 | struct dwarf2_locexpr_baton | |
77 | { | |
0d53c4c4 | 78 | /* Pointer to the start of the location expression. */ |
947bb88f | 79 | const gdb_byte *data; |
0d53c4c4 DJ |
80 | |
81 | /* Length of the location expression. */ | |
607269ae | 82 | unsigned long size; |
0d53c4c4 | 83 | |
ae0d2f24 UW |
84 | /* The compilation unit containing the symbol whose location |
85 | we're computing. */ | |
86 | struct dwarf2_per_cu_data *per_cu; | |
0d53c4c4 DJ |
87 | }; |
88 | ||
89 | struct dwarf2_loclist_baton | |
90 | { | |
91 | /* The initial base address for the location list, based on the compilation | |
92 | unit. */ | |
93 | CORE_ADDR base_address; | |
94 | ||
95 | /* Pointer to the start of the location list. */ | |
947bb88f | 96 | const gdb_byte *data; |
0d53c4c4 DJ |
97 | |
98 | /* Length of the location list. */ | |
607269ae | 99 | unsigned long size; |
0d53c4c4 | 100 | |
ae0d2f24 UW |
101 | /* The compilation unit containing the symbol whose location |
102 | we're computing. */ | |
103 | struct dwarf2_per_cu_data *per_cu; | |
4c2df51b DJ |
104 | }; |
105 | ||
768a979c UW |
106 | extern const struct symbol_computed_ops dwarf2_locexpr_funcs; |
107 | extern const struct symbol_computed_ops dwarf2_loclist_funcs; | |
4c2df51b | 108 | |
852483bc | 109 | #endif /* dwarf2loc.h */ |