diff options
author | Per Bothner <per@bothner.com> | 1992-03-01 01:04:13 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1992-03-01 01:04:13 +0000 |
commit | 2b5a8d9c47f77cebff48c49d5b9025ac8baf88c5 (patch) | |
tree | d669c2a34cd995b4d73101423252a86c306e767c /gdb/xcoffread.c | |
parent | 1651b22d76d78d5ec16dcb980127805dd9a8c649 (diff) | |
download | gdb-2b5a8d9c47f77cebff48c49d5b9025ac8baf88c5.zip gdb-2b5a8d9c47f77cebff48c49d5b9025ac8baf88c5.tar.gz gdb-2b5a8d9c47f77cebff48c49d5b9025ac8baf88c5.tar.bz2 |
More changes, mostly from IBM, for the rs6000. See ChangeLog.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r-- | gdb/xcoffread.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 4d66f51..2b1986d 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1427,11 +1427,14 @@ function_entry_point: /* Between a function symbol and `.bf', there always will be a function stab. We save function type when processing that stab. */ - if (fcn_type_saved == NULL) - fatal ("Unknown function type"); - - SYMBOL_TYPE (new->name) = fcn_type_saved; - fcn_type_saved = NULL; + if (fcn_type_saved == NULL) { + printf ("Unknown function type: symbol 0x%x\n", cs->c_symnum); + SYMBOL_TYPE (new->name) = lookup_function_type (builtin_type_int); + } + else { + SYMBOL_TYPE (new->name) = fcn_type_saved; + fcn_type_saved = NULL; + } } else if (strcmp (cs->c_name, ".ef") == 0) { @@ -1599,16 +1602,36 @@ process_xcoff_symbol (cs, objfile) case C_DECL: /* a type decleration?? */ qq = (char*) strchr (name, ':'); + /* skip if there is no ':' or a nameless construct */ if (!qq) /* skip if there is no ':' */ return NULL; struct_and_type_combined = (qq[1] == 'T' && qq[2] == 't'); pp = qq + (struct_and_type_combined ? 3 : 2); + + + /* To handle GNU C++ typename abbreviation, we need to be able to fill + in a type's name as soon as space for that type is allocated. */ + + if (struct_and_type_combined && name != qq) { + + int typenums[2]; + struct type *tmp_type; + char *tmp_pp = pp; + + read_type_number (&tmp_pp, typenums); + tmp_type = dbx_alloc_type (typenums); + + if (tmp_type && !TYPE_NAME (tmp_type)) + TYPE_NAME (tmp_type) = SYMBOL_NAME (sym) = + obsavestring (name, qq-name); + } ttype = SYMBOL_TYPE (sym) = read_type (&pp, objfile); /* read_type() will return null if type (or tag) definition was unnnecessarily duplicated. Also, if the symbol doesn't have a name, there is no need to keep it in symbol table. */ + /* The above argument no longer valid. read_type() never returns NULL. */ if (!ttype || name == qq) return NULL; @@ -1623,11 +1646,12 @@ process_xcoff_symbol (cs, objfile) } SYMBOL_CLASS (sym) = LOC_TYPEDEF; - SYMBOL_NAME (sym) = obsavestring (name, qq-name, &objfile->symbol_obstack); + if (!SYMBOL_NAME (sym)) + SYMBOL_NAME (sym) = + obsavestring (name, qq-name, &objfile->symbol_obstack); if (struct_and_type_combined) - TYPE_NAME (ttype) = SYMBOL_NAME (sym); - + ; else if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE) TYPE_NAME (ttype) = concat ( TYPE_CODE (ttype) == TYPE_CODE_UNION ? "union " : |