Browse Source

Re-indent.

binutils-2_12-branch
Andrew Cagney 25 years ago
parent
commit
72330bd63b
  1. 4
      gdb/ChangeLog
  2. 74
      gdb/varobj.c

4
gdb/ChangeLog

@ -1,3 +1,7 @@
2001-10-31 Andrew Cagney <ac131313@redhat.com>
* varobj.c: Re-indent.
2001-10-31 Andrew Cagney <ac131313@redhat.com> 2001-10-31 Andrew Cagney <ac131313@redhat.com>
* x86-64-tdep.c (value_push, x86_64_push_arguments): Replace * x86-64-tdep.c (value_push, x86_64_push_arguments): Replace

74
gdb/varobj.c

@ -36,8 +36,7 @@ char *varobj_format_string[] =
{ "natural", "binary", "decimal", "hexadecimal", "octal" }; { "natural", "binary", "decimal", "hexadecimal", "octal" };
/* String representations of gdb's known languages */ /* String representations of gdb's known languages */
char *varobj_language_string[] = char *varobj_language_string[] = { "unknown", "C", "C++", "Java" };
{"unknown", "C", "C++", "Java"};
/* Data structures */ /* Data structures */
@ -312,8 +311,7 @@ struct language_specific
/* Array of known source language routines. */ /* Array of known source language routines. */
static struct language_specific static struct language_specific
languages[vlang_end][sizeof (struct language_specific)] = languages[vlang_end][sizeof (struct language_specific)] = {
{
/* Unknown (try treating as C */ /* Unknown (try treating as C */
{ {
vlang_unknown, vlang_unknown,
@ -324,8 +322,7 @@ static struct language_specific
c_value_of_child, c_value_of_child,
c_type_of_child, c_type_of_child,
c_variable_editable, c_variable_editable,
c_value_of_variable c_value_of_variable}
}
, ,
/* C */ /* C */
{ {
@ -337,8 +334,7 @@ static struct language_specific
c_value_of_child, c_value_of_child,
c_type_of_child, c_type_of_child,
c_variable_editable, c_variable_editable,
c_value_of_variable c_value_of_variable}
}
, ,
/* C++ */ /* C++ */
{ {
@ -350,8 +346,7 @@ static struct language_specific
cplus_value_of_child, cplus_value_of_child,
cplus_type_of_child, cplus_type_of_child,
cplus_variable_editable, cplus_variable_editable,
cplus_value_of_variable cplus_value_of_variable}
}
, ,
/* Java */ /* Java */
{ {
@ -363,8 +358,7 @@ static struct language_specific
java_value_of_child, java_value_of_child,
java_type_of_child, java_type_of_child,
java_variable_editable, java_variable_editable,
java_value_of_variable java_value_of_variable}
}
}; };
/* A little convenience enum for dealing with C++/Java */ /* A little convenience enum for dealing with C++/Java */
@ -376,8 +370,7 @@ enum vsections
/* Private data */ /* Private data */
/* Mappings of varobj_display_formats enums to gdb's format codes */ /* Mappings of varobj_display_formats enums to gdb's format codes */
static int format_code[] = static int format_code[] = { 0, 't', 'd', 'x', 'o' };
{0, 't', 'd', 'x', 'o'};
/* Header of the list of root variable objects */ /* Header of the list of root variable objects */
static struct varobj_root *rootlist; static struct varobj_root *rootlist;
@ -401,8 +394,7 @@ static struct vlist **varobj_table;
struct varobj * struct varobj *
varobj_create (char *objname, varobj_create (char *objname,
char *expression, CORE_ADDR frame, char *expression, CORE_ADDR frame, enum varobj_type type)
enum varobj_type type)
{ {
struct varobj *var; struct varobj *var;
struct frame_info *fi; struct frame_info *fi;
@ -423,8 +415,7 @@ varobj_create (char *objname,
of the variable's data as possible */ of the variable's data as possible */
/* Allow creator to specify context of variable */ /* Allow creator to specify context of variable */
if ((type == USE_CURRENT_FRAME) if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME))
|| (type == USE_SELECTED_FRAME))
fi = selected_frame; fi = selected_frame;
else else
fi = find_frame_addr_in_frame_chain (frame); fi = find_frame_addr_in_frame_chain (frame);
@ -612,7 +603,8 @@ varobj_delete (struct varobj *var, char ***dellist, int only_children)
} }
if (mycount || (*cp != NULL)) if (mycount || (*cp != NULL))
warning ("varobj_delete: assertion failed - mycount(=%d) <> 0", mycount); warning ("varobj_delete: assertion failed - mycount(=%d) <> 0",
mycount);
} }
return delcount; return delcount;
@ -850,7 +842,8 @@ varobj_list (struct varobj ***varlist)
*cv = NULL; *cv = NULL;
if (mycount || (croot != NULL)) if (mycount || (croot != NULL))
warning ("varobj_list: assertion failed - wrong tally of root vars (%d:%d)", warning
("varobj_list: assertion failed - wrong tally of root vars (%d:%d)",
rootcount, mycount); rootcount, mycount);
return rootcount; return rootcount;
@ -927,7 +920,8 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
/* If values are not equal, note that it's changed. /* If values are not equal, note that it's changed.
There a couple of exceptions here, though. There a couple of exceptions here, though.
We don't want some types to be reported as "changed". */ We don't want some types to be reported as "changed". */
else if (type_changeable (*varp) && !my_value_equal ((*varp)->value, new, &error2)) else if (type_changeable (*varp)
&& !my_value_equal ((*varp)->value, new, &error2))
{ {
vpush (&result, *varp); vpush (&result, *varp);
changed++; changed++;
@ -1050,8 +1044,9 @@ delete_variable (struct cpstack **resultp, struct varobj *var,
and the parent is not removed we dump core. It must be always and the parent is not removed we dump core. It must be always
initially called with remove_from_parent_p set */ initially called with remove_from_parent_p set */
static void static void
delete_variable_1 (struct cpstack **resultp, int *delcountp, struct varobj *var, delete_variable_1 (struct cpstack **resultp, int *delcountp,
int only_children_p, int remove_from_parent_p) struct varobj *var, int only_children_p,
int remove_from_parent_p)
{ {
struct varobj_child *vc; struct varobj_child *vc;
struct varobj_child *next; struct varobj_child *next;
@ -1084,8 +1079,7 @@ delete_variable_1 (struct cpstack **resultp, int *delcountp, struct varobj *var,
(as indicated by remove_from_parent_p) we don't bother doing an (as indicated by remove_from_parent_p) we don't bother doing an
expensive list search to find the element to remove when we are expensive list search to find the element to remove when we are
discarding the list afterwards */ discarding the list afterwards */
if ((remove_from_parent_p) && if ((remove_from_parent_p) && (var->parent != NULL))
(var->parent != NULL))
{ {
remove_child_from_parent (var->parent, var); remove_child_from_parent (var->parent, var);
} }
@ -1171,7 +1165,9 @@ uninstall_variable (struct varobj *var)
if (cv == NULL) if (cv == NULL)
{ {
warning ("Assertion failed: Could not find variable object \"%s\" to delete", var->obj_name); warning
("Assertion failed: Could not find variable object \"%s\" to delete",
var->obj_name);
return; return;
} }
@ -1199,7 +1195,9 @@ uninstall_variable (struct varobj *var)
} }
if (cr == NULL) if (cr == NULL)
{ {
warning ("Assertion failed: Could not find varobj \"%s\" in root list", var->obj_name); warning
("Assertion failed: Could not find varobj \"%s\" in root list",
var->obj_name);
return; return;
} }
if (prer == NULL) if (prer == NULL)
@ -1245,8 +1243,9 @@ create_child (struct varobj *parent, int index, char *name)
child->error = 1; child->error = 1;
child->parent = parent; child->parent = parent;
child->root = parent->root; child->root = parent->root;
childs_name = (char *) xmalloc ((strlen (parent->obj_name) + strlen (name) + 2) childs_name =
* sizeof (char)); (char *) xmalloc ((strlen (parent->obj_name) + strlen (name) + 2) *
sizeof (char));
sprintf (childs_name, "%s.%s", parent->obj_name, name); sprintf (childs_name, "%s.%s", parent->obj_name, name);
child->obj_name = childs_name; child->obj_name = childs_name;
install_variable (child); install_variable (child);
@ -1844,7 +1843,8 @@ c_name_of_child (struct varobj *parent, int index)
break; break;
default: default:
name = (char *) xmalloc ((strlen (parent->name) + 2) * sizeof (char)); name =
(char *) xmalloc ((strlen (parent->name) + 2) * sizeof (char));
sprintf (name, "*%s", parent->name); sprintf (name, "*%s", parent->name);
break; break;
} }
@ -1958,7 +1958,8 @@ c_value_of_child (struct varobj *parent, int index)
{ {
case TYPE_CODE_STRUCT: case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION: case TYPE_CODE_UNION:
value = value_struct_elt (&temp, NULL, name, NULL, "vstructure"); value =
value_struct_elt (&temp, NULL, name, NULL, "vstructure");
break; break;
default: default:
@ -2166,8 +2167,7 @@ cplus_class_num_children (struct type *type, int children[3])
for (i = TYPE_N_BASECLASSES (type); i < TYPE_NFIELDS (type); i++) for (i = TYPE_N_BASECLASSES (type); i < TYPE_NFIELDS (type); i++)
{ {
/* If we have a virtual table pointer, omit it. */ /* If we have a virtual table pointer, omit it. */
if (TYPE_VPTR_BASETYPE (type) == type if (TYPE_VPTR_BASETYPE (type) == type && TYPE_VPTR_FIELDNO (type) == i)
&& TYPE_VPTR_FIELDNO (type) == i)
continue; continue;
if (TYPE_FIELD_PROTECTED (type, i)) if (TYPE_FIELD_PROTECTED (type, i))
@ -2212,7 +2212,8 @@ cplus_name_of_child (struct varobj *parent, int index)
/* FIXME: This assumes that type orders /* FIXME: This assumes that type orders
inherited, public, private, protected */ inherited, public, private, protected */
int i = index + TYPE_N_BASECLASSES (type); int i = index + TYPE_N_BASECLASSES (type);
if (STREQ (parent->name, "private") || STREQ (parent->name, "protected")) if (STREQ (parent->name, "private")
|| STREQ (parent->name, "protected"))
i += children[v_public]; i += children[v_public];
if (STREQ (parent->name, "protected")) if (STREQ (parent->name, "protected"))
i += children[v_private]; i += children[v_private];
@ -2472,10 +2473,7 @@ _initialize_varobj (void)
varobj_table = xmalloc (sizeof_table); varobj_table = xmalloc (sizeof_table);
memset (varobj_table, 0, sizeof_table); memset (varobj_table, 0, sizeof_table);
add_show_from_set ( add_show_from_set (add_set_cmd ("debugvarobj", class_maintenance, var_zinteger, (char *) &varobjdebug, "Set varobj debugging.\n\
add_set_cmd ("debugvarobj", class_maintenance, var_zinteger,
(char *) &varobjdebug,
"Set varobj debugging.\n\
When non-zero, varobj debugging is enabled.", &setlist), When non-zero, varobj debugging is enabled.", &setlist),
&showlist); &showlist);
} }

Loading…
Cancel
Save