aboutsummaryrefslogtreecommitdiff
path: root/gdb/mipsread.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-12-15 02:52:11 +0000
committerFred Fish <fnf@specifix.com>1992-12-15 02:52:11 +0000
commit85f0a8484fae7fc4f28b85298253e786645a5b6a (patch)
tree723472495b0c8155f5eb698d4bbb08cb935ebc69 /gdb/mipsread.c
parent7f70a2756406d76578fc4a6af98c42fd85f28b12 (diff)
downloadgdb-85f0a8484fae7fc4f28b85298253e786645a5b6a.zip
gdb-85f0a8484fae7fc4f28b85298253e786645a5b6a.tar.gz
gdb-85f0a8484fae7fc4f28b85298253e786645a5b6a.tar.bz2
* gdbtypes.c (create_array_type): Complete rewrite. Now requires
a optional type to decorate as an array type, the type of the index, and the bounds of the array. Records this additional info in the array type for use with languages with nonzero array bounds. * gdbtypes.h (enum type_code): Update comment for TYPE_CODE_ARRAY to note that arrays may have bounds. * gdbtypes.h (create_array_type): Update prototype. * c-exp.y (ptype production): Adjust for new create_array_type calling conventions. * coffread.c (decode_type): Call create_array_type rather than handcrafting array types. * convex-tdep.c (value_type): Remove, now use create_array_type. * convex-tdep.c (value_of_trapped_internalvar): Convert calls to vector_type into calls to create_array_type. * dwarfread.c (decode_subscr_data): Name changed to decode_subscript_data_item throughout. * dwarfread.c (decode_subscript_data_item): Rewrite to use create_array_type. Now records index type and range as well. * dwarfread.c (dwarf_read_array_type): Rewrite as part of change to use create_array_type. * dwarfread.c (read_subroutine_type): Test existing user defined types before decorating them, to ensure they are blank, and complain about it if they are not. * dwarfread.c (decode_fund_type): For unrecognized types, always return some valid type (type integer). If the unrecognized type cannot be an implementation defined type, complain as well. * m88k-tdep.c (pushed_size): Update comment for TYPE_CODE_ARRAY. * m88k-tdep.c (store_param): Update comment for TYPE_CODE_ARRAY. * mipsread.c (upgrade_type): Add FIXME comment that code to handcraft arrays should be replaced with call to create_array_type. * stabsread.c (read_array_type): Replace code to handcraft array types with call to create_array_type. * valprint.c (type_print_varspec_prefix): Minor formatting change, join lines that don't need to be split.
Diffstat (limited to 'gdb/mipsread.c')
-rw-r--r--gdb/mipsread.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index 5480c14..15e5d8b 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -68,6 +68,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/param.h>
#include <sys/file.h>
#include <sys/stat.h>
+#include <string.h>
#include "gdb-stabs.h"
@@ -78,6 +79,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "libaout.h" /* FIXME Secret internal BFD stuff for a.out */
#include "aout/aout64.h"
#include "aout/stab_gnu.h" /* STABS information */
+#include "expression.h"
+#include "language.h" /* Needed inside partial-stab.h */
struct coff_exec {
struct external_filehdr f;
@@ -1106,15 +1109,17 @@ data: /* Common code for symbols describing data */
if (tsym->st == stMember) {
if (nfields == 0 && type_code == TYPE_CODE_UNDEF)
/* If the type of the member is Nil (or Void),
- assume the tag is an enumeration. */
+ without qualifiers, assume the tag is an
+ enumeration. */
if (tsym->index == indexNil)
type_code = TYPE_CODE_ENUM;
else {
ecoff_swap_tir_in (bigend,
&ax[tsym->index].a_ti,
&tir);
- if (tir.bt == btNil || tir.bt == btVoid)
- type_code = TYPE_CODE_ENUM;
+ if ((tir.bt == btNil || tir.bt == btVoid)
+ && tir.tq0 == tqNil)
+ type_code = TYPE_CODE_ENUM;
}
nfields++;
if (tsym->value > max_value)
@@ -1549,6 +1554,7 @@ upgrade_type(tpp, tq, ax, bigend)
return 0;
case tqArray:
+ /* We should probably try to use create_array_type here. FIXME! */
off = 0;
t = init_type(TYPE_CODE_ARRAY, 0, 0, (char *) NULL,
(struct objfile *) NULL);
@@ -1978,6 +1984,7 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
if (fh->csym >= 2
&& strcmp((char *)(((SYMR *)fh->isymBase)[1].iss),
stabs_symbol) == 0) {
+ processing_gcc_compilation = 2;
for (cur_sdx = 2; cur_sdx < fh->csym; cur_sdx++) {
int type_code;
char *namestring;
@@ -2009,6 +2016,7 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
}
}
else {
+ processing_gcc_compilation = 0;
for (cur_sdx = 0; cur_sdx < fh->csym; ) {
char *name;
enum address_class class;
@@ -2356,6 +2364,9 @@ psymtab_to_symtab_1(pst, filename)
PDR *pr;
+ /* We indicate that this is a GCC compilation so that certain features
+ will be enabled in stabsread/dbxread. */
+ processing_gcc_compilation = 2;
/* Parse local symbols first */
if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr */
@@ -2421,6 +2432,8 @@ psymtab_to_symtab_1(pst, filename)
int maxlines;
EXTR **ext_ptr;
+ processing_gcc_compilation = 0;
+
/* How many symbols will we need */
/* FIXME, this does not count enum values. */
f_max = pst->n_global_syms + pst->n_static_syms;