]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/varobj.h
* output.h (Output_data_got::add_constant): Tidy.
[thirdparty/binutils-gdb.git] / gdb / varobj.h
CommitLineData
8b93c638 1/* GDB variable objects API.
8acc9f48 2 Copyright (C) 1999-2013 Free Software Foundation, Inc.
8b93c638
JM
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
a9762ec7 6 the Free Software Foundation; either version 3 of the License, or
8b93c638
JM
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
a9762ec7 15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8b93c638
JM
16
17#ifndef VAROBJ_H
18#define VAROBJ_H 1
19
20#include "symtab.h"
21#include "gdbtypes.h"
d56d46f5 22#include "vec.h"
8b93c638
JM
23
24/* Enumeration for the format types */
25enum varobj_display_formats
26 {
27 FORMAT_NATURAL, /* What gdb actually calls 'natural' */
28 FORMAT_BINARY, /* Binary display */
29 FORMAT_DECIMAL, /* Decimal display */
30 FORMAT_HEXADECIMAL, /* Hex display */
31 FORMAT_OCTAL /* Octal display */
32 };
33
73a93a32
JI
34enum varobj_type
35 {
581e13c1
MS
36 USE_SPECIFIED_FRAME, /* Use the frame passed to varobj_create. */
37 USE_CURRENT_FRAME, /* Use the current frame. */
38 USE_SELECTED_FRAME /* Always reevaluate in selected frame. */
73a93a32 39 };
8756216b 40
f7f9ae2c
VP
41/* Enumerator describing if a variable object is in scope. */
42enum varobj_scope_status
8756216b 43 {
f7f9ae2c 44 VAROBJ_IN_SCOPE = 0, /* Varobj is scope, value available. */
3e43a32a
MS
45 VAROBJ_NOT_IN_SCOPE = 1, /* Varobj is not in scope, value not
46 available, but varobj can become in
47 scope later. */
f7f9ae2c
VP
48 VAROBJ_INVALID = 2, /* Varobj no longer has any value, and never
49 will. */
8756216b
DP
50 };
51
581e13c1 52/* String representations of gdb's format codes (defined in varobj.c). */
8b93c638
JM
53extern char *varobj_format_string[];
54
1cc47d81
YQ
55/* Languages supported by this variable objects system. This enum is used
56 to index arrays so we make its first enum explicitly zero. */
8b93c638
JM
57enum varobj_languages
58 {
c573f273 59 vlang_c = 0, vlang_cplus, vlang_java, vlang_ada, vlang_end
8b93c638
JM
60 };
61
581e13c1 62/* String representations of gdb's known languages (defined in varobj.c). */
8b93c638
JM
63extern char *varobj_language_string[];
64
581e13c1 65/* Struct thar describes a variable object instance. */
8b93c638
JM
66struct varobj;
67
d56d46f5
VP
68typedef struct varobj *varobj_p;
69DEF_VEC_P (varobj_p);
70
f7f9ae2c
VP
71typedef struct varobj_update_result_t
72{
73 struct varobj *varobj;
74 int type_changed;
b6313243 75 int children_changed;
f7f9ae2c
VP
76 int changed;
77 enum varobj_scope_status status;
b6313243
TT
78 /* This variable is used internally by varobj_update to indicate if the
79 new value of varobj is already computed and installed, or has to
581e13c1 80 be yet installed. Don't use this outside varobj.c. */
b6313243 81 int value_installed;
0cc7d26f
TT
82
83 /* This will be non-NULL when new children were added to the varobj.
84 It lists the new children (which must necessarily come at the end
85 of the child list) added during an update. The caller is
86 responsible for freeing this vector. */
87 VEC (varobj_p) *new;
f7f9ae2c
VP
88} varobj_update_result;
89
90DEF_VEC_O (varobj_update_result);
91
8b93c638
JM
92/* API functions */
93
94extern struct varobj *varobj_create (char *objname,
73a93a32
JI
95 char *expression, CORE_ADDR frame,
96 enum varobj_type type);
8b93c638
JM
97
98extern char *varobj_gen_name (void);
99
100extern struct varobj *varobj_get_handle (char *name);
101
102extern char *varobj_get_objname (struct varobj *var);
103
104extern char *varobj_get_expression (struct varobj *var);
105
106extern int varobj_delete (struct varobj *var, char ***dellist,
107 int only_children);
108
109extern enum varobj_display_formats varobj_set_display_format (
110 struct varobj *var,
111 enum varobj_display_formats format);
112
113extern enum varobj_display_formats varobj_get_display_format (
114 struct varobj *var);
115
c5b48eac
VP
116extern int varobj_get_thread_id (struct varobj *var);
117
25d5ea92
VP
118extern void varobj_set_frozen (struct varobj *var, int frozen);
119
120extern int varobj_get_frozen (struct varobj *var);
121
0cc7d26f
TT
122extern void varobj_get_child_range (struct varobj *var, int *from, int *to);
123
124extern void varobj_set_child_range (struct varobj *var, int from, int to);
125
b6313243
TT
126extern char *varobj_get_display_hint (struct varobj *var);
127
8b93c638
JM
128extern int varobj_get_num_children (struct varobj *var);
129
0cc7d26f
TT
130/* Return the list of children of VAR. The returned vector should not
131 be modified in any way. FROM and TO are in/out parameters
132 indicating the range of children to return. If either *FROM or *TO
133 is less than zero on entry, then all children will be returned. On
134 return, *FROM and *TO will be updated to indicate the real range
135 that was returned. The resulting VEC will contain at least the
136 children from *FROM to just before *TO; it might contain more
137 children, depending on whether any more were available. */
138extern VEC (varobj_p)* varobj_list_children (struct varobj *var,
139 int *from, int *to);
8b93c638
JM
140
141extern char *varobj_get_type (struct varobj *var);
142
1ecb4ee0
DJ
143extern struct type *varobj_get_gdb_type (struct varobj *var);
144
02142340
VP
145extern char *varobj_get_path_expr (struct varobj *var);
146
8b93c638
JM
147extern enum varobj_languages varobj_get_language (struct varobj *var);
148
149extern int varobj_get_attributes (struct varobj *var);
150
de051565
MK
151extern char *varobj_get_formatted_value (struct varobj *var,
152 enum varobj_display_formats format);
153
8b93c638
JM
154extern char *varobj_get_value (struct varobj *var);
155
156extern int varobj_set_value (struct varobj *var, char *expression);
157
54333c3b
JK
158extern void all_root_varobjs (void (*func) (struct varobj *var, void *data),
159 void *data);
8b93c638 160
f7f9ae2c
VP
161extern VEC(varobj_update_result) *varobj_update (struct varobj **varp,
162 int explicit);
8b93c638 163
8756216b
DP
164extern void varobj_invalidate (void);
165
c203027e
NR
166extern int varobj_editable_p (struct varobj *var);
167
5a413362
VP
168extern int varobj_floating_p (struct varobj *var);
169
2021ad3a
PM
170extern void varobj_set_visualizer (struct varobj *var,
171 const char *visualizer);
0cc7d26f
TT
172
173extern void varobj_enable_pretty_printing (void);
174
175extern int varobj_has_more (struct varobj *var, int to);
176
177extern int varobj_pretty_printed_p (struct varobj *var);
b6313243 178
8b93c638 179#endif /* VAROBJ_H */