aboutsummaryrefslogtreecommitdiff
path: root/gdb/mipsread.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-01-16 05:15:58 +0000
committerFred Fish <fnf@specifix.com>1993-01-16 05:15:58 +0000
commitc4413e2c9b9e257a93b4370c5e4e976c768b9e9a (patch)
tree2a5d96fdb815d54e5d8d800918fe16e06471d816 /gdb/mipsread.c
parent7d9f0c54d614f654124963d8e1b48fd884b92f24 (diff)
downloadgdb-c4413e2c9b9e257a93b4370c5e4e976c768b9e9a.zip
gdb-c4413e2c9b9e257a93b4370c5e4e976c768b9e9a.tar.gz
gdb-c4413e2c9b9e257a93b4370c5e4e976c768b9e9a.tar.bz2
* c-exp.y (exp:STRING): Convert C strings into array-of-char
constants with an explicit null byte terminator. OP_STRING is now used for real string types. * c-lang.c (builtin_type_*): Move declarations to lang.c since they are used by all languages. * c-lang.c (_initialize_c_language): Move initializations of builtin_type_* to lang.c. * c-typeprint.c (c_type_print_varspec_prefix, c_type_print_varspec_suffix): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * c-valprint.c (c_val_print): Change the way character arrays are printed as strings to be consistent with the way strings are printed when pointer-to-char types are dereferenced. Remove test of print_max before calling val_print_string, which now does it's own test. * eval.c (evaluate_subexp): Add case for OP_ARRAY. * expprint.c (print_subexp, dump_expression): Add case for OP_ARRAY. * expression.h (enum exp_opcode): Add OP_ARRAY and document. * gdbtypes.c (builtin_type_*): Add declarations moved from c-lang.c. * gdbtypes.c (create_string_type): New function to create real string types. * gdbtypes.c (recursive_dump_type): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * gdbtypes.c (_initialize_gdbtypes): Add initializations of builtin_type_* types moved from c-lang.c. * gdbtypes.h (enum type_code): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * gdbtypes.h (builtin_type_string): Add extern declaration. * gdbtypes.h (create_string_type): Add prototype. * m2-lang.c (m2_create_fundamental_type): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * m88k-tdep.c (pushed_size): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * mipsread.c (_initialize_mipsread): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * parse.c (length_of_subexp, prefixify_subexp): Add case for OP_ARRAY. * printcmd.c (print_formatted): Recognize TYPE_CODE_STRING. * typeprint.c (print_type_scalar): TYPE_CODE_PASCAL_ARRAY renamed to TYPE_CODE_STRING. * valops.c (allocate_space_in_inferior): New function and prototype, using code ripped out of value_string. * valops.c (value_string): Rewritten to use new function allocate_space_in_inferior, but temporarily disabled until some other support is in place. * valops.c (value_array): New function to create array constants. * valprint.c (val_print_string): Add comment to document use, complete rewrite to fix several small buglets. * value.h (value_array): Add prototype. * value.h (val_print_string): Change prototype to match rewrite. **** start-sanitize-chill **** * ch-valprint.c (chill_val_print): Add case for TYPE_CODE_STRING. * ch-exp.y (match_character_literal): Disable recognition of control sequence form of character literals and document why. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/mipsread.c')
-rw-r--r--gdb/mipsread.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index 3225b1d..edc0d0f 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -195,6 +195,10 @@ struct complaint pdr_static_symbol_complaint =
/* Things that really are local to this module */
+/* Remember what we deduced to be the source language of this psymtab. */
+
+static enum language psymtab_language = language_unknown;
+
/* MIPS symtab header for the current file */
static HDRR *cur_hdr;
@@ -1477,7 +1481,7 @@ parse_type(ax, bs, bigend)
complain (&bad_tag_guess_complaint, name);
TYPE_CODE(tp) = type_code;
}
- if (TYPE_NAME(tp) == NULL || strcmp(TYPE_NAME(tp), name) != 0)
+ if (TYPE_NAME(tp) == NULL || !STREQ (TYPE_NAME(tp), name))
TYPE_NAME(tp) = obsavestring(name, strlen(name),
&current_objfile -> type_obstack);
}
@@ -1862,6 +1866,7 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
struct partial_symtab **dependency_list;
int dependencies_used, dependencies_allocated;
struct cleanup *old_chain;
+ char *name;
extern_tab = (EXTR**)obstack_alloc (&objfile->psymbol_obstack,
sizeof(EXTR *) * hdr->iextMax);
@@ -1941,9 +1946,8 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
ms_type = mst_unknown;
complain (&unknown_ext_complaint, esh->asym.iss);
}
- prim_record_minimal_symbol ((char *)esh->asym.iss,
- esh->asym.value,
- ms_type);
+ name = (char *)esh->asym.iss;
+ prim_record_minimal_symbol (name, esh->asym.value, ms_type);
}
/* Pass 3 over files, over local syms: fill in static symbols */
@@ -1984,8 +1988,7 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
(It is the second symbol because the first symbol is
the stFile used to signal the start of a file). */
if (fh->csym >= 2
- && strcmp((char *)(((SYMR *)fh->isymBase)[1].iss),
- stabs_symbol) == 0) {
+ && STREQ((char *)(((SYMR *)fh->isymBase)[1].iss), stabs_symbol)) {
processing_gcc_compilation = 2;
for (cur_sdx = 2; cur_sdx < fh->csym; cur_sdx++) {
int type_code;
@@ -2047,7 +2050,8 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
case stStaticProc: /* Function */
ADD_PSYMBOL_TO_LIST(name, strlen(name),
VAR_NAMESPACE, LOC_BLOCK,
- objfile->static_psymbols, sh->value);
+ objfile->static_psymbols, sh->value,
+ psymtab_language, objfile);
/* Skip over procedure to next one. */
if (sh->index >= hdr->iauxMax)
{
@@ -2096,7 +2100,9 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
if (sh->sc == scInfo) {
ADD_PSYMBOL_TO_LIST(name, strlen(name),
STRUCT_NAMESPACE, LOC_TYPEDEF,
- objfile->static_psymbols, sh->value);
+ objfile->static_psymbols,
+ sh->value,
+ psymtab_language, objfile);
}
/* Skip over the block */
cur_sdx = sh->index;
@@ -2124,7 +2130,8 @@ parse_partial_symbols (end_of_text_seg, objfile, section_offsets)
/* Use this gdb symbol */
ADD_PSYMBOL_TO_LIST(name, strlen(name),
VAR_NAMESPACE, class,
- objfile->static_psymbols, sh->value);
+ objfile->static_psymbols, sh->value,
+ psymtab_language, objfile);
skip:
cur_sdx++; /* Go to next file symbol */
}
@@ -2357,8 +2364,7 @@ psymtab_to_symtab_1(pst, filename)
/* See comment in parse_partial_symbols about the @stabs sentinel. */
if (fh && fh->csym >= 2
- && strcmp((char *)(((SYMR *)fh->isymBase)[1].iss), stabs_symbol)
- == 0) {
+ && STREQ((char *)(((SYMR *)fh->isymBase)[1].iss), stabs_symbol)) {
/*
* This symbol table contains stabs-in-ecoff entries.
@@ -2633,7 +2639,7 @@ mylookup_symbol (name, block, namespace, class)
if (SYMBOL_NAME(sym)[0] == inc
&& SYMBOL_NAMESPACE(sym) == namespace
&& SYMBOL_CLASS(sym) == class
- && !strcmp(SYMBOL_NAME(sym), name))
+ && STREQ(SYMBOL_NAME(sym), name))
return sym;
bot++;
}
@@ -2660,7 +2666,7 @@ add_symbol(s,b)
if (b == top_stack->cur_block &&
nsyms >= top_stack->maxsyms) {
- complain (&block_overflow_complaint, s->name);
+ complain (&block_overflow_complaint, SYMBOL_NAME (s));
/* In this case shrink_block is actually grow_block, since
BLOCK_NSYMS(b) is larger than its current size. */
origb = b;
@@ -3106,7 +3112,7 @@ _initialize_mipsread ()
/* Missing basic types */
builtin_type_string =
- init_type(TYPE_CODE_PASCAL_ARRAY,
+ init_type(TYPE_CODE_STRING,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "string",
(struct objfile *) NULL);