summaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2002-09-14 02:09:39 +0000
committerDaniel Jacobowitz <dan@debian.org>2002-09-14 02:09:39 +0000
commit313a66ac21fe902f2a91d71eb88d4846e87545ae (patch)
tree33fe32502e7bbd5699117b39075cbf0dbd61504c /gdb/gdbtypes.c
parentf0c14d4675a917fd8d6150791394e1075b116cae (diff)
downloadgdb-313a66ac21fe902f2a91d71eb88d4846e87545ae.tar.gz
* gdbtypes.c (check_stub_method): Make static.
(check_stub_method_group): New function. * gdbtypes.h: Update prototypes. * cp-support.c: New file. * cp-support.h: New file. * stabsread.c: Include "cp-abi.h" and "cp-support.h". (update_method_name_from_physname): New function. (read_member_functions): Correct method names for operators and v3 constructors/destructors. Separate v2 constructors and destructors. * Makefile.in (stabsread.o): Update dependencies. (SFILES): Add cp-support.c. (COMMON_OBS): Add cp-support.o. (cp_support_h, cp-support.o): Add. * cp-valprint.c (cp_print_class_method): Call check_stub_method_group instead of check_stub_method. Remove extraneous QUITs. * p-valprint.c (pascal_object_print_class_method): Likewise. * valops.c (search_struct_method): Likewise. (find_method_list, value_struct_elt_for_reference): Likewise.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 6ebbf2db1b6..a219ab5eb3c 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1672,7 +1672,7 @@ safe_parse_type (char *p, int length)
which info used to be in the stab's but was removed to hack back
the space required for them. */
-void
+static void
check_stub_method (struct type *type, int method_id, int signature_id)
{
struct fn_field *f;
@@ -1781,6 +1781,49 @@ check_stub_method (struct type *type, int method_id, int signature_id)
xfree (demangled_name);
}
+/* This is the external interface to check_stub_method, above. This function
+ unstubs all of the signatures for TYPE's METHOD_ID method name. After
+ calling this function TYPE_FN_FIELD_STUB will be cleared for each signature
+ and TYPE_FN_FIELDLIST_NAME will be correct.
+
+ This function unfortunately can not die until stabs do. */
+
+void
+check_stub_method_group (struct type *type, int method_id)
+{
+ int len = TYPE_FN_FIELDLIST_LENGTH (type, method_id);
+ struct fn_field *f = TYPE_FN_FIELDLIST1 (type, method_id);
+ int j, found_stub;
+
+ for (j = 0; j < len; j++)
+ if (TYPE_FN_FIELD_STUB (f, j))
+ {
+ found_stub = 1;
+ check_stub_method (type, method_id, j);
+ }
+
+ /* GNU v3 methods with incorrect names were corrected when we read in
+ type information, because it was cheaper to do it then. The only GNU v2
+ methods with incorrect method names are operators and destructors;
+ destructors were also corrected when we read in type information.
+
+ Therefore the only thing we need to handle here are v2 operator
+ names. */
+ if (found_stub && strncmp (TYPE_FN_FIELD_PHYSNAME (f, 0), "_Z", 2) != 0)
+ {
+ int ret;
+ char dem_opname[256];
+
+ ret = cplus_demangle_opname (TYPE_FN_FIELDLIST_NAME (type, method_id),
+ dem_opname, DMGL_ANSI);
+ if (!ret)
+ ret = cplus_demangle_opname (TYPE_FN_FIELDLIST_NAME (type, method_id),
+ dem_opname, 0);
+ if (ret)
+ TYPE_FN_FIELDLIST_NAME (type, method_id) = xstrdup (dem_opname);
+ }
+}
+
const struct cplus_struct_type cplus_struct_default;
void
@@ -3435,7 +3478,6 @@ build_gdbtypes (void)
"__bfd_vma", (struct objfile *) NULL);
}
-
extern void _initialize_gdbtypes (void);
void
_initialize_gdbtypes (void)