*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / varobj.c
index c86e38ce2a8791f78908f932391093b048c4f906..76ced134a8b33dc3e83b002b3c9f654bbc388ef5 100644 (file)
@@ -1,6 +1,7 @@
 /* Implementation of the GDB variable objects API.
 
-   Copyright 1999, 2000, 2001, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,8 +15,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "defs.h"
 #include "exceptions.h"
 /* Non-zero if we want to see trace of varobj level stuff.  */
 
 int varobjdebug = 0;
+static void
+show_varobjdebug (struct ui_file *file, int from_tty,
+                 struct cmd_list_element *c, const char *value)
+{
+  fprintf_filtered (file, _("Varobj debugging is %s.\n"), value);
+}
 
 /* String representations of gdb's format codes */
 char *varobj_format_string[] =
@@ -754,6 +761,14 @@ varobj_get_type (struct varobj *var)
   return thetype;
 }
 
+/* Obtain the type of an object variable.  */
+
+struct type *
+varobj_get_gdb_type (struct varobj *var)
+{
+  return var->type;
+}
+
 enum varobj_languages
 varobj_get_language (struct varobj *var)
 {
@@ -1359,7 +1374,7 @@ free_variable (struct varobj *var)
   /* Free the expression if this is a root variable. */
   if (var->root->rootvar == var)
     {
-      free_current_contents ((char **) &var->root->exp);
+      free_current_contents (&var->root->exp);
       xfree (var->root);
     }
 
@@ -1444,9 +1459,9 @@ variable_default_display (struct varobj *var)
    can't be established, *ERROR2 is set to non-zero.  */
 
 static int
-my_value_equal (struct value *val1, struct value *val2, int *error2)
+my_value_equal (struct value *val1, struct value *volatile val2, int *error2)
 {
-  volatile struct exception except;
+  volatile struct gdb_exception except;
 
   /* As a special case, if both are null, we say they're equal.  */
   if (val1 == NULL && val2 == NULL)
@@ -2074,10 +2089,8 @@ c_value_of_variable (struct varobj *var)
 
            if (value_lazy (var->value))
              gdb_value_fetch_lazy (var->value);
-           val_print (value_type (var->value),
-                      value_contents_raw (var->value), 0,
-                      VALUE_ADDRESS (var->value), stb,
-                      format_code[(int) var->format], 1, 0, 0);
+           common_val_print (var->value, stb,
+                             format_code[(int) var->format], 1, 0, 0);
            thevalue = ui_file_xstrdup (stb, &dummy);
            do_cleanups (old_chain);
        return thevalue;
@@ -2545,6 +2558,6 @@ Set varobj debugging."), _("\
 Show varobj debugging."), _("\
 When non-zero, varobj debugging is enabled."),
                            NULL,
-                           NULL, /* FIXME: i18n: */
+                           show_varobjdebug,
                            &setlist, &showlist);
 }
This page took 0.026047 seconds and 4 git commands to generate.