aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 0cd0bd0..4dc986a 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1,6 +1,6 @@
/* Implementation of the GDB variable objects API.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 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
@@ -323,10 +323,7 @@ varobj_create (const char *objname,
}
/* Don't allow variables to be created for types. */
- enum exp_opcode opcode = var->root->exp->first_opcode ();
- if (opcode == OP_TYPE
- || opcode == OP_TYPEOF
- || opcode == OP_DECLTYPE)
+ if (var->root->exp->type_p ())
{
gdb_printf (gdb_stderr, "Attempt to use a type name"
" as an expression.\n");
@@ -1186,7 +1183,7 @@ install_new_value (struct varobj *var, struct value *value, bool initial)
changeable = varobj_value_is_changeable_p (var);
/* If the type has custom visualizer, we consider it to be always
- changeable. FIXME: need to make sure this behaviour will not
+ changeable. FIXME: need to make sure this behavior will not
mess up read-sensitive values. */
if (var->dynamic->pretty_printer != NULL)
changeable = true;
@@ -1312,7 +1309,7 @@ install_new_value (struct varobj *var, struct value *value, bool initial)
{
/* For values that are not changeable, we don't compare the values.
However, we want to notice if a value was not NULL and now is NULL,
- or vise versa, so that we report when top-level varobjs come in scope
+ or vice versa, so that we report when top-level varobjs come in scope
and leave the scope. */
changed = (var->value != NULL) != (value != NULL);
}
@@ -2427,9 +2424,7 @@ eq_varobj_and_string (const void *a, const void *b)
return obj->obj_name == name;
}
-void _initialize_varobj ();
-void
-_initialize_varobj ()
+INIT_GDB_FILE (varobj)
{
varobj_table = htab_create_alloc (5, hash_varobj, eq_varobj_and_string,
nullptr, xcalloc, xfree);