]> Git Repo - binutils.git/blobdiff - gdb/ada-lang.c
* as.c (perform_an_assembly_pass): If using cgen, call gas_cgen_begin.
[binutils.git] / gdb / ada-lang.c
index eb4ccbec9b14097f6a2869ce1409f3efefdc6ad8..bc0809d3e2a507d8362efa4734a0ea56e059d8f3 100644 (file)
@@ -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.
 
@@ -706,7 +707,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));
 }
 \f
 
@@ -2171,6 +2172,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;
@@ -2562,8 +2565,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];
@@ -2613,7 +2616,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
                             ? "<no source file available>"
                             : sal.symtab->filename, sal.line);
@@ -2630,28 +2633,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]));
        }
     }
 
@@ -3239,8 +3242,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)
@@ -3318,7 +3321,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;
@@ -3334,11 +3337,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;
@@ -3353,7 +3356,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)
                {
@@ -3361,7 +3364,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;
@@ -3376,11 +3379,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;
@@ -3397,12 +3400,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)
@@ -3411,7 +3414,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;
@@ -3465,6 +3468,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)
          {
@@ -3492,7 +3497,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;
   }
@@ -3526,7 +3531,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;
@@ -3595,15 +3600,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]))
@@ -3698,7 +3703,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))
              {
@@ -3713,13 +3718,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);
                      }
@@ -3959,7 +3964,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))
              {
@@ -3969,6 +3974,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:
@@ -3993,11 +3999,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;
@@ -4011,7 +4017,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)
                  {
@@ -4022,7 +4028,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))
                      {
@@ -4032,6 +4038,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:
@@ -4067,11 +4074,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;
@@ -4089,12 +4096,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)
@@ -4106,7 +4113,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))
                      {
@@ -4116,6 +4123,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:
@@ -4191,7 +4199,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;
@@ -4200,11 +4208,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;
@@ -4473,7 +4482,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);
@@ -4756,7 +4765,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:");
@@ -4764,7 +4773,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");
 }
@@ -8071,6 +8080,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 */
This page took 0.042627 seconds and 4 git commands to generate.