X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gdb%2Fada-lang.c;h=b047442d6f33bbafc2df5797e54c336de82183a4;hb=1b883d351364d8b9e00021462e06d5dba0d61460;hp=1e526eb93788708025390f33a3fd524256021736;hpb=01ad7f3617b834c08e35e114cbc439640eb8721a;p=binutils-gdb.git diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1e526eb9378..b047442d6f3 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -1,5 +1,6 @@ /* Ada language support routines for GDB, the GNU debugger. Copyright - 1992, 1993, 1994, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003 + Free Software Foundation, Inc. This file is part of GDB. @@ -36,9 +37,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "breakpoint.h" #include "gdbcore.h" #include "ada-lang.h" -#ifdef UI_OUT #include "ui-out.h" -#endif +#include "block.h" +#include "infcall.h" struct cleanup *unresolved_names; @@ -707,7 +708,7 @@ ada_suppress_symbol_printing (struct symbol *sym) if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE) return 1; else - return is_suppressed_name (SYMBOL_NAME (sym)); + return is_suppressed_name (DEPRECATED_SYMBOL_NAME (sym)); } @@ -2172,6 +2173,8 @@ ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p, case LOC_LOCAL_ARG: case LOC_BASEREG: case LOC_BASEREG_ARG: + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: goto FoundNonType; default: break; @@ -2563,8 +2566,8 @@ sort_choices (struct symbol *syms[], struct block *blocks[], int nsyms) for (j = i - 1; j >= 0; j -= 1) { - if (mangled_ordered_before (SYMBOL_NAME (syms[j]), - SYMBOL_NAME (sym))) + if (mangled_ordered_before (DEPRECATED_SYMBOL_NAME (syms[j]), + DEPRECATED_SYMBOL_NAME (sym))) break; syms[j + 1] = syms[j]; blocks[j + 1] = blocks[j]; @@ -2614,7 +2617,7 @@ user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms, struct symtab_and_line sal = find_function_start_sal (syms[i], 1); printf_unfiltered ("[%d] %s at %s:%d\n", i + first_choice, - SYMBOL_SOURCE_NAME (syms[i]), + SYMBOL_PRINT_NAME (syms[i]), sal.symtab == NULL ? "" : sal.symtab->filename, sal.line); @@ -2631,28 +2634,28 @@ user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms, if (SYMBOL_LINE (syms[i]) != 0 && symtab != NULL) printf_unfiltered ("[%d] %s at %s:%d\n", i + first_choice, - SYMBOL_SOURCE_NAME (syms[i]), + SYMBOL_PRINT_NAME (syms[i]), symtab->filename, SYMBOL_LINE (syms[i])); else if (is_enumeral && TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL) { printf_unfiltered ("[%d] ", i + first_choice); ada_print_type (SYMBOL_TYPE (syms[i]), NULL, gdb_stdout, -1, 0); printf_unfiltered ("'(%s) (enumeral)\n", - SYMBOL_SOURCE_NAME (syms[i])); + SYMBOL_PRINT_NAME (syms[i])); } else if (symtab != NULL) printf_unfiltered (is_enumeral ? "[%d] %s in %s (enumeral)\n" : "[%d] %s at %s:?\n", i + first_choice, - SYMBOL_SOURCE_NAME (syms[i]), + SYMBOL_PRINT_NAME (syms[i]), symtab->filename); else printf_unfiltered (is_enumeral ? "[%d] %s (enumeral)\n" : "[%d] %s at ?\n", i + first_choice, - SYMBOL_SOURCE_NAME (syms[i])); + SYMBOL_PRINT_NAME (syms[i])); } } @@ -3240,8 +3243,8 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1) { struct type *type0 = SYMBOL_TYPE (sym0); struct type *type1 = SYMBOL_TYPE (sym1); - char *name0 = SYMBOL_NAME (sym0); - char *name1 = SYMBOL_NAME (sym1); + char *name0 = DEPRECATED_SYMBOL_NAME (sym0); + char *name1 = DEPRECATED_SYMBOL_NAME (sym1); int len0 = strlen (name0); return TYPE_CODE (type0) == TYPE_CODE (type1) @@ -3319,7 +3322,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, struct partial_symbol *psym = start[i]; if (SYMBOL_NAMESPACE (psym) == namespace && - wild_match (name, name_len, SYMBOL_NAME (psym))) + wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (psym))) return psym; } return NULL; @@ -3335,11 +3338,11 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { int M = (U + i) >> 1; struct partial_symbol *psym = start[M]; - if (SYMBOL_NAME (psym)[0] < name[0]) + if (DEPRECATED_SYMBOL_NAME (psym)[0] < name[0]) i = M + 1; - else if (SYMBOL_NAME (psym)[0] > name[0]) + else if (DEPRECATED_SYMBOL_NAME (psym)[0] > name[0]) U = M - 1; - else if (strcmp (SYMBOL_NAME (psym), name) < 0) + else if (strcmp (DEPRECATED_SYMBOL_NAME (psym), name) < 0) i = M + 1; else U = M; @@ -3354,7 +3357,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, if (SYMBOL_NAMESPACE (psym) == namespace) { - int cmp = strncmp (name, SYMBOL_NAME (psym), name_len); + int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym), name_len); if (cmp < 0) { @@ -3362,7 +3365,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, break; } else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (psym) + name_len)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (psym) + name_len)) return psym; } i += 1; @@ -3377,11 +3380,11 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { int M = (U + i) >> 1; struct partial_symbol *psym = start[M]; - if (SYMBOL_NAME (psym)[0] < '_') + if (DEPRECATED_SYMBOL_NAME (psym)[0] < '_') i = M + 1; - else if (SYMBOL_NAME (psym)[0] > '_') + else if (DEPRECATED_SYMBOL_NAME (psym)[0] > '_') U = M - 1; - else if (strcmp (SYMBOL_NAME (psym), "_ada_") < 0) + else if (strcmp (DEPRECATED_SYMBOL_NAME (psym), "_ada_") < 0) i = M + 1; else U = M; @@ -3398,12 +3401,12 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, { int cmp; - cmp = (int) '_' - (int) SYMBOL_NAME (psym)[0]; + cmp = (int) '_' - (int) DEPRECATED_SYMBOL_NAME (psym)[0]; if (cmp == 0) { - cmp = strncmp ("_ada_", SYMBOL_NAME (psym), 5); + cmp = strncmp ("_ada_", DEPRECATED_SYMBOL_NAME (psym), 5); if (cmp == 0) - cmp = strncmp (name, SYMBOL_NAME (psym) + 5, name_len); + cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym) + 5, name_len); } if (cmp < 0) @@ -3412,7 +3415,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, break; } else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (psym) + name_len + 5)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (psym) + name_len + 5)) return psym; } i += 1; @@ -3466,6 +3469,8 @@ symtab_for_sym (struct symbol *sym) case LOC_LOCAL_ARG: case LOC_BASEREG: case LOC_BASEREG_ARG: + case LOC_COMPUTED: + case LOC_COMPUTED_ARG: for (j = FIRST_LOCAL_BLOCK; j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1) { @@ -3493,7 +3498,7 @@ ada_lookup_minimal_symbol (const char *name) ALL_MSYMBOLS (objfile, msymbol) { - if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match) + if (ada_match_name (DEPRECATED_SYMBOL_NAME (msymbol), name, wild_match) && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline) return msymbol; } @@ -3527,7 +3532,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, /* Initialize the local variable symbol that stands for the * static link (when it exists). */ static_link = &static_link_sym; - SYMBOL_NAME (static_link) = ""; + DEPRECATED_SYMBOL_NAME (static_link) = ""; SYMBOL_LANGUAGE (static_link) = language_unknown; SYMBOL_CLASS (static_link) = LOC_LOCAL; SYMBOL_NAMESPACE (static_link) = VAR_NAMESPACE; @@ -3536,7 +3541,7 @@ add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace, -(long) TYPE_LENGTH (SYMBOL_TYPE (static_link)); } - frame = selected_frame; + frame = deprecated_selected_frame; while (frame != NULL && ndefns == 0) { struct block *block; @@ -3596,15 +3601,15 @@ remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms) i = 0; while (i < nsyms) { - if (SYMBOL_NAME (syms[i]) != NULL + if (DEPRECATED_SYMBOL_NAME (syms[i]) != NULL && SYMBOL_CLASS (syms[i]) == LOC_STATIC && is_nondebugging_type (SYMBOL_TYPE (syms[i]))) { for (j = 0; j < nsyms; j += 1) { if (i != j - && SYMBOL_NAME (syms[j]) != NULL - && STREQ (SYMBOL_NAME (syms[i]), SYMBOL_NAME (syms[j])) + && DEPRECATED_SYMBOL_NAME (syms[j]) != NULL + && STREQ (DEPRECATED_SYMBOL_NAME (syms[i]), DEPRECATED_SYMBOL_NAME (syms[j])) && SYMBOL_CLASS (syms[i]) == SYMBOL_CLASS (syms[j]) && SYMBOL_VALUE_ADDRESS (syms[i]) == SYMBOL_VALUE_ADDRESS (syms[j])) @@ -3699,7 +3704,7 @@ ada_lookup_symbol_list (const char *name, struct block *block0, { ALL_MSYMBOLS (objfile, msymbol) { - if (ada_match_name (SYMBOL_NAME (msymbol), name, wild_match)) + if (ada_match_name (DEPRECATED_SYMBOL_NAME (msymbol), name, wild_match)) { switch (MSYMBOL_TYPE (msymbol)) { @@ -3714,13 +3719,13 @@ ada_lookup_symbol_list (const char *name, struct block *block0, bv = BLOCKVECTOR (s); block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); ada_add_block_symbols (block, - SYMBOL_NAME (msymbol), + DEPRECATED_SYMBOL_NAME (msymbol), namespace, objfile, wild_match); if (ndefns == old_ndefns) { block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); ada_add_block_symbols (block, - SYMBOL_NAME (msymbol), + DEPRECATED_SYMBOL_NAME (msymbol), namespace, objfile, wild_match); } @@ -3960,7 +3965,7 @@ ada_add_block_symbols (struct block *block, const char *name, ALL_BLOCK_SYMBOLS (block, i, sym) { if (SYMBOL_NAMESPACE (sym) == namespace && - wild_match (name, name_len, SYMBOL_NAME (sym))) + wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (sym))) { switch (SYMBOL_CLASS (sym)) { @@ -3970,6 +3975,7 @@ ada_add_block_symbols (struct block *block, const char *name, case LOC_REGPARM: case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: arg_sym = sym; break; case LOC_UNRESOLVED: @@ -3994,11 +4000,11 @@ ada_add_block_symbols (struct block *block, const char *name, { int M = (U + i) >> 1; struct symbol *sym = BLOCK_SYM (block, M); - if (SYMBOL_NAME (sym)[0] < name[0]) + if (DEPRECATED_SYMBOL_NAME (sym)[0] < name[0]) i = M + 1; - else if (SYMBOL_NAME (sym)[0] > name[0]) + else if (DEPRECATED_SYMBOL_NAME (sym)[0] > name[0]) U = M - 1; - else if (strcmp (SYMBOL_NAME (sym), name) < 0) + else if (strcmp (DEPRECATED_SYMBOL_NAME (sym), name) < 0) i = M + 1; else U = M; @@ -4012,7 +4018,7 @@ ada_add_block_symbols (struct block *block, const char *name, { if (SYMBOL_NAMESPACE (sym) == namespace) { - int cmp = strncmp (name, SYMBOL_NAME (sym), name_len); + int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym), name_len); if (cmp < 0) { @@ -4023,7 +4029,7 @@ ada_add_block_symbols (struct block *block, const char *name, } } else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (sym) + name_len)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len)) { switch (SYMBOL_CLASS (sym)) { @@ -4033,6 +4039,7 @@ ada_add_block_symbols (struct block *block, const char *name, case LOC_REGPARM: case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: arg_sym = sym; break; case LOC_UNRESOLVED: @@ -4068,11 +4075,11 @@ ada_add_block_symbols (struct block *block, const char *name, { int M = (U + i) >> 1; struct symbol *sym = BLOCK_SYM (block, M); - if (SYMBOL_NAME (sym)[0] < '_') + if (DEPRECATED_SYMBOL_NAME (sym)[0] < '_') i = M + 1; - else if (SYMBOL_NAME (sym)[0] > '_') + else if (DEPRECATED_SYMBOL_NAME (sym)[0] > '_') U = M - 1; - else if (strcmp (SYMBOL_NAME (sym), "_ada_") < 0) + else if (strcmp (DEPRECATED_SYMBOL_NAME (sym), "_ada_") < 0) i = M + 1; else U = M; @@ -4090,12 +4097,12 @@ ada_add_block_symbols (struct block *block, const char *name, { int cmp; - cmp = (int) '_' - (int) SYMBOL_NAME (sym)[0]; + cmp = (int) '_' - (int) DEPRECATED_SYMBOL_NAME (sym)[0]; if (cmp == 0) { - cmp = strncmp ("_ada_", SYMBOL_NAME (sym), 5); + cmp = strncmp ("_ada_", DEPRECATED_SYMBOL_NAME (sym), 5); if (cmp == 0) - cmp = strncmp (name, SYMBOL_NAME (sym) + 5, name_len); + cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym) + 5, name_len); } if (cmp < 0) @@ -4107,7 +4114,7 @@ ada_add_block_symbols (struct block *block, const char *name, } } else if (cmp == 0 - && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5)) + && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len + 5)) { switch (SYMBOL_CLASS (sym)) { @@ -4117,6 +4124,7 @@ ada_add_block_symbols (struct block *block, const char *name, case LOC_REGPARM: case LOC_REGPARM_ADDR: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: arg_sym = sym; break; case LOC_UNRESOLVED: @@ -4192,7 +4200,7 @@ fill_in_ada_prototype (struct symbol *func) TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0; TYPE_FIELD_TYPE (ftype, nargs) = lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym))); - TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + TYPE_FIELD_NAME (ftype, nargs) = DEPRECATED_SYMBOL_NAME (sym); nargs += 1; break; @@ -4201,11 +4209,12 @@ fill_in_ada_prototype (struct symbol *func) case LOC_REGPARM: case LOC_LOCAL_ARG: case LOC_BASEREG_ARG: + case LOC_COMPUTED_ARG: TYPE_FIELD_BITPOS (ftype, nargs) = nargs; TYPE_FIELD_BITSIZE (ftype, nargs) = 0; TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0; TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym)); - TYPE_FIELD_NAME (ftype, nargs) = SYMBOL_NAME (sym); + TYPE_FIELD_NAME (ftype, nargs) = DEPRECATED_SYMBOL_NAME (sym); nargs += 1; break; @@ -4474,7 +4483,7 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table, for (i = 0; i < selected.nelts; i += 1) (*canonical)[i] = extended_canonical_line_spec (selected.sals[i], - SYMBOL_SOURCE_NAME (symbols[i])); + SYMBOL_PRINT_NAME (symbols[i])); } discard_cleanups (old_chain); @@ -4757,7 +4766,7 @@ debug_print_block (struct block *b) fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]", b, BLOCK_START (b), BLOCK_END (b)); if (BLOCK_FUNCTION (b) != NULL) - fprintf (stderr, " Function: %s", SYMBOL_NAME (BLOCK_FUNCTION (b))); + fprintf (stderr, " Function: %s", DEPRECATED_SYMBOL_NAME (BLOCK_FUNCTION (b))); fprintf (stderr, "\n"); fprintf (stderr, "\t Superblock: %p\n", BLOCK_SUPERBLOCK (b)); fprintf (stderr, "\t Symbols:"); @@ -4765,7 +4774,7 @@ debug_print_block (struct block *b) { if (i > 0 && i % 4 == 0) fprintf (stderr, "\n\t\t "); - fprintf (stderr, " %s", SYMBOL_NAME (sym)); + fprintf (stderr, " %s", DEPRECATED_SYMBOL_NAME (sym)); } fprintf (stderr, "\n"); } @@ -5032,17 +5041,7 @@ find_printable_frame (struct frame_info *fi, int level) for (; fi != NULL; level += 1, fi = get_prev_frame (fi)) { - /* If fi is not the innermost frame, that normally means that fi->pc - points to *after* the call instruction, and we want to get the line - containing the call, never the next line. But if the next frame is - a signal_handler_caller or a dummy frame, then the next frame was - not entered as the result of a call, and we want to get the line - containing fi->pc. */ - sal = - find_pc_line (fi->pc, - fi->next != NULL - && !fi->next->signal_handler_caller - && !deprecated_frame_in_dummy (fi->next)); + find_frame_sal (fi, &sal); if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename)) { #if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET) @@ -5053,7 +5052,7 @@ find_printable_frame (struct frame_info *fi, int level) STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so")) continue; #endif - selected_frame = fi; + deprecated_selected_frame = fi; break; } } @@ -5064,7 +5063,6 @@ find_printable_frame (struct frame_info *fi, int level) void ada_report_exception_break (struct breakpoint *b) { -#ifdef UI_OUT /* FIXME: break_on_exception should be defined in breakpoint.h */ /* if (b->break_on_exception == 1) { @@ -5102,7 +5100,6 @@ ada_report_exception_break (struct breakpoint *b) else if (b->break_on_exception == 3) fputs_filtered ("on assert failure", gdb_stdout); */ -#endif } int @@ -8084,6 +8081,8 @@ const struct language_defn ada_language_defn = { ada_print_type, /* Print a type using appropriate syntax */ ada_val_print, /* Print a value using appropriate syntax */ ada_value_print, /* Print a top-level value */ + NULL, /* Language specific skip_trampoline */ + NULL, /* Language specific symbol demangler */ {"", "", "", ""}, /* Binary format info */ #if 0 {"8#%lo#", "8#", "o", "#"}, /* Octal format info */