gdb/jv-varobj.c - gdb

Global variables defined

Functions defined

Source code

  1. /* varobj support for Java.

  2.    Copyright (C) 1999-2015 Free Software Foundation, Inc.

  3.    This program is free software; you can redistribute it and/or modify
  4.    it under the terms of the GNU General Public License as published by
  5.    the Free Software Foundation; either version 3 of the License, or
  6.    (at your option) any later version.

  7.    This program is distributed in the hope that it will be useful,
  8.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10.    GNU General Public License for more details.

  11.    You should have received a copy of the GNU General Public License
  12.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  13. #include "defs.h"
  14. #include "varobj.h"

  15. /* Java */

  16. static int
  17. java_number_of_children (struct varobj *var)
  18. {
  19.   return cplus_varobj_ops.number_of_children (var);
  20. }

  21. static char *
  22. java_name_of_variable (struct varobj *parent)
  23. {
  24.   char *p, *name;

  25.   name = cplus_varobj_ops.name_of_variable (parent);
  26.   /* If  the name has "-" in it, it is because we
  27.      needed to escape periods in the name...  */
  28.   p = name;

  29.   while (*p != '\000')
  30.     {
  31.       if (*p == '-')
  32.         *p = '.';
  33.       p++;
  34.     }

  35.   return name;
  36. }

  37. static char *
  38. java_name_of_child (struct varobj *parent, int index)
  39. {
  40.   char *name, *p;

  41.   name = cplus_varobj_ops.name_of_child (parent, index);
  42.   /* Escape any periods in the name...  */
  43.   p = name;

  44.   while (*p != '\000')
  45.     {
  46.       if (*p == '.')
  47.         *p = '-';
  48.       p++;
  49.     }

  50.   return name;
  51. }

  52. static char *
  53. java_path_expr_of_child (struct varobj *child)
  54. {
  55.   return NULL;
  56. }

  57. static struct value *
  58. java_value_of_child (struct varobj *parent, int index)
  59. {
  60.   return cplus_varobj_ops.value_of_child (parent, index);
  61. }

  62. static struct type *
  63. java_type_of_child (struct varobj *parent, int index)
  64. {
  65.   return cplus_varobj_ops.type_of_child (parent, index);
  66. }

  67. static char *
  68. java_value_of_variable (struct varobj *var, enum varobj_display_formats format)
  69. {
  70.   return cplus_varobj_ops.value_of_variable (var, format);
  71. }

  72. /* varobj operations for java.  */

  73. const struct lang_varobj_ops java_varobj_ops =
  74. {
  75.    java_number_of_children,
  76.    java_name_of_variable,
  77.    java_name_of_child,
  78.    java_path_expr_of_child,
  79.    java_value_of_child,
  80.    java_type_of_child,
  81.    java_value_of_variable,
  82.    varobj_default_value_is_changeable_p,
  83.    NULL, /* value_has_mutated */
  84.    varobj_default_is_path_expr_parent
  85. };