aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-02-02 16:45:17 +0000
committerTom Tromey <tromey@redhat.com>2010-02-02 16:45:17 +0000
commitedf3d5f3f8c5adff55934e57da9cd8c874dc2a55 (patch)
treeb4c0a67139f68773c88d955a0a8267a8c6759bba /gdb/valops.c
parent4339cae0bb39a38117d51fc52066e659dccaee29 (diff)
downloadgdb-edf3d5f3f8c5adff55934e57da9cd8c874dc2a55.zip
gdb-edf3d5f3f8c5adff55934e57da9cd8c874dc2a55.tar.gz
gdb-edf3d5f3f8c5adff55934e57da9cd8c874dc2a55.tar.bz2
gdb
PR c++/11226, PR c++/9629, PR c++/9688, PR c++/8890: * valops.c (search_struct_field): Compute nbases after calling CHECK_TYPEDEF. (check_field): Call CHECK_TYPEDEF. * cp-valprint.c (cp_print_value): Pass correct address to baseclass_offset. Fix check for virtual base past the end of the object. Don't offset address passed to cp_print_value_fields or apply_val_pretty_printer. (cp_print_value_fields): Fix call to val_print. (cp_print_value_fields_rtti): New function. * c-valprint.c (c_val_print): Use cp_print_value_fields_rtti. * p-valprint.c (pascal_object_print_value_fields): Fix call to val_print. * python/py-prettyprint.c (apply_val_pretty_printer): Add embedded offset to address. * language.h (struct language_defn) <la_val_print>: Document. * c-lang.h (cp_print_value_fields_rtti): Declare. gdb/testsuite PR c++/11226, PR c++/9629, PR c++/9688, PR c++/8890: * gdb.cp/virtbase.cc: New file. * gdb.cp/virtbase.exp: New file. * gdb.cp/userdef.exp: Allow 'struct' or 'class'.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index 2cdbcbe..4c5927d 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1787,9 +1787,10 @@ search_struct_field (char *name, struct value *arg1, int offset,
struct type *type, int looking_for_baseclass)
{
int i;
- int nbases = TYPE_N_BASECLASSES (type);
+ int nbases;
CHECK_TYPEDEF (type);
+ nbases = TYPE_N_BASECLASSES (type);
if (!looking_for_baseclass)
for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
@@ -2763,6 +2764,9 @@ check_field (struct type *type, const char *name)
{
int i;
+ /* The type may be a stub. */
+ CHECK_TYPEDEF (type);
+
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);