2010-08-18 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / dwarf2loc.h
CommitLineData
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 24struct symbol_computed_ops;
ae0d2f24
UW
25struct objfile;
26struct dwarf2_per_cu_data;
a67af2b9 27
4c2df51b
DJ
28/* This header is private to the DWARF-2 reader. It is shared between
29 dwarf2read.c and dwarf2loc.c. */
30
9aa1f1e3
TT
31/* Return the OBJFILE associated with the compilation unit CU. If CU
32 came from a separate debuginfo file, then the master objfile is
33 returned. */
ae0d2f24
UW
34struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu);
35
36/* Return the address size given in the compilation unit header for CU. */
37CORE_ADDR dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu);
38
9eae7c52
TT
39/* Return the offset size given in the compilation unit header for CU. */
40int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu);
41
9aa1f1e3
TT
42/* Return the text offset of the CU. The returned offset comes from
43 this CU's objfile. If this objfile came from a separate debuginfo
44 file, then the offset may be different from the corresponding
45 offset in the parent objfile. */
46CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu);
47
5c631832
JK
48struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block
49 (unsigned int offset, struct dwarf2_per_cu_data *per_cu);
50
98bfdba5
PA
51/* Evaluate a location description, starting at DATA and with length
52 SIZE, to find the current location of variable of TYPE in the context
53 of FRAME. */
54
55struct value *dwarf2_evaluate_loc_desc (struct type *type,
56 struct frame_info *frame,
57 const gdb_byte *data,
58 unsigned short size,
59 struct dwarf2_per_cu_data *per_cu);
60
0d53c4c4
DJ
61/* The symbol location baton types used by the DWARF-2 reader (i.e.
62 SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct
63 dwarf2_locexpr_baton" is for a symbol with a single location
64 expression; "struct dwarf2_loclist_baton" is for a symbol with a
65 location list. */
4c2df51b
DJ
66
67struct dwarf2_locexpr_baton
68{
0d53c4c4 69 /* Pointer to the start of the location expression. */
947bb88f 70 const gdb_byte *data;
0d53c4c4
DJ
71
72 /* Length of the location expression. */
607269ae 73 unsigned long size;
0d53c4c4 74
ae0d2f24
UW
75 /* The compilation unit containing the symbol whose location
76 we're computing. */
77 struct dwarf2_per_cu_data *per_cu;
0d53c4c4
DJ
78};
79
80struct dwarf2_loclist_baton
81{
82 /* The initial base address for the location list, based on the compilation
83 unit. */
84 CORE_ADDR base_address;
85
86 /* Pointer to the start of the location list. */
947bb88f 87 const gdb_byte *data;
0d53c4c4
DJ
88
89 /* Length of the location list. */
607269ae 90 unsigned long size;
0d53c4c4 91
ae0d2f24
UW
92 /* The compilation unit containing the symbol whose location
93 we're computing. */
94 struct dwarf2_per_cu_data *per_cu;
4c2df51b
DJ
95};
96
768a979c
UW
97extern const struct symbol_computed_ops dwarf2_locexpr_funcs;
98extern const struct symbol_computed_ops dwarf2_loclist_funcs;
4c2df51b 99
852483bc 100#endif /* dwarf2loc.h */
This page took 0.548337 seconds and 4 git commands to generate.