2009-07-01 Paul Brook <paul@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / varobj.h
CommitLineData
8b93c638 1/* GDB variable objects API.
0fb0cc75 2 Copyright (C) 1999, 2000, 2001, 2005, 2007, 2008, 2009
9b254dd1 3 Free Software Foundation, Inc.
8b93c638
JM
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
a9762ec7 7 the Free Software Foundation; either version 3 of the License, or
8b93c638
JM
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
a9762ec7 16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
8b93c638
JM
17
18#ifndef VAROBJ_H
19#define VAROBJ_H 1
20
21#include "symtab.h"
22#include "gdbtypes.h"
d56d46f5 23#include "vec.h"
8b93c638
JM
24
25/* Enumeration for the format types */
26enum varobj_display_formats
27 {
28 FORMAT_NATURAL, /* What gdb actually calls 'natural' */
29 FORMAT_BINARY, /* Binary display */
30 FORMAT_DECIMAL, /* Decimal display */
31 FORMAT_HEXADECIMAL, /* Hex display */
32 FORMAT_OCTAL /* Octal display */
33 };
34
73a93a32
JI
35enum varobj_type
36 {
37 USE_SPECIFIED_FRAME, /* Use the frame passed to varobj_create */
38 USE_CURRENT_FRAME, /* Use the current frame */
39 USE_SELECTED_FRAME /* Always reevaluate in selected frame */
40 };
8756216b 41
f7f9ae2c
VP
42/* Enumerator describing if a variable object is in scope. */
43enum varobj_scope_status
8756216b 44 {
f7f9ae2c
VP
45 VAROBJ_IN_SCOPE = 0, /* Varobj is scope, value available. */
46 VAROBJ_NOT_IN_SCOPE = 1, /* Varobj is not in scope, value not available,
47 but varobj can become in scope later. */
48 VAROBJ_INVALID = 2, /* Varobj no longer has any value, and never
49 will. */
8756216b
DP
50 };
51
8b93c638
JM
52/* String representations of gdb's format codes (defined in varobj.c) */
53extern char *varobj_format_string[];
54
55/* Languages supported by this variable objects system. */
56enum varobj_languages
57 {
58 vlang_unknown = 0, vlang_c, vlang_cplus, vlang_java, vlang_end
59 };
60
61/* String representations of gdb's known languages (defined in varobj.c) */
62extern char *varobj_language_string[];
63
64/* Struct thar describes a variable object instance */
65struct varobj;
66
d56d46f5
VP
67typedef struct varobj *varobj_p;
68DEF_VEC_P (varobj_p);
69
f7f9ae2c
VP
70typedef struct varobj_update_result_t
71{
72 struct varobj *varobj;
73 int type_changed;
b6313243 74 int children_changed;
f7f9ae2c
VP
75 int changed;
76 enum varobj_scope_status status;
b6313243
TT
77 /* This variable is used internally by varobj_update to indicate if the
78 new value of varobj is already computed and installed, or has to
79 be yet installed. Don't use this outside varobj.c */
80 int value_installed;
f7f9ae2c
VP
81} varobj_update_result;
82
83DEF_VEC_O (varobj_update_result);
84
8b93c638
JM
85/* API functions */
86
87extern struct varobj *varobj_create (char *objname,
73a93a32
JI
88 char *expression, CORE_ADDR frame,
89 enum varobj_type type);
8b93c638
JM
90
91extern char *varobj_gen_name (void);
92
93extern struct varobj *varobj_get_handle (char *name);
94
95extern char *varobj_get_objname (struct varobj *var);
96
97extern char *varobj_get_expression (struct varobj *var);
98
99extern int varobj_delete (struct varobj *var, char ***dellist,
100 int only_children);
101
102extern enum varobj_display_formats varobj_set_display_format (
103 struct varobj *var,
104 enum varobj_display_formats format);
105
106extern enum varobj_display_formats varobj_get_display_format (
107 struct varobj *var);
108
c5b48eac
VP
109extern int varobj_get_thread_id (struct varobj *var);
110
25d5ea92
VP
111extern void varobj_set_frozen (struct varobj *var, int frozen);
112
113extern int varobj_get_frozen (struct varobj *var);
114
b6313243
TT
115extern char *varobj_get_display_hint (struct varobj *var);
116
8b93c638
JM
117extern int varobj_get_num_children (struct varobj *var);
118
d56d46f5
VP
119/* Return the list of children of VAR. The returned vector
120 should not be modified in any way. */
121extern VEC (varobj_p)* varobj_list_children (struct varobj *var);
8b93c638
JM
122
123extern char *varobj_get_type (struct varobj *var);
124
1ecb4ee0
DJ
125extern struct type *varobj_get_gdb_type (struct varobj *var);
126
02142340
VP
127extern char *varobj_get_path_expr (struct varobj *var);
128
8b93c638
JM
129extern enum varobj_languages varobj_get_language (struct varobj *var);
130
131extern int varobj_get_attributes (struct varobj *var);
132
de051565
MK
133extern char *varobj_get_formatted_value (struct varobj *var,
134 enum varobj_display_formats format);
135
8b93c638
JM
136extern char *varobj_get_value (struct varobj *var);
137
138extern int varobj_set_value (struct varobj *var, char *expression);
139
140extern int varobj_list (struct varobj ***rootlist);
141
f7f9ae2c
VP
142extern VEC(varobj_update_result) *varobj_update (struct varobj **varp,
143 int explicit);
8b93c638 144
8756216b
DP
145extern void varobj_invalidate (void);
146
c203027e
NR
147extern int varobj_editable_p (struct varobj *var);
148
5a413362
VP
149extern int varobj_floating_p (struct varobj *var);
150
b6313243
TT
151extern void varobj_set_visualizer (struct varobj *var, const char *visualizer);
152
8b93c638 153#endif /* VAROBJ_H */
This page took 1.282469 seconds and 4 git commands to generate.