/* Implementation of the GDB variable objects API.
- Copyright (C) 1999-2012 Free Software Foundation, Inc.
+ Copyright (C) 1999-2013 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
/* Non-zero if we want to see trace of varobj level stuff. */
-int varobjdebug = 0;
+unsigned int varobjdebug = 0;
static void
show_varobjdebug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
struct expression *exp;
/* Block for which this expression is valid. */
- struct block *valid_block;
+ const struct block *valid_block;
/* The frame for this expression. This field is set iff valid_block is
not NULL. */
make_cleanup_py_decref (children);
- if (!PyIter_Check (children))
- error (_("Returned value is not iterable"));
-
Py_XDECREF (var->child_iter);
var->child_iter = PyObject_GetIter (children);
if (!var->child_iter)
string_print. Otherwise just return the extracted
string as a value. */
- PyObject *py_str
- = python_string_to_target_python_string (output);
+ char *s = python_string_to_target_string (output);
- if (py_str)
+ if (s)
{
- char *s = PyString_AsString (py_str);
char *hint;
hint = gdbpy_get_display_hint (value_formatter);
xfree (hint);
}
- len = PyString_Size (py_str);
+ len = strlen (s);
thevalue = xmemdup (s, len + 1, len + 1);
type = builtin_type (gdbarch)->builtin_char;
- Py_DECREF (py_str);
+ xfree (s);
if (!string_print)
{
varobj_table = xmalloc (sizeof_table);
memset (varobj_table, 0, sizeof_table);
- add_setshow_zinteger_cmd ("debugvarobj", class_maintenance,
- &varobjdebug,
- _("Set varobj debugging."),
- _("Show varobj debugging."),
- _("When non-zero, varobj debugging is enabled."),
- NULL, show_varobjdebug,
- &setlist, &showlist);
+ add_setshow_zuinteger_cmd ("debugvarobj", class_maintenance,
+ &varobjdebug,
+ _("Set varobj debugging."),
+ _("Show varobj debugging."),
+ _("When non-zero, varobj debugging is enabled."),
+ NULL, show_varobjdebug,
+ &setlist, &showlist);
}
/* Invalidate varobj VAR if it is tied to locals and re-create it if it is