aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1996-12-14 09:17:22 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1996-12-14 09:17:22 +0000
commita46d92a73667cff1203670ca5584757887f9c553 (patch)
tree92db92a8af8816651b00174b62398539acfdf013 /gdb/valops.c
parent93f8f531b068d20ee96799df210b786ef0b0c657 (diff)
downloadgdb-a46d92a73667cff1203670ca5584757887f9c553.zip
gdb-a46d92a73667cff1203670ca5584757887f9c553.tar.gz
gdb-a46d92a73667cff1203670ca5584757887f9c553.tar.bz2
* c-exp.y (qualified_name): Replace explicit check for valid
destructor name with call to destructor_name_p. * c-lang.h, c-typeprint.c (cp_type_print_method_args): Removed, no longer needed. * c-typeprint.c (c_type_print_varspec_prefix, c_type_print_base): Replace remaining fprintf_unfiltered calls with their filtered variant. (c_type_print_base): Do not print return type for destructors from template classes. Replace cp_type_print_method_args with cplus_demangle call to get consistent type output for stubbed and unstubbed methods. * cp-valprint.c (cp_print_class_method): Replace cp_type_print_method_args with cplus_demangle call to get consistent type output for stubbed and unstubbed methods. * gdbtypes.c, gdbtypes.h (get_destructor_fn_field): New function to find the destructor field indices for a type. * gdbtypes.h (struct type): Clarify comments for vptr_basetype and arg_types fields. (struct fn_field): Remove args field, no longer used. * symtab.c (decode_line_1), valops.c (value_struct_elt, check_field_in): Use get_destructor_fn_field to find the destructor field indices instead of assuming that the compiler passes the member function fields in a specific order. * symtab.c (find_methods): Pass NULL instead of SYMBOL_BLOCK_VALUE to lookup_symbol. (list_symbol): Replace cp_type_print_method_args with cplus_demangle call in zapped out code and explain why this code is zapped out.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index b23d08b..fc98c95 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1,5 +1,5 @@
/* Perform non-arithmetic operations on values, for GDB.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996
Free Software Foundation, Inc.
This file is part of GDB.
@@ -1648,7 +1648,7 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass)
error ("Internal error: could not find physical static variable named %s",
phys_name);
v = value_at (TYPE_FIELD_TYPE (type, i),
- (CORE_ADDR)SYMBOL_BLOCK_VALUE (sym));
+ SYMBOL_VALUE_ADDRESS (sym));
}
else
v = value_primitive_field (arg1, offset, i, type);
@@ -1922,11 +1922,19 @@ value_struct_elt (argp, args, name, static_memfuncp, err)
{
if (!args[1])
{
- /* destructors are a special case. */
- v = value_fn_field (NULL, TYPE_FN_FIELDLIST1 (t, 0),
- TYPE_FN_FIELDLIST_LENGTH (t, 0), 0, 0);
- if (!v) error("could not find destructor function named %s.", name);
- else return v;
+ /* Destructors are a special case. */
+ int m_index, f_index;
+
+ v = NULL;
+ if (get_destructor_fn_field (t, &m_index, &f_index))
+ {
+ v = value_fn_field (NULL, TYPE_FN_FIELDLIST1 (t, m_index),
+ f_index, NULL, 0);
+ }
+ if (v == NULL)
+ error ("could not find destructor function named %s.", name);
+ else
+ return v;
}
else
{
@@ -2005,7 +2013,11 @@ check_field_in (type, name)
/* Destructors are a special case. */
if (destructor_name_p (name, type))
- return 1;
+ {
+ int m_index, f_index;
+
+ return get_destructor_fn_field (type, &m_index, &f_index);
+ }
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
{
@@ -2092,7 +2104,7 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype)
error ("Internal error: could not find physical static variable named %s",
phys_name);
return value_at (SYMBOL_TYPE (sym),
- (CORE_ADDR)SYMBOL_BLOCK_VALUE (sym));
+ SYMBOL_VALUE_ADDRESS (sym));
}
if (TYPE_FIELD_PACKED (t, i))
error ("pointers to bitfield members not allowed");