Fix gdb.trace/entry-values.exp for thumb mode
[deliverable/binutils-gdb.git] / gdb / jv-varobj.c
CommitLineData
99ad9427
YQ
1/* varobj support for Java.
2
ecd75fc8 3 Copyright (C) 1999-2014 Free Software Foundation, Inc.
99ad9427
YQ
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
7 the Free Software Foundation; either version 3 of the License, or
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
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18#include "defs.h"
19#include "varobj.h"
20
21/* Java */
22
23static int
24java_number_of_children (struct varobj *var)
25{
26 return cplus_varobj_ops.number_of_children (var);
27}
28
29static char *
30java_name_of_variable (struct varobj *parent)
31{
32 char *p, *name;
33
34 name = cplus_varobj_ops.name_of_variable (parent);
35 /* If the name has "-" in it, it is because we
36 needed to escape periods in the name... */
37 p = name;
38
39 while (*p != '\000')
40 {
41 if (*p == '-')
42 *p = '.';
43 p++;
44 }
45
46 return name;
47}
48
49static char *
50java_name_of_child (struct varobj *parent, int index)
51{
52 char *name, *p;
53
54 name = cplus_varobj_ops.name_of_child (parent, index);
55 /* Escape any periods in the name... */
56 p = name;
57
58 while (*p != '\000')
59 {
60 if (*p == '.')
61 *p = '-';
62 p++;
63 }
64
65 return name;
66}
67
68static char *
69java_path_expr_of_child (struct varobj *child)
70{
71 return NULL;
72}
73
74static struct value *
75java_value_of_child (struct varobj *parent, int index)
76{
77 return cplus_varobj_ops.value_of_child (parent, index);
78}
79
80static struct type *
81java_type_of_child (struct varobj *parent, int index)
82{
83 return cplus_varobj_ops.type_of_child (parent, index);
84}
85
86static char *
87java_value_of_variable (struct varobj *var, enum varobj_display_formats format)
88{
89 return cplus_varobj_ops.value_of_variable (var, format);
90}
91
92/* varobj operations for java. */
93
94const struct lang_varobj_ops java_varobj_ops =
95{
96 java_number_of_children,
97 java_name_of_variable,
98 java_name_of_child,
99 java_path_expr_of_child,
100 java_value_of_child,
101 java_type_of_child,
102 java_value_of_variable,
103 varobj_default_value_is_changeable_p,
104 NULL /* value_has_mutated */
105};
This page took 0.0946 seconds and 4 git commands to generate.