aboutsummaryrefslogtreecommitdiff
path: root/gdb/gnu-v3-abi.c
diff options
context:
space:
mode:
authorMichael Chastain <mec@google.com>2003-12-05 04:25:09 +0000
committerMichael Chastain <mec@google.com>2003-12-05 04:25:09 +0000
commit362ff856039fd10e1dc996d424d03dc02d410e5f (patch)
tree87ce1810335efaf86109db8ea21d4c3804134735 /gdb/gnu-v3-abi.c
parentaeadede63fe8a6a8b7f685e55fb03d349eb90913 (diff)
downloadgdb-362ff856039fd10e1dc996d424d03dc02d410e5f.zip
gdb-362ff856039fd10e1dc996d424d03dc02d410e5f.tar.gz
gdb-362ff856039fd10e1dc996d424d03dc02d410e5f.tar.bz2
2003-12-04 Michael Chastain <mec.gnu@mindspring.com>
Partial fix for PR c++/1465. Fix for PR c++/1377. * cp-support.h (cp_lookup_rtti_type): New function. * cp-support.c (cp_lookup_rtti_type): New function. * gnu-v2-abi.c: Update copyright years. (gnuv2_rtti_type): Call cp_lookup_rtti_type. * gnu-v3-abi.c: Update copyright years. (gnuv3_rtti_type): Call cp_lookup_rtti_type.
Diffstat (limited to 'gdb/gnu-v3-abi.c')
-rw-r--r--gdb/gnu-v3-abi.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index b18e644..0fbdd6e 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1,7 +1,7 @@
/* Abstraction of GNU v3 abi.
Contributed by Jim Blandy <jimb@redhat.com>
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,6 +23,7 @@
#include "defs.h"
#include "value.h"
#include "cp-abi.h"
+#include "cp-support.h"
#include "demangle.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -196,7 +197,6 @@ gnuv3_rtti_type (struct value *value,
struct minimal_symbol *vtable_symbol;
const char *vtable_symbol_name;
const char *class_name;
- struct symbol *class_symbol;
struct type *run_time_type;
struct type *base_type;
LONGEST offset_to_top;
@@ -255,26 +255,10 @@ gnuv3_rtti_type (struct value *value,
class_name = vtable_symbol_name + 11;
/* Try to look up the class name as a type name. */
- class_symbol = lookup_symbol (class_name, 0, STRUCT_DOMAIN, 0, 0);
- if (! class_symbol)
- {
- warning ("can't find class named `%s', as given by C++ RTTI", class_name);
- return NULL;
- }
-
- /* Make sure the type symbol is sane. (An earlier version of this
- code would find constructor functions, who have the same name as
- the class.) */
- if (SYMBOL_CLASS (class_symbol) != LOC_TYPEDEF
- || TYPE_CODE (SYMBOL_TYPE (class_symbol)) != TYPE_CODE_CLASS)
- {
- warning ("C++ RTTI gives a class name of `%s', but that isn't a type name",
- class_name);
- return NULL;
- }
-
- /* This is the object's run-time type! */
- run_time_type = SYMBOL_TYPE (class_symbol);
+ /* FIXME: chastain/2003-11-26: block=NULL is bogus. See pr gdb/1465. */
+ run_time_type = cp_lookup_rtti_type (class_name, NULL);
+ if (run_time_type == NULL)
+ return NULL;
/* Get the offset from VALUE to the top of the complete object.
NOTE: this is the reverse of the meaning of *TOP_P. */