/* 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, 2004
+ Free Software Foundation, Inc.
This file is part of GDB.
#include "breakpoint.h"
#include "gdbcore.h"
#include "ada-lang.h"
-#ifdef UI_OUT
#include "ui-out.h"
-#endif
+#include "block.h"
+#include "infcall.h"
+#include "dictionary.h"
struct cleanup *unresolved_names;
CORE_ADDR *);
static void ada_add_block_symbols (struct block *, const char *,
- namespace_enum, struct objfile *, int);
+ domain_enum, struct objfile *, int);
static void fill_in_ada_prototype (struct symbol *);
static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab
*, const char *, int,
- namespace_enum, int);
+ domain_enum, int);
static struct symtab *symtab_for_sym (struct symbol *);
static struct value *value_val_atr (struct type *, struct value *);
-static struct symbol *standard_lookup (const char *, namespace_enum);
+static struct symbol *standard_lookup (const char *, domain_enum);
extern void markTimeStart (int index);
extern void markTimeStop (int index);
{
int len = strlen (target);
return
- STREQN (field_name, target, len)
+ DEPRECATED_STREQN (field_name, target, len)
&& (field_name[len] == '\0'
- || (STREQN (field_name + len, "___", 3)
- && !STREQ (field_name + strlen (field_name) - 6, "___XVN")));
+ || (DEPRECATED_STREQN (field_name + len, "___", 3)
+ && !DEPRECATED_STREQ (field_name + strlen (field_name) - 6, "___XVN")));
}
return 0;
len1 = strlen (str);
len2 = strlen (suffix);
- return (len1 >= len2 && STREQ (str + len1 - len2, suffix));
+ return (len1 >= len2 && DEPRECATED_STREQ (str + len1 - len2, suffix));
}
/* Create a value of type TYPE whose contents come from VALADDR, if it
static int
is_suppressed_name (const char *str)
{
- if (STREQN (str, "_ada_", 5))
+ if (DEPRECATED_STREQN (str, "_ada_", 5))
str += 5;
if (str[0] == '_' || str[0] == '\000')
return 1;
if (*p != 'O')
return 1;
for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
- if (STREQN (ada_opname_table[i].mangled, p,
+ if (DEPRECATED_STREQN (ada_opname_table[i].mangled, p,
strlen (ada_opname_table[i].mangled)))
goto OK;
return 1;
for (mapping = ada_opname_table;
mapping->mangled != NULL &&
- !STREQN (mapping->demangled, p, strlen (mapping->demangled));
+ !DEPRECATED_STREQN (mapping->demangled, p, strlen (mapping->demangled));
p += 1)
;
if (mapping->mangled == NULL)
static char *demangling_buffer = NULL;
static size_t demangling_buffer_size = 0;
- if (STREQN (mangled, "_ada_", 5))
+ if (DEPRECATED_STREQN (mangled, "_ada_", 5))
mangled += 5;
if (mangled[0] == '_' || mangled[0] == '<')
else
goto Suppress;
}
- if (len0 > 3 && STREQ (mangled + len0 - 3, "TKB"))
+ if (len0 > 3 && DEPRECATED_STREQ (mangled + len0 - 3, "TKB"))
len0 -= 3;
- if (len0 > 1 && STREQ (mangled + len0 - 1, "B"))
+ if (len0 > 1 && DEPRECATED_STREQ (mangled + len0 - 1, "B"))
len0 -= 1;
/* Make demangled big enough for possible expansion by operator name. */
for (k = 0; ada_opname_table[k].mangled != NULL; k += 1)
{
int op_len = strlen (ada_opname_table[k].mangled);
- if (STREQN
+ if (DEPRECATED_STREQN
(ada_opname_table[k].mangled + 1, mangled + i + 1,
op_len - 1) && !isalnum (mangled[i + op_len]))
{
}
at_start_name = 0;
- if (i < len0 - 4 && STREQN (mangled + i, "TK__", 4))
+ if (i < len0 - 4 && DEPRECATED_STREQN (mangled + i, "TK__", 4))
i += 2;
if (mangled[i] == 'X' && i != 0 && isalnum (mangled[i - 1]))
{
else
{
int len_name = strlen (name);
- return (STREQN (sym_name, name, len_name)
+ return (DEPRECATED_STREQN (sym_name, name, len_name)
&& is_name_suffix (sym_name + len_name))
- || (STREQN (sym_name, "_ada_", 5)
- && STREQN (sym_name + 5, name, len_name)
+ || (DEPRECATED_STREQN (sym_name, "_ada_", 5)
+ && DEPRECATED_STREQN (sym_name + 5, name, len_name)
&& is_name_suffix (sym_name + len_name + 5));
}
}
int
ada_suppress_symbol_printing (struct symbol *sym)
{
- if (SYMBOL_NAMESPACE (sym) == STRUCT_NAMESPACE)
+ if (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN)
return 1;
else
- return is_suppressed_name (SYMBOL_NAME (sym));
+ return is_suppressed_name (DEPRECATED_SYMBOL_NAME (sym));
}
\f
/* NOTE: Use ada_lookup_symbol_list because of bug in some versions
* of gcc (Solaris, e.g.). FIXME when compiler is fixed. */
n = ada_lookup_symbol_list (name, get_selected_block (NULL),
- VAR_NAMESPACE, &syms, &blocks);
+ VAR_DOMAIN, &syms, &blocks);
for (i = 0; i < n; i += 1)
if (syms[i] != NULL && SYMBOL_CLASS (syms[i]) == LOC_TYPEDEF
- && STREQ (name, ada_type_name (SYMBOL_TYPE (syms[i]))))
+ && DEPRECATED_STREQ (name, ada_type_name (SYMBOL_TYPE (syms[i]))))
break;
if (i >= n)
{
n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name,
exp->elts[pc + 1].block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&candidate_syms,
&candidate_blocks);
case LOC_LOCAL_ARG:
case LOC_BASEREG:
case LOC_BASEREG_ARG:
+ case LOC_COMPUTED:
+ case LOC_COMPUTED_ARG:
goto FoundNonType;
default:
break;
n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name,
exp->elts[pc + 4].block,
- VAR_NAMESPACE,
+ VAR_DOMAIN,
&candidate_syms,
&candidate_blocks);
if (n_candidates == 1)
n_candidates =
ada_lookup_symbol_list (ada_mangle (ada_op_name (op)),
- (struct block *) NULL, VAR_NAMESPACE,
+ (struct block *) NULL, VAR_DOMAIN,
&candidate_syms, &candidate_blocks);
i =
ada_resolve_function (candidate_syms, candidate_blocks,
n1 = k1;
while (N1[n1] == '_' && n1 > 0 && N1[n1 - 1] == '_')
n1 -= 1;
- if (n0 == n1 && STREQN (N0, N1, n0))
+ if (n0 == n1 && DEPRECATED_STREQN (N0, N1, n0))
return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1));
}
return (strcmp (N0, N1) < 0);
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];
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);
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]));
}
}
{
CORE_ADDR old_sp = *sp;
-#ifdef STACK_ALIGN
+#ifdef DEPRECATED_STACK_ALIGN
*sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
- STACK_ALIGN (TYPE_LENGTH
+ DEPRECATED_STACK_ALIGN (TYPE_LENGTH
(check_typedef (VALUE_TYPE (val)))));
#else
*sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
static struct block **defn_blocks = NULL;
/* Return the result of a standard (literal, C-like) lookup of NAME in
- * given NAMESPACE. */
+ * given DOMAIN. */
static struct symbol *
-standard_lookup (const char *name, namespace_enum namespace)
+standard_lookup (const char *name, domain_enum domain)
{
struct symbol *sym;
- struct symtab *symtab;
- sym = lookup_symbol (name, (struct block *) NULL, namespace, 0, &symtab);
+ sym = lookup_symbol (name, (struct block *) NULL, domain, 0, NULL);
return sym;
}
if ((TYPE_CODE (type0) == TYPE_CODE_STRUCT
|| TYPE_CODE (type0) == TYPE_CODE_ENUM)
&& ada_type_name (type0) != NULL && ada_type_name (type1) != NULL
- && STREQ (ada_type_name (type0), ada_type_name (type1)))
+ && DEPRECATED_STREQ (ada_type_name (type0), ada_type_name (type1)))
return 1;
return 0;
{
if (sym0 == sym1)
return 1;
- if (SYMBOL_NAMESPACE (sym0) != SYMBOL_NAMESPACE (sym1)
+ if (SYMBOL_DOMAIN (sym0) != SYMBOL_DOMAIN (sym1)
|| SYMBOL_CLASS (sym0) != SYMBOL_CLASS (sym1))
return 0;
{
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)
&& (equiv_types (type0, type1)
- || (len0 < strlen (name1) && STREQN (name0, name1, len0)
- && STREQN (name1 + len0, "___XV", 5)));
+ || (len0 < strlen (name1) && DEPRECATED_STREQN (name0, name1, len0)
+ && DEPRECATED_STREQN (name1 + len0, "___XV", 5)));
}
case LOC_CONST:
return SYMBOL_VALUE (sym0) == SYMBOL_VALUE (sym1)
ndefns += 1;
}
-/* Look, in partial_symtab PST, for symbol NAME in given namespace.
+/* Look, in partial_symtab PST, for symbol NAME in given domain.
Check the global symbols if GLOBAL, the static symbols if not. Do
wild-card match if WILD. */
static struct partial_symbol *
ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
- int global, namespace_enum namespace, int wild)
+ int global, domain_enum domain, int wild)
{
struct partial_symbol **start;
int name_len = strlen (name);
{
struct partial_symbol *psym = start[i];
- if (SYMBOL_NAMESPACE (psym) == namespace &&
- wild_match (name, name_len, SYMBOL_NAME (psym)))
+ if (SYMBOL_DOMAIN (psym) == domain &&
+ wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (psym)))
return psym;
}
return NULL;
{
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;
{
struct partial_symbol *psym = start[i];
- if (SYMBOL_NAMESPACE (psym) == namespace)
+ if (SYMBOL_DOMAIN (psym) == domain)
{
- int cmp = strncmp (name, SYMBOL_NAME (psym), name_len);
+ int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym), name_len);
if (cmp < 0)
{
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;
{
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;
{
struct partial_symbol *psym = start[i];
- if (SYMBOL_NAMESPACE (psym) == namespace)
+ if (SYMBOL_DOMAIN (psym) == domain)
{
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)
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;
struct objfile *objfile;
struct block *b;
struct symbol *tmp_sym;
- int i, j;
+ struct dict_iterator iter;
+ int j;
ALL_SYMTABS (objfile, s)
{
case LOC_BLOCK:
case LOC_CONST_BYTES:
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
- ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym)
+ ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
return s;
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
- ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym)
+ ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
return s;
break;
default:
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)
{
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j);
- ALL_BLOCK_SYMBOLS (b, i, tmp_sym) if (sym == tmp_sym)
+ ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
return s;
}
break;
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;
}
}
/* For all subprograms that statically enclose the subprogram of the
- * selected frame, add symbols matching identifier NAME in NAMESPACE
+ * selected frame, add symbols matching identifier NAME in DOMAIN
* and their blocks to vectors *defn_symbols and *defn_blocks, as for
* ada_add_block_symbols (q.v.). If WILD, treat as NAME with a
* wildcard prefix. At the moment, this function uses a heuristic to
* frame as a static link, and then searches up the call stack for a
* frame with that same local-variable base. */
static void
-add_symbols_from_enclosing_procs (const char *name, namespace_enum namespace,
+add_symbols_from_enclosing_procs (const char *name, domain_enum domain,
int wild_match)
{
#ifdef i386
/* 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;
+ SYMBOL_DOMAIN (static_link) = VAR_DOMAIN;
SYMBOL_TYPE (static_link) = lookup_pointer_type (builtin_type_void);
SYMBOL_VALUE (static_link) =
-(long) TYPE_LENGTH (SYMBOL_TYPE (static_link));
}
- frame = selected_frame;
+ frame = deprecated_selected_frame;
while (frame != NULL && ndefns == 0)
{
struct block *block;
QUIT;
frame = get_prev_frame (frame);
}
- while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link);
+ while (frame != NULL && DEPRECATED_FRAME_LOCALS_ADDRESS (frame) != target_link);
if (frame == NULL)
break;
block = get_frame_block (frame, 0);
while (block != NULL && block_function (block) != NULL && ndefns == 0)
{
- ada_add_block_symbols (block, name, namespace, NULL, wild_match);
+ ada_add_block_symbols (block, name, domain, NULL, wild_match);
block = BLOCK_SUPERBLOCK (block);
}
is_nondebugging_type (struct type *type)
{
char *name = ada_type_name (type);
- return (name != NULL && STREQ (name, "<variable, no debug info>"));
+ return (name != NULL && DEPRECATED_STREQ (name, "<variable, no debug info>"));
}
/* Remove any non-debugging symbols in SYMS[0 .. NSYMS-1] that definitely
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
+ && DEPRECATED_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]))
return nsyms;
}
-/* Find symbols in NAMESPACE matching NAME, in BLOCK0 and enclosing
+/* Find symbols in DOMAIN matching NAME, in BLOCK0 and enclosing
scope and in global scopes, returning the number of matches. Sets
*SYMS to point to a vector of matching symbols, with *BLOCKS
pointing to the vector of corresponding blocks in which those
int
ada_lookup_symbol_list (const char *name, struct block *block0,
- namespace_enum namespace, struct symbol ***syms,
+ domain_enum domain, struct symbol ***syms,
struct block ***blocks)
{
struct symbol *sym;
block = block0;
while (block != NULL)
{
- ada_add_block_symbols (block, name, namespace, NULL, wild_match);
+ ada_add_block_symbols (block, name, domain, NULL, wild_match);
/* If we found a non-function match, assume that's the one. */
if (is_nonfunction (defn_symbols, ndefns))
continue;
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ ada_add_block_symbols (block, name, domain, objfile, wild_match);
}
- if (namespace == VAR_NAMESPACE)
+ if (domain == VAR_DOMAIN)
{
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))
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
ada_add_block_symbols (block,
- SYMBOL_NAME (msymbol),
- namespace, objfile, wild_match);
+ DEPRECATED_SYMBOL_NAME (msymbol),
+ domain, objfile, wild_match);
if (ndefns == old_ndefns)
{
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
ada_add_block_symbols (block,
- SYMBOL_NAME (msymbol),
- namespace, objfile,
+ DEPRECATED_SYMBOL_NAME (msymbol),
+ domain, objfile,
wild_match);
}
}
{
QUIT;
if (!ps->readin
- && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match))
+ && ada_lookup_partial_symbol (ps, name, 1, domain, wild_match))
{
s = PSYMTAB_TO_SYMTAB (ps);
if (!s->primary)
continue;
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ ada_add_block_symbols (block, name, domain, objfile, wild_match);
}
}
continue;
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- ada_add_block_symbols (block, name, namespace, objfile, wild_match);
+ ada_add_block_symbols (block, name, domain, objfile, wild_match);
}
ALL_PSYMTABS (objfile, ps)
{
QUIT;
if (!ps->readin
- && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match))
+ && ada_lookup_partial_symbol (ps, name, 0, domain, wild_match))
{
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
if (!s->primary)
continue;
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- ada_add_block_symbols (block, name, namespace,
+ ada_add_block_symbols (block, name, domain,
objfile, wild_match);
}
}
rare. */
if (ndefns == 0)
{
- add_symbols_from_enclosing_procs (name, namespace, wild_match);
+ add_symbols_from_enclosing_procs (name, domain, wild_match);
if (ndefns > 0)
goto done;
}
return ndefns;
}
-/* Return a symbol in NAMESPACE matching NAME, in BLOCK0 and enclosing
+/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing
* scope and in global scopes, or NULL if none. NAME is folded to
* lower case first, unless it is surrounded in single quotes.
* Otherwise, the result is as for ada_lookup_symbol_list, but is
struct symbol *
ada_lookup_symbol (const char *name, struct block *block0,
- namespace_enum namespace)
+ domain_enum domain)
{
struct symbol **candidate_syms;
struct block **candidate_blocks;
int n_candidates;
n_candidates = ada_lookup_symbol_list (name,
- block0, namespace,
+ block0, domain,
&candidate_syms, &candidate_blocks);
if (n_candidates == 0)
return 0;
if (str[2] == '_')
{
- if (STREQ (str + 3, "LJM"))
+ if (DEPRECATED_STREQ (str + 3, "LJM"))
return 1;
if (str[3] != 'X')
return 0;
int s, e;
name_len = strlen (name);
- if (name_len >= patn_len + 5 && STREQN (name, "_ada_", 5)
- && STREQN (patn, name + 5, patn_len)
+ if (name_len >= patn_len + 5 && DEPRECATED_STREQN (name, "_ada_", 5)
+ && DEPRECATED_STREQN (patn, name + 5, patn_len)
&& is_name_suffix (name + patn_len + 5))
return 1;
while (name_len >= patn_len)
{
- if (STREQN (patn, name, patn_len) && is_name_suffix (name + patn_len))
+ if (DEPRECATED_STREQN (patn, name, patn_len) && is_name_suffix (name + patn_len))
return 1;
do
{
}
-/* Add symbols from BLOCK matching identifier NAME in NAMESPACE to
+/* Add symbols from BLOCK matching identifier NAME in DOMAIN to
vector *defn_symbols, updating *defn_symbols (if necessary), *SZ (the size of
the vector *defn_symbols), and *ndefns (the number of symbols
currently stored in *defn_symbols). If WILD, treat as NAME with a
static void
ada_add_block_symbols (struct block *block, const char *name,
- namespace_enum namespace, struct objfile *objfile,
+ domain_enum domain, struct objfile *objfile,
int wild)
{
- int i;
+ struct dict_iterator iter;
int name_len = strlen (name);
/* A matching argument symbol, if any. */
struct symbol *arg_sym;
/* Set true when we find a matching non-argument symbol */
int found_sym;
- int is_sorted = BLOCK_SHOULD_SORT (block);
struct symbol *sym;
arg_sym = NULL;
if (wild)
{
struct symbol *sym;
- ALL_BLOCK_SYMBOLS (block, i, sym)
+ ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- if (SYMBOL_NAMESPACE (sym) == namespace &&
- wild_match (name, name_len, SYMBOL_NAME (sym)))
+ if (SYMBOL_DOMAIN (sym) == domain &&
+ wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (sym)))
{
switch (SYMBOL_CLASS (sym))
{
case LOC_REGPARM:
case LOC_REGPARM_ADDR:
case LOC_BASEREG_ARG:
+ case LOC_COMPUTED_ARG:
arg_sym = sym;
break;
case LOC_UNRESOLVED:
}
else
{
- if (is_sorted)
- {
- int U;
- i = 0;
- U = BLOCK_NSYMS (block) - 1;
- while (U - i > 4)
- {
- int M = (U + i) >> 1;
- struct symbol *sym = BLOCK_SYM (block, M);
- if (SYMBOL_NAME (sym)[0] < name[0])
- i = M + 1;
- else if (SYMBOL_NAME (sym)[0] > name[0])
- U = M - 1;
- else if (strcmp (SYMBOL_NAME (sym), name) < 0)
- i = M + 1;
- else
- U = M;
- }
- }
- else
- i = 0;
-
- for (; i < BLOCK_BUCKETS (block); i += 1)
- for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next)
+ ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- if (SYMBOL_NAMESPACE (sym) == namespace)
+ if (SYMBOL_DOMAIN (sym) == domain)
{
- int cmp = strncmp (name, SYMBOL_NAME (sym), name_len);
+ int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym), name_len);
- if (cmp < 0)
- {
- if (is_sorted)
- {
- i = BLOCK_BUCKETS (block);
- break;
- }
- }
- else if (cmp == 0
- && is_name_suffix (SYMBOL_NAME (sym) + name_len))
+ if (cmp == 0
+ && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len))
{
switch (SYMBOL_CLASS (sym))
{
case LOC_REGPARM:
case LOC_REGPARM_ADDR:
case LOC_BASEREG_ARG:
+ case LOC_COMPUTED_ARG:
arg_sym = sym;
break;
case LOC_UNRESOLVED:
{
arg_sym = NULL;
found_sym = 0;
- if (is_sorted)
- {
- int U;
- i = 0;
- U = BLOCK_NSYMS (block) - 1;
- while (U - i > 4)
- {
- int M = (U + i) >> 1;
- struct symbol *sym = BLOCK_SYM (block, M);
- if (SYMBOL_NAME (sym)[0] < '_')
- i = M + 1;
- else if (SYMBOL_NAME (sym)[0] > '_')
- U = M - 1;
- else if (strcmp (SYMBOL_NAME (sym), "_ada_") < 0)
- i = M + 1;
- else
- U = M;
- }
- }
- else
- i = 0;
- for (; i < BLOCK_BUCKETS (block); i += 1)
- for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next)
+ ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- struct symbol *sym = BLOCK_SYM (block, i);
-
- if (SYMBOL_NAMESPACE (sym) == namespace)
+ if (SYMBOL_DOMAIN (sym) == domain)
{
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)
- {
- if (is_sorted)
- {
- i = BLOCK_BUCKETS (block);
- break;
- }
- }
- else if (cmp == 0
- && is_name_suffix (SYMBOL_NAME (sym) + name_len + 5))
+ if (cmp == 0
+ && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len + 5))
{
switch (SYMBOL_CLASS (sym))
{
case LOC_REGPARM:
case LOC_REGPARM_ADDR:
case LOC_BASEREG_ARG:
+ case LOC_COMPUTED_ARG:
arg_sym = sym;
break;
case LOC_UNRESOLVED:
{
struct block *b;
int nargs, nsyms;
- int i;
+ struct dict_iterator iter;
struct type *ftype;
struct type *rtype;
size_t max_fields;
max_fields = 8;
TYPE_FIELDS (ftype) =
(struct field *) xmalloc (sizeof (struct field) * max_fields);
- ALL_BLOCK_SYMBOLS (b, i, sym)
+ ALL_BLOCK_SYMBOLS (b, iter, sym)
{
GROW_VECT (TYPE_FIELDS (ftype), max_fields, nargs + 1);
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;
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;
n_matches = 0;
if (lower_name != NULL)
n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block,
- VAR_NAMESPACE, &symbols, &blocks);
+ VAR_DOMAIN, &symbols, &blocks);
if (n_matches == 0)
n_matches = ada_lookup_symbol_list (unquoted_name, block,
- VAR_NAMESPACE, &symbols, &blocks);
+ VAR_DOMAIN, &symbols, &blocks);
if (n_matches == 0 && line_num >= 0)
error ("No line number information found for %s.", unquoted_name);
else if (n_matches == 0)
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);
QUIT;
- if (!STREQ (filename, s->filename))
+ if (!DEPRECATED_STREQ (filename, s->filename))
continue;
l = LINETABLE (s);
ind = find_line_in_linetable (l, line_num, symbols, nsyms, &exact);
else
{
struct symbol *sym =
- standard_lookup (func_name, VAR_NAMESPACE);
+ standard_lookup (func_name, VAR_DOMAIN);
if (is_plausible_func_for_line (sym, line_num))
best = item->line;
else
if (item->line == line_num)
{
struct symbol *sym =
- standard_lookup (func_name, VAR_NAMESPACE);
+ standard_lookup (func_name, VAR_DOMAIN);
if (is_plausible_func_for_line (sym, starting_line))
return i;
else
static void
debug_print_block (struct block *b)
{
- int i;
- struct symbol *i;
+ struct dict_iterator iter;
+ struct symbol *sym;
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:");
- ALL_BLOCK_SYMBOLS (b, i, sym)
+ ALL_BLOCK_SYMBOLS (b, iter, sym)
{
- 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");
}
{
QUIT;
- if (STREQ (filename, ps->filename))
+ if (DEPRECATED_STREQ (filename, ps->filename))
PSYMTAB_TO_SYMTAB (ps);
}
}
QUIT;
- if (!STREQ (s->filename, filename))
+ if (!DEPRECATED_STREQ (s->filename, filename))
continue;
target_line_num =
int
is_ada_runtime_file (char *filename)
{
- return (STREQN (filename, "s-", 2) ||
- STREQN (filename, "a-", 2) ||
- STREQN (filename, "g-", 2) || STREQN (filename, "i-", 2));
+ return (DEPRECATED_STREQN (filename, "s-", 2) ||
+ DEPRECATED_STREQN (filename, "a-", 2) ||
+ DEPRECATED_STREQN (filename, "g-", 2) || DEPRECATED_STREQN (filename, "i-", 2));
}
/* find the first frame that contains debugging information and that is not
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)
from finding the right frame */
if (sal.symtab->objfile &&
- STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so"))
+ DEPRECATED_STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so"))
continue;
#endif
- selected_frame = fi;
+ deprecated_selected_frame = fi;
break;
}
}
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)
{
else if (b->break_on_exception == 3)
fputs_filtered ("on assert failure", gdb_stdout);
*/
-#endif
}
int
return (SYMBOL_CLASS (sym) != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_BLOCK
&& SYMBOL_CLASS (sym) != LOC_CONST
- && type_name != NULL && STREQ (type_name, "exception"));
+ && type_name != NULL && DEPRECATED_STREQ (type_name, "exception"));
}
int
*break_on_exceptionp = 0;
/* FIXME: language_ada should be defined in defs.h */
/* if (current_language->la_language == language_ada
- && STREQN (arg, "exception", 9) &&
+ && DEPRECATED_STREQN (arg, "exception", 9) &&
(arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0'))
{
char *tok, *end_tok;
make_cleanup (xfree, arg);
if (toklen == 0)
strcpy (arg, "__gnat_raise_nodefer_with_msg");
- else if (STREQN (tok, "unhandled", toklen))
+ else if (DEPRECATED_STREQN (tok, "unhandled", toklen))
{
*break_on_exceptionp = 2;
strcpy (arg, "__gnat_unhandled_exception");
}
}
else if (current_language->la_language == language_ada
- && STREQN (arg, "assert", 6) &&
+ && DEPRECATED_STREQN (arg, "assert", 6) &&
(arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0'))
{
char *tok = arg + 6;
{
const char *name = TYPE_FIELD_NAME (type, field_num);
return (name == NULL
- || (name[0] == '_' && !STREQN (name, "_parent", 7)));
+ || (name[0] == '_' && !DEPRECATED_STREQN (name, "_parent", 7)));
}
}
{
const char *name = TYPE_FIELD_NAME (check_typedef (type), field_num);
return (name != NULL &&
- (STREQN (name, "PARENT", 6) || STREQN (name, "_parent", 7)));
+ (DEPRECATED_STREQN (name, "PARENT", 6) || DEPRECATED_STREQN (name, "_parent", 7)));
}
/* True iff field number FIELD_NUM of structure type TYPE is a
{
const char *name = TYPE_FIELD_NAME (type, field_num);
return (name != NULL
- && (STREQN (name, "PARENT", 6) || STREQ (name, "REP")
- || STREQN (name, "_parent", 7)
+ && (DEPRECATED_STREQN (name, "PARENT", 6) || DEPRECATED_STREQ (name, "REP")
+ || DEPRECATED_STREQN (name, "_parent", 7)
|| name[0] == 'S' || name[0] == 'R' || name[0] == 'O'));
}
for (discrim_end = name + strlen (name) - 6; discrim_end != name;
discrim_end -= 1)
{
- if (STREQN (discrim_end, "___XVN", 6))
+ if (DEPRECATED_STREQN (discrim_end, "___XVN", 6))
break;
}
if (discrim_end == name)
{
if (discrim_start == name + 1)
return "";
- if ((discrim_start > name + 3 && STREQN (discrim_start - 3, "___", 3))
+ if ((discrim_start > name + 3 && DEPRECATED_STREQN (discrim_start - 3, "___", 3))
|| discrim_start[-1] == '.')
break;
}
else
align_offset = len - 1;
- if (align_offset < 7 || !STREQN ("___XV", name + align_offset - 6, 5))
+ if (align_offset < 7 || !DEPRECATED_STREQN ("___XV", name + align_offset - 6, 5))
return TARGET_CHAR_BIT;
return atoi (name + align_offset) * TARGET_CHAR_BIT;
{
struct symbol *sym;
- sym = standard_lookup (name, VAR_NAMESPACE);
+ sym = standard_lookup (name, VAR_DOMAIN);
if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
return SYMBOL_TYPE (sym);
- sym = standard_lookup (name, STRUCT_NAMESPACE);
+ sym = standard_lookup (name, STRUCT_DOMAIN);
if (sym != NULL)
return SYMBOL_TYPE (sym);
else
{
int len = strlen (ada_type_name (type));
- if (len > 6 && STREQ (ada_type_name (type) + len - 6, "___XVE"))
+ if (len > 6 && DEPRECATED_STREQ (ada_type_name (type) + len - 6, "___XVE"))
return type;
else
return ada_find_parallel_type (type, "___XVE");
&& (TYPE_CODE (type) == TYPE_CODE_CHAR
|| TYPE_CODE (type) == TYPE_CODE_INT
|| TYPE_CODE (type) == TYPE_CODE_RANGE)
- && (STREQ (name, "character") || STREQ (name, "wide_character")
- || STREQ (name, "unsigned char"));
+ && (DEPRECATED_STREQ (name, "character") || DEPRECATED_STREQ (name, "wide_character")
+ || DEPRECATED_STREQ (name, "unsigned char"));
}
/* True if TYPE appears to be an Ada string type. */
CHECK_TYPEDEF (type);
return (TYPE_CODE (type) == TYPE_CODE_STRUCT
&& TYPE_NFIELDS (type) == 1
- && STREQ (TYPE_FIELD_NAME (type, 0), "F"));
+ && DEPRECATED_STREQ (TYPE_FIELD_NAME (type, 0), "F"));
}
/* If there is an ___XVS-convention type parallel to SUBTYPE, return
name_len > 6
&& (TYPE_CODE (type) == TYPE_CODE_INT
|| TYPE_CODE (type) == TYPE_CODE_RANGE)
- && STREQN (ada_type_name (type) + name_len - 6, "___XF", 5);
+ && DEPRECATED_STREQN (ada_type_name (type) + name_len - 6, "___XF", 5);
}
/* The type of special VAX floating-point type this is, assuming
not alter *PX and *PNEW_K if unsuccessful. */
static int
-scan_discrim_bound (char *, int k, struct value *dval, LONGEST * px,
+scan_discrim_bound (char *str, int k, struct value *dval, LONGEST * px,
int *pnew_k)
{
static char *bound_buffer = NULL;
int nsyms;
nsyms =
- ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_NAMESPACE,
+ ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_DOMAIN,
&syms, &blocks);
if (nsyms != 1)
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 */
+ value_of_this, /* value_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
+ NULL, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
#if 0
{"8#%lo#", "8#", "o", "#"}, /* Octal format info */
1, /* c-style arrays (FIXME?) */
0, /* String lower bound (FIXME?) */
&builtin_type_ada_char,
+ default_word_break_characters,
LANG_MAGIC
};