+2015-02-27 Tom Tromey <tromey@redhat.com>
+ Pedro Alves <palves@redhat.com>
+
+ Rename symbols whose names are reserved C++ keywords throughout.
+
2015-02-27 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER): New, get it from autoconf.
/* The name used to perform the lookup. */
const char *name;
/* The namespace used during the lookup. */
- domain_enum namespace;
+ domain_enum domain;
/* The symbol returned by the lookup, or NULL if no matching symbol
was found. */
struct symbol *sym;
ada_init_symbol_cache (sym_cache);
}
-/* Search our cache for an entry matching NAME and NAMESPACE.
+/* Search our cache for an entry matching NAME and DOMAIN.
Return it if found, or NULL otherwise. */
static struct cache_entry **
-find_entry (const char *name, domain_enum namespace)
+find_entry (const char *name, domain_enum domain)
{
struct ada_symbol_cache *sym_cache
= ada_get_symbol_cache (current_program_space);
for (e = &sym_cache->root[h]; *e != NULL; e = &(*e)->next)
{
- if (namespace == (*e)->namespace && strcmp (name, (*e)->name) == 0)
+ if (domain == (*e)->domain && strcmp (name, (*e)->name) == 0)
return e;
}
return NULL;
}
-/* Search the symbol cache for an entry matching NAME and NAMESPACE.
+/* Search the symbol cache for an entry matching NAME and DOMAIN.
Return 1 if found, 0 otherwise.
If an entry was found and SYM is not NULL, set *SYM to the entry's
SYM. Same principle for BLOCK if not NULL. */
static int
-lookup_cached_symbol (const char *name, domain_enum namespace,
+lookup_cached_symbol (const char *name, domain_enum domain,
struct symbol **sym, const struct block **block)
{
- struct cache_entry **e = find_entry (name, namespace);
+ struct cache_entry **e = find_entry (name, domain);
if (e == NULL)
return 0;
}
/* Assuming that (SYM, BLOCK) is the result of the lookup of NAME
- in domain NAMESPACE, save this result in our symbol cache. */
+ in domain DOMAIN, save this result in our symbol cache. */
static void
-cache_symbol (const char *name, domain_enum namespace, struct symbol *sym,
+cache_symbol (const char *name, domain_enum domain, struct symbol *sym,
const struct block *block)
{
struct ada_symbol_cache *sym_cache
e->name = copy = obstack_alloc (&sym_cache->cache_space, strlen (name) + 1);
strcpy (copy, name);
e->sym = sym;
- e->namespace = namespace;
+ e->domain = domain;
e->block = block;
}
\f
static void
add_symbols_from_enclosing_procs (struct obstack *obstackp,
- const char *name, domain_enum namespace,
+ const char *name, domain_enum domain,
int wild_match_p)
{
}
static int
ada_lookup_symbol_list_worker (const char *name0, const struct block *block0,
- domain_enum namespace,
+ domain_enum domain,
struct ada_symbol_info **results,
int full_search)
{
if (full_search)
{
ada_add_local_symbols (&symbol_list_obstack, name, block,
- namespace, wild_match_p);
+ domain, wild_match_p);
}
else
{
ada_iterate_over_symbols, and we don't want to search
superblocks. */
ada_add_block_symbols (&symbol_list_obstack, block, name,
- namespace, NULL, wild_match_p);
+ domain, NULL, wild_match_p);
}
if (num_defns_collected (&symbol_list_obstack) > 0 || !full_search)
goto done;
already performed this search before. If we have, then return
the same result. */
- if (lookup_cached_symbol (name0, namespace, &sym, &block))
+ if (lookup_cached_symbol (name0, domain, &sym, &block))
{
if (sym != NULL)
add_defn_to_vec (&symbol_list_obstack, sym, block);
/* Search symbols from all global blocks. */
- add_nonlocal_symbols (&symbol_list_obstack, name, namespace, 1,
+ add_nonlocal_symbols (&symbol_list_obstack, name, domain, 1,
wild_match_p);
/* Now add symbols from all per-file blocks if we've gotten no hits
(not strictly correct, but perhaps better than an error). */
if (num_defns_collected (&symbol_list_obstack) == 0)
- add_nonlocal_symbols (&symbol_list_obstack, name, namespace, 0,
+ add_nonlocal_symbols (&symbol_list_obstack, name, domain, 0,
wild_match_p);
done:
ndefns = remove_extra_symbols (*results, ndefns);
if (ndefns == 0 && full_search && syms_from_global_search)
- cache_symbol (name0, namespace, NULL, NULL);
+ cache_symbol (name0, domain, NULL, NULL);
if (ndefns == 1 && full_search && syms_from_global_search)
- cache_symbol (name0, namespace, (*results)[0].sym, (*results)[0].block);
+ cache_symbol (name0, domain, (*results)[0].sym, (*results)[0].block);
ndefns = remove_irrelevant_renamings (*results, ndefns, block0);
void
ada_lookup_encoded_symbol (const char *name, const struct block *block,
- domain_enum namespace,
+ domain_enum domain,
struct ada_symbol_info *info)
{
struct ada_symbol_info *candidates;
gdb_assert (info != NULL);
memset (info, 0, sizeof (struct ada_symbol_info));
- n_candidates = ada_lookup_symbol_list (name, block, namespace, &candidates);
+ n_candidates = ada_lookup_symbol_list (name, block, domain, &candidates);
if (n_candidates == 0)
return;
struct symbol *
ada_lookup_symbol (const char *name, const struct block *block0,
- domain_enum namespace, int *is_a_field_of_this)
+ domain_enum domain, int *is_a_field_of_this)
{
struct ada_symbol_info info;
*is_a_field_of_this = 0;
ada_lookup_encoded_symbol (ada_encode (ada_fold_name (name)),
- block0, namespace, &info);
+ block0, domain, &info);
return info.sym;
}
ada_find_parallel_type (struct type *type, const char *suffix)
{
char *name;
- const char *typename = ada_type_name (type);
+ const char *type_name = ada_type_name (type);
int len;
- if (typename == NULL)
+ if (type_name == NULL)
return NULL;
- len = strlen (typename);
+ len = strlen (type_name);
name = (char *) alloca (len + strlen (suffix) + 1);
- strcpy (name, typename);
+ strcpy (name, type_name);
strcpy (name + len, suffix);
return ada_find_parallel_type_with_name (type, name);
/* A record type with no fields. */
static struct type *
-empty_record (struct type *template)
+empty_record (struct type *templ)
{
- struct type *type = alloc_type_copy (template);
+ struct type *type = alloc_type_copy (templ);
TYPE_CODE (type) = TYPE_CODE_STRUCT;
TYPE_NFIELDS (type) = 0;
domain_enum, int *);
extern void ada_lookup_encoded_symbol
- (const char *name, const struct block *block, domain_enum namespace,
+ (const char *name, const struct block *block, domain_enum domain,
struct ada_symbol_info *symbol_info);
extern struct bound_minimal_symbol ada_lookup_simple_minsym (const char *);
implementation. */
struct addrmap_funcs
{
- void (*set_empty) (struct addrmap *this,
+ void (*set_empty) (struct addrmap *self,
CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj);
- void *(*find) (struct addrmap *this, CORE_ADDR addr);
- struct addrmap *(*create_fixed) (struct addrmap *this,
+ void *(*find) (struct addrmap *self, CORE_ADDR addr);
+ struct addrmap *(*create_fixed) (struct addrmap *self,
struct obstack *obstack);
- void (*relocate) (struct addrmap *this, CORE_ADDR offset);
- int (*foreach) (struct addrmap *this, addrmap_foreach_fn fn, void *data);
+ void (*relocate) (struct addrmap *self, CORE_ADDR offset);
+ int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn, void *data);
};
static void
-addrmap_fixed_set_empty (struct addrmap *this,
+addrmap_fixed_set_empty (struct addrmap *self,
CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj)
{
static void *
-addrmap_fixed_find (struct addrmap *this, CORE_ADDR addr)
+addrmap_fixed_find (struct addrmap *self, CORE_ADDR addr)
{
- struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+ struct addrmap_fixed *map = (struct addrmap_fixed *) self;
struct addrmap_transition *bottom = &map->transitions[0];
struct addrmap_transition *top = &map->transitions[map->num_transitions - 1];
static struct addrmap *
-addrmap_fixed_create_fixed (struct addrmap *this, struct obstack *obstack)
+addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack)
{
internal_error (__FILE__, __LINE__,
_("addrmap_create_fixed is not implemented yet "
static void
-addrmap_fixed_relocate (struct addrmap *this, CORE_ADDR offset)
+addrmap_fixed_relocate (struct addrmap *self, CORE_ADDR offset)
{
- struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+ struct addrmap_fixed *map = (struct addrmap_fixed *) self;
size_t i;
for (i = 0; i < map->num_transitions; i++)
static int
-addrmap_fixed_foreach (struct addrmap *this, addrmap_foreach_fn fn,
+addrmap_fixed_foreach (struct addrmap *self, addrmap_foreach_fn fn,
void *data)
{
- struct addrmap_fixed *map = (struct addrmap_fixed *) this;
+ struct addrmap_fixed *map = (struct addrmap_fixed *) self;
size_t i;
for (i = 0; i < map->num_transitions; i++)
tree node at ADDR, even if it would represent a "transition" from
one value to the same value. */
static void
-force_transition (struct addrmap_mutable *this, CORE_ADDR addr)
+force_transition (struct addrmap_mutable *self, CORE_ADDR addr)
{
splay_tree_node n
- = addrmap_splay_tree_lookup (this, addr);
+ = addrmap_splay_tree_lookup (self, addr);
if (! n)
{
- n = addrmap_splay_tree_predecessor (this, addr);
- addrmap_splay_tree_insert (this, addr,
+ n = addrmap_splay_tree_predecessor (self, addr);
+ addrmap_splay_tree_insert (self, addr,
n ? addrmap_node_value (n) : NULL);
}
}
static void
-addrmap_mutable_set_empty (struct addrmap *this,
+addrmap_mutable_set_empty (struct addrmap *self,
CORE_ADDR start, CORE_ADDR end_inclusive,
void *obj)
{
- struct addrmap_mutable *map = (struct addrmap_mutable *) this;
+ struct addrmap_mutable *map = (struct addrmap_mutable *) self;
splay_tree_node n, next;
void *prior_value;
static void *
-addrmap_mutable_find (struct addrmap *this, CORE_ADDR addr)
+addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
{
/* Not needed yet. */
internal_error (__FILE__, __LINE__,
static struct addrmap *
-addrmap_mutable_create_fixed (struct addrmap *this, struct obstack *obstack)
+addrmap_mutable_create_fixed (struct addrmap *self, struct obstack *obstack)
{
- struct addrmap_mutable *mutable = (struct addrmap_mutable *) this;
+ struct addrmap_mutable *mutable_obj = (struct addrmap_mutable *) self;
struct addrmap_fixed *fixed;
size_t num_transitions;
/* Count the number of transitions in the tree. */
num_transitions = 0;
- splay_tree_foreach (mutable->tree, splay_foreach_count, &num_transitions);
+ splay_tree_foreach (mutable_obj->tree, splay_foreach_count, &num_transitions);
/* Include an extra entry for the transition at zero (which fixed
maps have, but mutable maps do not.) */
/* Copy all entries from the splay tree to the array, in order
of increasing address. */
- splay_tree_foreach (mutable->tree, splay_foreach_copy, fixed);
+ splay_tree_foreach (mutable_obj->tree, splay_foreach_copy, fixed);
/* We should have filled the array. */
gdb_assert (fixed->num_transitions == num_transitions);
static void
-addrmap_mutable_relocate (struct addrmap *this, CORE_ADDR offset)
+addrmap_mutable_relocate (struct addrmap *self, CORE_ADDR offset)
{
/* Not needed yet. */
internal_error (__FILE__, __LINE__,
static int
-addrmap_mutable_foreach (struct addrmap *this, addrmap_foreach_fn fn,
+addrmap_mutable_foreach (struct addrmap *self, addrmap_foreach_fn fn,
void *data)
{
- struct addrmap_mutable *mutable = (struct addrmap_mutable *) this;
+ struct addrmap_mutable *mutable_obj = (struct addrmap_mutable *) self;
struct mutable_foreach_data foreach_data;
foreach_data.fn = fn;
foreach_data.data = data;
- return splay_tree_foreach (mutable->tree, addrmap_mutable_foreach_worker,
+ return splay_tree_foreach (mutable_obj->tree, addrmap_mutable_foreach_worker,
&foreach_data);
}
else if (gi == gcount)
{
thread = add_thread (ptid_build (infpid, 0, pbuf[pi].pthid));
- thread->private = xmalloc (sizeof (struct private_thread_info));
- thread->private->pdtid = pbuf[pi].pdtid;
- thread->private->tid = pbuf[pi].tid;
+ thread->priv = xmalloc (sizeof (struct private_thread_info));
+ thread->priv->pdtid = pbuf[pi].pdtid;
+ thread->priv->tid = pbuf[pi].tid;
pi++;
}
else
if (cmp_result == 0)
{
- gbuf[gi]->private->pdtid = pdtid;
- gbuf[gi]->private->tid = tid;
+ gbuf[gi]->priv->pdtid = pdtid;
+ gbuf[gi]->priv->tid = tid;
pi++;
gi++;
}
else
{
thread = add_thread (pptid);
- thread->private = xmalloc (sizeof (struct private_thread_info));
- thread->private->pdtid = pdtid;
- thread->private->tid = tid;
+ thread->priv = xmalloc (sizeof (struct private_thread_info));
+ thread->priv->pdtid = pdtid;
+ thread->priv->tid = tid;
pi++;
}
}
{
const pthdb_tid_t tid = *(pthdb_tid_t *)tidp;
- return (thread->private->tid == tid);
+ return (thread->priv->tid == tid);
}
/* Synchronize libpthdebug's state with the inferior and with GDB,
error (_("aix-thread resume: unknown pthread %ld"),
ptid_get_lwp (ptid));
- tid[0] = thread->private->tid;
+ tid[0] = thread->priv->tid;
if (tid[0] == PTHDB_INVALID_TID)
error (_("aix-thread resume: no tid for pthread %ld"),
ptid_get_lwp (ptid));
else
{
thread = find_thread_ptid (inferior_ptid);
- tid = thread->private->tid;
+ tid = thread->priv->tid;
if (tid == PTHDB_INVALID_TID)
- fetch_regs_user_thread (regcache, thread->private->pdtid);
+ fetch_regs_user_thread (regcache, thread->priv->pdtid);
else
fetch_regs_kernel_thread (regcache, regno, tid);
}
else
{
thread = find_thread_ptid (inferior_ptid);
- tid = thread->private->tid;
+ tid = thread->priv->tid;
if (tid == PTHDB_INVALID_TID)
- store_regs_user_thread (regcache, thread->private->pdtid);
+ store_regs_user_thread (regcache, thread->priv->pdtid);
else
store_regs_kernel_thread (regcache, regno, tid);
}
buf = mem_fileopen ();
- pdtid = thread->private->pdtid;
- tid = thread->private->tid;
+ pdtid = thread->priv->pdtid;
+ tid = thread->priv->tid;
if (tid != PTHDB_INVALID_TID)
/* i18n: Like "thread-identifier %d, [state] running, suspended" */
return AMD64_SSE;
}
-static void amd64_classify (struct type *type, enum amd64_reg_class class[2]);
+static void amd64_classify (struct type *type, enum amd64_reg_class theclass[2]);
/* Return non-zero if TYPE is a non-POD structure or union type. */
arrays) and union types, and store the result in CLASS. */
static void
-amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
+amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
{
/* 1. If the size of an object is larger than two eightbytes, or in
C++, is a non-POD structure or union type, or contains
unaligned fields, it has class memory. */
if (TYPE_LENGTH (type) > 16 || amd64_non_pod_p (type))
{
- class[0] = class[1] = AMD64_MEMORY;
+ theclass[0] = theclass[1] = AMD64_MEMORY;
return;
}
/* 2. Both eightbytes get initialized to class NO_CLASS. */
- class[0] = class[1] = AMD64_NO_CLASS;
+ theclass[0] = theclass[1] = AMD64_NO_CLASS;
/* 3. Each field of an object is classified recursively so that
always two fields are considered. The resulting class is
struct type *subtype = check_typedef (TYPE_TARGET_TYPE (type));
/* All fields in an array have the same type. */
- amd64_classify (subtype, class);
- if (TYPE_LENGTH (type) > 8 && class[1] == AMD64_NO_CLASS)
- class[1] = class[0];
+ amd64_classify (subtype, theclass);
+ if (TYPE_LENGTH (type) > 8 && theclass[1] == AMD64_NO_CLASS)
+ theclass[1] = theclass[0];
}
else
{
gdb_assert (pos == 0 || pos == 1);
amd64_classify (subtype, subclass);
- class[pos] = amd64_merge_classes (class[pos], subclass[0]);
+ theclass[pos] = amd64_merge_classes (theclass[pos], subclass[0]);
if (bitsize <= 64 && pos == 0 && endpos == 1)
/* This is a bit of an odd case: We have a field that would
normally fit in one of the two eightbytes, except that
use up all 16 bytes of the aggregate, and are already
handled just fine (because each portion sits on its own
8-byte). */
- class[1] = amd64_merge_classes (class[1], subclass[0]);
+ theclass[1] = amd64_merge_classes (theclass[1], subclass[0]);
if (pos == 0)
- class[1] = amd64_merge_classes (class[1], subclass[1]);
+ theclass[1] = amd64_merge_classes (theclass[1], subclass[1]);
}
}
/* Rule (a): If one of the classes is MEMORY, the whole argument is
passed in memory. */
- if (class[0] == AMD64_MEMORY || class[1] == AMD64_MEMORY)
- class[0] = class[1] = AMD64_MEMORY;
+ if (theclass[0] == AMD64_MEMORY || theclass[1] == AMD64_MEMORY)
+ theclass[0] = theclass[1] = AMD64_MEMORY;
/* Rule (b): If SSEUP is not preceded by SSE, it is converted to
SSE. */
- if (class[0] == AMD64_SSEUP)
- class[0] = AMD64_SSE;
- if (class[1] == AMD64_SSEUP && class[0] != AMD64_SSE)
- class[1] = AMD64_SSE;
+ if (theclass[0] == AMD64_SSEUP)
+ theclass[0] = AMD64_SSE;
+ if (theclass[1] == AMD64_SSEUP && theclass[0] != AMD64_SSE)
+ theclass[1] = AMD64_SSE;
}
/* Classify TYPE, and store the result in CLASS. */
static void
-amd64_classify (struct type *type, enum amd64_reg_class class[2])
+amd64_classify (struct type *type, enum amd64_reg_class theclass[2])
{
enum type_code code = TYPE_CODE (type);
int len = TYPE_LENGTH (type);
- class[0] = class[1] = AMD64_NO_CLASS;
+ theclass[0] = theclass[1] = AMD64_NO_CLASS;
/* Arguments of types (signed and unsigned) _Bool, char, short, int,
long, long long, and pointers are in the INTEGER class. Similarly,
|| code == TYPE_CODE_CHAR
|| code == TYPE_CODE_PTR || code == TYPE_CODE_REF)
&& (len == 1 || len == 2 || len == 4 || len == 8))
- class[0] = AMD64_INTEGER;
+ theclass[0] = AMD64_INTEGER;
/* Arguments of types float, double, _Decimal32, _Decimal64 and __m64
are in class SSE. */
else if ((code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT)
&& (len == 4 || len == 8))
/* FIXME: __m64 . */
- class[0] = AMD64_SSE;
+ theclass[0] = AMD64_SSE;
/* Arguments of types __float128, _Decimal128 and __m128 are split into
two halves. The least significant ones belong to class SSE, the most
significant one to class SSEUP. */
else if (code == TYPE_CODE_DECFLOAT && len == 16)
/* FIXME: __float128, __m128. */
- class[0] = AMD64_SSE, class[1] = AMD64_SSEUP;
+ theclass[0] = AMD64_SSE, theclass[1] = AMD64_SSEUP;
/* The 64-bit mantissa of arguments of type long double belongs to
class X87, the 16-bit exponent plus 6 bytes of padding belongs to
class X87UP. */
else if (code == TYPE_CODE_FLT && len == 16)
/* Class X87 and X87UP. */
- class[0] = AMD64_X87, class[1] = AMD64_X87UP;
+ theclass[0] = AMD64_X87, theclass[1] = AMD64_X87UP;
/* Arguments of complex T where T is one of the types float or
double get treated as if they are implemented as:
*/
else if (code == TYPE_CODE_COMPLEX && len == 8)
- class[0] = AMD64_SSE;
+ theclass[0] = AMD64_SSE;
else if (code == TYPE_CODE_COMPLEX && len == 16)
- class[0] = class[1] = AMD64_SSE;
+ theclass[0] = theclass[1] = AMD64_SSE;
/* A variable of type complex long double is classified as type
COMPLEX_X87. */
else if (code == TYPE_CODE_COMPLEX && len == 32)
- class[0] = AMD64_COMPLEX_X87;
+ theclass[0] = AMD64_COMPLEX_X87;
/* Aggregates. */
else if (code == TYPE_CODE_ARRAY || code == TYPE_CODE_STRUCT
|| code == TYPE_CODE_UNION)
- amd64_classify_aggregate (type, class);
+ amd64_classify_aggregate (type, theclass);
}
static enum return_value_convention
struct type *type, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
- enum amd64_reg_class class[2];
+ enum amd64_reg_class theclass[2];
int len = TYPE_LENGTH (type);
static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM };
static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM };
gdb_assert (!(readbuf && writebuf));
/* 1. Classify the return type with the classification algorithm. */
- amd64_classify (type, class);
+ amd64_classify (type, theclass);
/* 2. If the type has class MEMORY, then the caller provides space
for the return value and passes the address of this storage in
On return %rax will contain the address that has been passed in
by the caller in %rdi. */
- if (class[0] == AMD64_MEMORY)
+ if (theclass[0] == AMD64_MEMORY)
{
/* As indicated by the comment above, the ABI guarantees that we
can always find the return value just after the function has
/* 8. If the class is COMPLEX_X87, the real part of the value is
returned in %st0 and the imaginary part in %st1. */
- if (class[0] == AMD64_COMPLEX_X87)
+ if (theclass[0] == AMD64_COMPLEX_X87)
{
if (readbuf)
{
return RETURN_VALUE_REGISTER_CONVENTION;
}
- gdb_assert (class[1] != AMD64_MEMORY);
+ gdb_assert (theclass[1] != AMD64_MEMORY);
gdb_assert (len <= 16);
for (i = 0; len > 0; i++, len -= 8)
int regnum = -1;
int offset = 0;
- switch (class[i])
+ switch (theclass[i])
{
case AMD64_INTEGER:
/* 3. If the class is INTEGER, the next available register
case AMD64_X87UP:
/* 7. If the class is X87UP, the value is returned together
with the previous X87 value in %st0. */
- gdb_assert (i > 0 && class[0] == AMD64_X87);
+ gdb_assert (i > 0 && theclass[0] == AMD64_X87);
regnum = AMD64_ST0_REGNUM;
offset = 8;
len = 2;
{
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
- enum amd64_reg_class class[2];
+ enum amd64_reg_class theclass[2];
int needed_integer_regs = 0;
int needed_sse_regs = 0;
int j;
/* Classify argument. */
- amd64_classify (type, class);
+ amd64_classify (type, theclass);
/* Calculate the number of integer and SSE registers needed for
this argument. */
for (j = 0; j < 2; j++)
{
- if (class[j] == AMD64_INTEGER)
+ if (theclass[j] == AMD64_INTEGER)
needed_integer_regs++;
- else if (class[j] == AMD64_SSE)
+ else if (theclass[j] == AMD64_SSE)
needed_sse_regs++;
}
int regnum = -1;
int offset = 0;
- switch (class[j])
+ switch (theclass[j])
{
case AMD64_INTEGER:
regnum = integer_regnum[integer_reg++];
/* The user's string isn't in the list. Insert it after *ps. */
{
- struct bstring *new
+ struct bstring *newobj
= obstack_alloc (&bcache->cache, BSTRING_SIZE (length));
- memcpy (&new->d.data, addr, length);
- new->length = length;
- new->next = bcache->bucket[hash_index];
- new->half_hash = half_hash;
- bcache->bucket[hash_index] = new;
+ memcpy (&newobj->d.data, addr, length);
+ newobj->length = length;
+ newobj->next = bcache->bucket[hash_index];
+ newobj->half_hash = half_hash;
+ bcache->bucket[hash_index] = newobj;
bcache->unique_count++;
bcache->unique_size += length;
if (added)
*added = 1;
- return &new->d.data;
+ return &newobj->d.data;
}
}
\f
struct block_namespace_info
{
const char *scope;
- struct using_direct *using;
+ struct using_direct *using_decl;
};
static void block_initialize_namespace (struct block *block,
if (block == NULL || BLOCK_NAMESPACE (block) == NULL)
return NULL;
else
- return BLOCK_NAMESPACE (block)->using;
+ return BLOCK_NAMESPACE (block)->using_decl;
}
/* Set BLOCK's using member to USING; if needed, allocate memory via
void
block_set_using (struct block *block,
- struct using_direct *using,
+ struct using_direct *using_decl,
struct obstack *obstack)
{
block_initialize_namespace (block, obstack);
- BLOCK_NAMESPACE (block)->using = using;
+ BLOCK_NAMESPACE (block)->using_decl = using_decl;
}
/* If BLOCK_NAMESPACE (block) is NULL, allocate it via OBSTACK and
BLOCK_NAMESPACE (block)
= obstack_alloc (obstack, sizeof (struct block_namespace_info));
BLOCK_NAMESPACE (block)->scope = NULL;
- BLOCK_NAMESPACE (block)->using = NULL;
+ BLOCK_NAMESPACE (block)->using_decl = NULL;
}
}
this block: using directives and the current namespace
scope. */
- struct block_namespace_info *namespace;
+ struct block_namespace_info *the_namespace;
}
cplus_specific;
}
#define BLOCK_FUNCTION(bl) (bl)->function
#define BLOCK_SUPERBLOCK(bl) (bl)->superblock
#define BLOCK_DICT(bl) (bl)->dict
-#define BLOCK_NAMESPACE(bl) (bl)->language_specific.cplus_specific.namespace
+#define BLOCK_NAMESPACE(bl) (bl)->language_specific.cplus_specific.the_namespace
struct blockvector
{
extern struct using_direct *block_using (const struct block *block);
extern void block_set_using (struct block *block,
- struct using_direct *using,
+ struct using_direct *using_decl,
struct obstack *obstack);
extern const struct block *block_static_block (const struct block *block);
{
struct exception_catchpoint *self
= (struct exception_catchpoint *) bs->breakpoint_at;
- char *typename = NULL;
+ char *type_name = NULL;
volatile struct gdb_exception e;
bkpt_breakpoint_ops.check_status (bs);
char *canon;
fetch_probe_arguments (NULL, &typeinfo_arg);
- typename = cplus_typename_from_type_info (typeinfo_arg);
+ type_name = cplus_typename_from_type_info (typeinfo_arg);
- canon = cp_canonicalize_string (typename);
+ canon = cp_canonicalize_string (type_name);
if (canon != NULL)
{
- xfree (typename);
- typename = canon;
+ xfree (type_name);
+ type_name = canon;
}
}
if (e.reason < 0)
exception_print (gdb_stderr, e);
- else if (regexec (self->pattern, typename, 0, NULL, 0) != 0)
+ else if (regexec (self->pattern, type_name, 0, NULL, 0) != 0)
bs->stop = 0;
- xfree (typename);
+ xfree (type_name);
}
/* Implement the 're_set' method. */
struct context_stack *
push_context (int desc, CORE_ADDR valu)
{
- struct context_stack *new;
+ struct context_stack *newobj;
if (context_stack_depth == context_stack_size)
{
(context_stack_size * sizeof (struct context_stack)));
}
- new = &context_stack[context_stack_depth++];
- new->depth = desc;
- new->locals = local_symbols;
- new->old_blocks = pending_blocks;
- new->start_addr = valu;
- new->using_directives = using_directives;
- new->name = NULL;
+ newobj = &context_stack[context_stack_depth++];
+ newobj->depth = desc;
+ newobj->locals = local_symbols;
+ newobj->old_blocks = pending_blocks;
+ newobj->start_addr = valu;
+ newobj->using_directives = using_directives;
+ newobj->name = NULL;
local_symbols = NULL;
using_directives = NULL;
- return new;
+ return newobj;
}
/* Pop a context block. Returns the address of the context block just
struct type_stack *type_stack;
- struct objc_class_str class;
+ struct objc_class_str theclass;
}
%{
%token <ssym> UNKNOWN_CPP_NAME
%token <voidval> COMPLETE
%token <tsym> TYPENAME
-%token <class> CLASSNAME /* ObjC Class name */
+%token <theclass> CLASSNAME /* ObjC Class name */
%type <sval> name
%type <svec> string_exp
%type <ssym> name_not_typename
-%type <tsym> typename
+%type <tsym> type_name
/* This is like a '[' token, but is only generated when parsing
Objective C. This lets us reuse the same parser without
%token TEMPLATE
%token ERROR
%token NEW DELETE
-%type <sval> operator
+%type <sval> oper
%token REINTERPRET_CAST DYNAMIC_CAST STATIC_CAST CONST_CAST
%token ENTRY
%token TYPEOF
exp : OBJC_LBRAC TYPENAME
{
- CORE_ADDR class;
+ CORE_ADDR theclass;
- class = lookup_objc_class (parse_gdbarch (pstate),
+ theclass = lookup_objc_class (parse_gdbarch (pstate),
copy_name ($2.stoken));
- if (class == 0)
+ if (theclass == 0)
error (_("%s is not an ObjC Class"),
copy_name ($2.stoken));
write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate,
parse_type (pstate)->builtin_int);
- write_exp_elt_longcst (pstate, (LONGEST) class);
+ write_exp_elt_longcst (pstate, (LONGEST) theclass);
write_exp_elt_opcode (pstate, OP_LONG);
start_msglist();
}
write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate,
parse_type (pstate)->builtin_int);
- write_exp_elt_longcst (pstate, (LONGEST) $2.class);
+ write_exp_elt_longcst (pstate, (LONGEST) $2.theclass);
write_exp_elt_opcode (pstate, OP_LONG);
start_msglist();
}
$2.length);
$$ = NULL;
}
- | UNSIGNED typename
+ | UNSIGNED type_name
{ $$ = lookup_unsigned_typename (parse_language (pstate),
parse_gdbarch (pstate),
TYPE_NAME($2.type)); }
{ $$ = lookup_unsigned_typename (parse_language (pstate),
parse_gdbarch (pstate),
"int"); }
- | SIGNED_KEYWORD typename
+ | SIGNED_KEYWORD type_name
{ $$ = lookup_signed_typename (parse_language (pstate),
parse_gdbarch (pstate),
TYPE_NAME($2.type)); }
{ $$ = follow_types ($1); }
;
-typename: TYPENAME
+type_name: TYPENAME
| INT_KEYWORD
{
$$.stoken.ptr = "int";
{ insert_type (tp_volatile); }
;
-operator: OPERATOR NEW
+oper: OPERATOR NEW
{ $$ = operator_stoken (" new"); }
| OPERATOR DELETE
{ $$ = operator_stoken (" delete"); }
| TYPENAME { $$ = $1.stoken; }
| NAME_OR_INT { $$ = $1.stoken; }
| UNKNOWN_CPP_NAME { $$ = $1.stoken; }
- | operator { $$ = $1; }
+ | oper { $$ = $1; }
;
name_not_typename : NAME
context where only a name could occur, this might be useful.
| NAME_OR_INT
*/
- | operator
+ | oper
{
struct field_of_this_result is_a_field_of_this;
struct token
{
- char *operator;
+ char *oper;
int token;
enum exp_opcode opcode;
enum token_flags flags;
tokstart = lexptr;
/* See if it is a special token of length 3. */
for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
- if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+ if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
{
if ((tokentab3[i].flags & FLAG_CXX) != 0
&& parse_language (par_state)->la_language != language_cplus)
/* See if it is a special token of length 2. */
for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
- if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+ if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
{
if ((tokentab2[i].flags & FLAG_CXX) != 0
&& parse_language (par_state)->la_language != language_cplus)
/* Catch specific keywords. */
copy = copy_name (yylval.sval);
for (i = 0; i < sizeof ident_tokens / sizeof ident_tokens[0]; i++)
- if (strcmp (copy, ident_tokens[i].operator) == 0)
+ if (strcmp (copy, ident_tokens[i].oper) == 0)
{
if ((ident_tokens[i].flags & FLAG_CXX) != 0
&& parse_language (par_state)->la_language != language_cplus)
CORE_ADDR Class = lookup_objc_class (parse_gdbarch (par_state), copy);
if (Class)
{
- yylval.class.class = Class;
+ yylval.theclass.theclass = Class;
sym = lookup_struct_typedef (copy, expression_context_block, 1);
if (sym)
- yylval.class.type = SYMBOL_TYPE (sym);
+ yylval.theclass.type = SYMBOL_TYPE (sym);
return CLASSNAME;
}
}
of *LIST). */
struct cmd_list_element *
-add_cmd (const char *name, enum command_class class, cmd_cfunc_ftype *fun,
+add_cmd (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun,
const char *doc, struct cmd_list_element **list)
{
struct cmd_list_element *c
}
c->name = name;
- c->class = class;
+ c->theclass = theclass;
set_cmd_cfunc (c, fun);
set_cmd_context (c, NULL);
c->doc = doc;
}
struct cmd_list_element *
-add_alias_cmd (const char *name, const char *oldname, enum command_class class,
+add_alias_cmd (const char *name, const char *oldname, enum command_class theclass,
int abbrev_flag, struct cmd_list_element **list)
{
const char *tmp;
return 0;
}
- c = add_cmd (name, class, NULL, old->doc, list);
+ c = add_cmd (name, theclass, NULL, old->doc, list);
/* If OLD->DOC can be freed, we should make another copy. */
if (old->doc_allocated)
containing that list. */
struct cmd_list_element *
-add_prefix_cmd (const char *name, enum command_class class,
+add_prefix_cmd (const char *name, enum command_class theclass,
cmd_cfunc_ftype *fun,
const char *doc, struct cmd_list_element **prefixlist,
const char *prefixname, int allow_unknown,
struct cmd_list_element **list)
{
- struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
+ struct cmd_list_element *c = add_cmd (name, theclass, fun, doc, list);
struct cmd_list_element *p;
c->prefixlist = prefixlist;
/* Like add_prefix_cmd but sets the abbrev_flag on the new command. */
struct cmd_list_element *
-add_abbrev_prefix_cmd (const char *name, enum command_class class,
+add_abbrev_prefix_cmd (const char *name, enum command_class theclass,
cmd_cfunc_ftype *fun, const char *doc,
struct cmd_list_element **prefixlist,
const char *prefixname,
int allow_unknown, struct cmd_list_element **list)
{
- struct cmd_list_element *c = add_cmd (name, class, fun, doc, list);
+ struct cmd_list_element *c = add_cmd (name, theclass, fun, doc, list);
c->prefixlist = prefixlist;
c->prefixname = prefixname;
static struct cmd_list_element *
add_set_or_show_cmd (const char *name,
enum cmd_types type,
- enum command_class class,
+ enum command_class theclass,
var_types var_type,
void *var,
const char *doc,
struct cmd_list_element **list)
{
- struct cmd_list_element *c = add_cmd (name, class, NULL, doc, list);
+ struct cmd_list_element *c = add_cmd (name, theclass, NULL, doc, list);
gdb_assert (type == set_cmd || type == show_cmd);
c->type = type;
static void
add_setshow_cmd_full (const char *name,
- enum command_class class,
+ enum command_class theclass,
var_types var_type, void *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
full_set_doc = xstrdup (set_doc);
full_show_doc = xstrdup (show_doc);
}
- set = add_set_or_show_cmd (name, set_cmd, class, var_type, var,
+ set = add_set_or_show_cmd (name, set_cmd, theclass, var_type, var,
full_set_doc, set_list);
set->doc_allocated = 1;
set_cmd_prefix (set, set_list);
- show = add_set_or_show_cmd (name, show_cmd, class, var_type, var,
+ show = add_set_or_show_cmd (name, show_cmd, theclass, var_type, var,
full_show_doc, show_list);
show->doc_allocated = 1;
show->show_value_func = show_func;
void
add_setshow_enum_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
const char *const *enumlist,
const char **var,
const char *set_doc,
{
struct cmd_list_element *c;
- add_setshow_cmd_full (name, class, var_enum, var,
+ add_setshow_cmd_full (name, theclass, var_enum, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
string. FUNC is the corresponding callback. */
void
add_setshow_auto_boolean_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
enum auto_boolean *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
{
struct cmd_list_element *c;
- add_setshow_cmd_full (name, class, var_auto_boolean, var,
+ add_setshow_cmd_full (name, theclass, var_auto_boolean, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
-add_setshow_boolean_cmd (const char *name, enum command_class class, int *var,
+add_setshow_boolean_cmd (const char *name, enum command_class theclass, int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
cmd_sfunc_ftype *set_func,
static const char *boolean_enums[] = { "on", "off", NULL };
struct cmd_list_element *c;
- add_setshow_cmd_full (name, class, var_boolean, var,
+ add_setshow_cmd_full (name, theclass, var_boolean, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
/* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */
void
-add_setshow_filename_cmd (const char *name, enum command_class class,
+add_setshow_filename_cmd (const char *name, enum command_class theclass,
char **var,
const char *set_doc, const char *show_doc,
const char *help_doc,
{
struct cmd_list_element *set_result;
- add_setshow_cmd_full (name, class, var_filename, var,
+ add_setshow_cmd_full (name, theclass, var_filename, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
/* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */
void
-add_setshow_string_cmd (const char *name, enum command_class class,
+add_setshow_string_cmd (const char *name, enum command_class theclass,
char **var,
const char *set_doc, const char *show_doc,
const char *help_doc,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list)
{
- add_setshow_cmd_full (name, class, var_string, var,
+ add_setshow_cmd_full (name, theclass, var_string, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
/* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */
struct cmd_list_element *
-add_setshow_string_noescape_cmd (const char *name, enum command_class class,
+add_setshow_string_noescape_cmd (const char *name, enum command_class theclass,
char **var,
const char *set_doc, const char *show_doc,
const char *help_doc,
{
struct cmd_list_element *set_cmd;
- add_setshow_cmd_full (name, class, var_string_noescape, var,
+ add_setshow_cmd_full (name, theclass, var_string_noescape, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
/* Add element named NAME to both the set and show command LISTs (the
list for set/show or some sublist thereof). */
void
-add_setshow_optional_filename_cmd (const char *name, enum command_class class,
+add_setshow_optional_filename_cmd (const char *name, enum command_class theclass,
char **var,
const char *set_doc, const char *show_doc,
const char *help_doc,
{
struct cmd_list_element *set_result;
- add_setshow_cmd_full (name, class, var_optional_filename, var,
+ add_setshow_cmd_full (name, theclass, var_optional_filename, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
value. SET_DOC and SHOW_DOC are the documentation strings. This
function is only used in Python API. Please don't use it elsewhere. */
void
-add_setshow_integer_cmd (const char *name, enum command_class class,
+add_setshow_integer_cmd (const char *name, enum command_class theclass,
int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
{
struct cmd_list_element *set;
- add_setshow_cmd_full (name, class, var_integer, var,
+ add_setshow_cmd_full (name, theclass, var_integer, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
-add_setshow_uinteger_cmd (const char *name, enum command_class class,
+add_setshow_uinteger_cmd (const char *name, enum command_class theclass,
unsigned int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
{
struct cmd_list_element *set;
- add_setshow_cmd_full (name, class, var_uinteger, var,
+ add_setshow_cmd_full (name, theclass, var_uinteger, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
-add_setshow_zinteger_cmd (const char *name, enum command_class class,
+add_setshow_zinteger_cmd (const char *name, enum command_class theclass,
int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list)
{
- add_setshow_cmd_full (name, class, var_zinteger, var,
+ add_setshow_cmd_full (name, theclass, var_zinteger, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
void
add_setshow_zuinteger_unlimited_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
int *var,
const char *set_doc,
const char *show_doc,
{
struct cmd_list_element *set;
- add_setshow_cmd_full (name, class, var_zuinteger_unlimited, var,
+ add_setshow_cmd_full (name, theclass, var_zuinteger_unlimited, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
add_cmd. VAR is address of the variable which will contain the
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
-add_setshow_zuinteger_cmd (const char *name, enum command_class class,
+add_setshow_zuinteger_cmd (const char *name, enum command_class theclass,
unsigned int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list)
{
- add_setshow_cmd_full (name, class, var_zuinteger, var,
+ add_setshow_cmd_full (name, theclass, var_zuinteger, var,
set_doc, show_doc, help_doc,
set_func, show_func,
set_list, show_list,
/* Add an element to the list of commands. */
struct cmd_list_element *
-add_com (const char *name, enum command_class class, cmd_cfunc_ftype *fun,
+add_com (const char *name, enum command_class theclass, cmd_cfunc_ftype *fun,
const char *doc)
{
- return add_cmd (name, class, fun, doc, &cmdlist);
+ return add_cmd (name, theclass, fun, doc, &cmdlist);
}
/* Add an alias or abbreviation command to the list of commands. */
struct cmd_list_element *
-add_com_alias (const char *name, const char *oldname, enum command_class class,
+add_com_alias (const char *name, const char *oldname, enum command_class theclass,
int abbrev_flag)
{
- return add_alias_cmd (name, oldname, class, abbrev_flag, &cmdlist);
+ return add_alias_cmd (name, oldname, theclass, abbrev_flag, &cmdlist);
}
\f
/* Recursively walk the commandlist structures, and print out the
/* If this is a class name, print all of the commands in the class. */
if (c->func == NULL)
- help_list (cmdlist, "", c->class, stream);
+ help_list (cmdlist, "", c->theclass, stream);
if (c->hook_pre || c->hook_post)
fprintf_filtered (stream,
*/
void
help_list (struct cmd_list_element *list, const char *cmdtype,
- enum command_class class, struct ui_file *stream)
+ enum command_class theclass, struct ui_file *stream)
{
int len;
char *cmdtype1, *cmdtype2;
strcpy (cmdtype2 + len - 1, " sub");
}
- if (class == all_classes)
+ if (theclass == all_classes)
fprintf_filtered (stream, "List of classes of %scommands:\n\n", cmdtype2);
else
fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
- help_cmd_list (list, class, cmdtype, (int) class >= 0, stream);
+ help_cmd_list (list, theclass, cmdtype, (int) theclass >= 0, stream);
- if (class == all_classes)
+ if (theclass == all_classes)
{
fprintf_filtered (stream, "\n\
Type \"help%s\" followed by a class name for a list of commands in ",
if (c->func == NULL)
{
fprintf_filtered (stream, "\nCommand class: %s\n\n", c->name);
- help_cmd_list (cmdlist, c->class, "", 1, stream);
+ help_cmd_list (cmdlist, c->theclass, "", 1, stream);
}
}
if (c->abbrev_flag)
continue;
- if (c->class == no_class)
+ if (c->theclass == no_class)
{
if (!seen_unclassified)
{
* is at the low level, not the high-level).
*/
void
-help_cmd_list (struct cmd_list_element *list, enum command_class class,
+help_cmd_list (struct cmd_list_element *list, enum command_class theclass,
const char *prefix, int recurse, struct ui_file *stream)
{
struct cmd_list_element *c;
for (c = list; c; c = c->next)
{
if (c->abbrev_flag == 0
- && (class == all_commands
- || (class == all_classes && c->func == NULL)
- || (class == c->class && c->func != NULL)))
+ && (theclass == all_commands
+ || (theclass == all_classes && c->func == NULL)
+ || (theclass == c->theclass && c->func != NULL)))
{
print_help_for_command (c, prefix, recurse, stream);
}
else if (c->abbrev_flag == 0 && recurse
- && class == class_user && c->prefixlist != NULL)
+ && theclass == class_user && c->prefixlist != NULL)
/* User-defined commands may be subcommands. */
- help_cmd_list (*c->prefixlist, class, c->prefixname,
+ help_cmd_list (*c->prefixlist, theclass, c->prefixname,
recurse, stream);
}
}
int
cli_user_command_p (struct cmd_list_element *cmd)
{
- return (cmd->class == class_user
+ return (cmd->theclass == class_user
&& (cmd->func == do_cfunc || cmd->func == do_sfunc));
}
const char *name;
/* Command class; class values are chosen by application program. */
- enum command_class class;
+ enum command_class theclass;
/* When 1 indicated that this command is deprecated. It may be
removed from gdb's command set in the future. */
{
int q;
- if (c->class == class_user || c->class == class_alias)
+ if (c->theclass == class_user || c->theclass == class_alias)
q = query (_("Redefine command \"%s\"? "), c->name);
else
q = query (_("Really redefine built-in command \"%s\"? "), c->name);
"Type commands for definition of \"%s\".", comfull);
cmds = read_command_lines (tmpbuf, from_tty, 1, 0, 0);
- if (c && c->class == class_user)
+ if (c && c->theclass == class_user)
free_command_lines (&c->user_commands);
newc = add_cmd (comname, class_user, user_defined_command,
- (c && c->class == class_user)
+ (c && c->theclass == class_user)
? c->doc : xstrdup ("User-defined."), list);
newc->user_commands = cmds;
tem = comname;
c = lookup_cmd (&tem, *list, "", 0, 1);
- if (c->class != class_user)
+ if (c->theclass != class_user)
error (_("Command \"%s\" is built-in."), comfull);
xsnprintf (tmpbuf, sizeof (tmpbuf), "Type documentation for \"%s\".",
const char *prefixname = c->prefixname;
for (c = *c->prefixlist; c != NULL; c = c->next)
- if (c->class == class_user || c->prefixlist != NULL)
+ if (c->theclass == class_user || c->prefixlist != NULL)
show_user_1 (c, prefixname, c->name, gdb_stdout);
return;
}
if (param_changed == 0)
return 0;
- if (c->class == class_maintenance || c->class == class_deprecated
- || c->class == class_obscure)
+ if (c->theclass == class_maintenance || c->theclass == class_deprecated
+ || c->theclass == class_obscure)
return 0;
return 1;
{
case var_string:
{
- char *new;
+ char *newobj;
const char *p;
char *q;
int ch;
if (arg == NULL)
arg = "";
- new = (char *) xmalloc (strlen (arg) + 2);
+ newobj = (char *) xmalloc (strlen (arg) + 2);
p = arg;
- q = new;
+ q = newobj;
while ((ch = *p++) != '\000')
{
if (ch == '\\')
*q++ = ' ';
#endif
*q++ = '\0';
- new = (char *) xrealloc (new, q - new);
+ newobj = (char *) xrealloc (newobj, q - newobj);
if (*(char **) c->var == NULL
- || strcmp (*(char **) c->var, new) != 0)
+ || strcmp (*(char **) c->var, newobj) != 0)
{
xfree (*(char **) c->var);
- *(char **) c->var = new;
+ *(char **) c->var = newobj;
option_changed = 1;
}
else
- xfree (new);
+ xfree (newobj);
}
break;
case var_string_noescape:
}
else
{
- if (list->class != no_set_class)
+ if (list->theclass != no_set_class)
{
struct cleanup *option_chain
= make_cleanup_ui_out_tuple_begin_end (uiout, "option");
struct objfile *objfile)
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct context_stack *new;
+ struct context_stack *newobj;
struct coff_symbol coff_symbol;
struct coff_symbol *cs = &coff_symbol;
static struct internal_syment main_sym;
context_stack_depth is zero, and complain if not. */
depth = 0;
- new = push_context (depth, fcn_start_addr);
+ newobj = push_context (depth, fcn_start_addr);
fcn_cs_saved.c_name = getsymname (&fcn_sym_saved);
- new->name =
+ newobj->name =
process_coff_symbol (&fcn_cs_saved,
&fcn_aux_saved, objfile);
}
break;
}
- new = pop_context ();
+ newobj = pop_context ();
/* Stack must be empty now. */
- if (context_stack_depth > 0 || new == NULL)
+ if (context_stack_depth > 0 || newobj == NULL)
{
complaint (&symfile_complaints,
_("Unmatched .ef symbol(s) ignored "
enter_linenos (fcn_line_ptr, fcn_first_line,
fcn_last_line, objfile);
- finish_block (new->name, &local_symbols,
- new->old_blocks, new->start_addr,
+ finish_block (newobj->name, &local_symbols,
+ newobj->old_blocks, newobj->start_addr,
fcn_cs_saved.c_value
+ fcn_aux_saved.x_sym.x_misc.x_fsize
+ ANOFFSET (objfile->section_offsets,
break;
}
- new = pop_context ();
- if (depth-- != new->depth)
+ newobj = pop_context ();
+ if (depth-- != newobj->depth)
{
complaint (&symfile_complaints,
_("Mismatched .eb symbol ignored "
cs->c_value + ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT (objfile));
/* Make a block for the local symbols within. */
- finish_block (0, &local_symbols, new->old_blocks,
- new->start_addr, tmpaddr);
+ finish_block (0, &local_symbols, newobj->old_blocks,
+ newobj->start_addr, tmpaddr);
}
/* Now pop locals of block just finished. */
- local_symbols = new->locals;
+ local_symbols = newobj->locals;
}
break;
struct type *type;
struct nextfield *list = 0;
- struct nextfield *new;
+ struct nextfield *newobj;
int nfields = 0;
int n;
char *name;
case C_MOU:
/* Get space to record the next field's data. */
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new->next = list;
- list = new;
+ newobj = (struct nextfield *) alloca (sizeof (struct nextfield));
+ newobj->next = list;
+ list = newobj;
/* Save the data. */
list->field.name = obstack_copy0 (&objfile->objfile_obstack,
case C_FIELD:
/* Get space to record the next field's data. */
- new = (struct nextfield *) alloca (sizeof (struct nextfield));
- new->next = list;
- list = new;
+ newobj = (struct nextfield *) alloca (sizeof (struct nextfield));
+ newobj->next = list;
+ list = newobj;
/* Save the data. */
list->field.name = obstack_copy0 (&objfile->objfile_obstack,
extern show_value_ftype deprecated_show_value_hack;
extern void add_setshow_enum_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
const char *const *enumlist,
const char **var,
const char *set_doc,
struct cmd_list_element **show_list);
extern void add_setshow_auto_boolean_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
enum auto_boolean *var,
const char *set_doc,
const char *show_doc,
struct cmd_list_element **show_list);
extern void add_setshow_boolean_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
struct cmd_list_element **show_list);
extern void add_setshow_filename_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
char **var,
const char *set_doc,
const char *show_doc,
struct cmd_list_element **show_list);
extern void add_setshow_string_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
char **var,
const char *set_doc,
const char *show_doc,
extern struct cmd_list_element *add_setshow_string_noescape_cmd
(const char *name,
- enum command_class class,
+ enum command_class theclass,
char **var,
const char *set_doc,
const char *show_doc,
struct cmd_list_element **show_list);
extern void add_setshow_optional_filename_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
char **var,
const char *set_doc,
const char *show_doc,
struct cmd_list_element **show_list);
extern void add_setshow_integer_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
int *var,
const char *set_doc,
const char *show_doc,
struct cmd_list_element **show_list);
extern void add_setshow_uinteger_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
unsigned int *var,
const char *set_doc,
const char *show_doc,
struct cmd_list_element **show_list);
extern void add_setshow_zinteger_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
int *var,
const char *set_doc,
const char *show_doc,
struct cmd_list_element **show_list);
extern void add_setshow_zuinteger_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
unsigned int *var,
const char *set_doc,
const char *show_doc,
extern void
add_setshow_zuinteger_unlimited_cmd (const char *name,
- enum command_class class,
+ enum command_class theclass,
int *var,
const char *set_doc,
const char *show_doc,
make_my_cleanup2 (struct cleanup **pmy_chain, make_cleanup_ftype *function,
void *arg, void (*free_arg) (void *))
{
- struct cleanup *new
+ struct cleanup *newobj
= (struct cleanup *) xmalloc (sizeof (struct cleanup));
struct cleanup *old_chain = *pmy_chain;
- new->next = *pmy_chain;
- new->function = function;
- new->free_arg = free_arg;
- new->arg = arg;
- *pmy_chain = new;
+ newobj->next = *pmy_chain;
+ newobj->function = function;
+ newobj->free_arg = free_arg;
+ newobj->arg = arg;
+ *pmy_chain = newobj;
gdb_assert (old_chain != NULL);
return old_chain;
/* See filestuff.h. */
int
-gdb_socketpair_cloexec (int namespace, int style, int protocol, int filedes[2])
+gdb_socketpair_cloexec (int domain, int style, int protocol,
+ int filedes[2])
{
#ifdef HAVE_SOCKETPAIR
- int result = socketpair (namespace, style | SOCK_CLOEXEC, protocol, filedes);
+ int result = socketpair (domain, style | SOCK_CLOEXEC, protocol, filedes);
if (result != -1)
{
/* See filestuff.h. */
int
-gdb_socket_cloexec (int namespace, int style, int protocol)
+gdb_socket_cloexec (int domain, int style, int protocol)
{
- int result = socket (namespace, style | SOCK_CLOEXEC, protocol);
+ int result = socket (domain, style | SOCK_CLOEXEC, protocol);
if (result != -1)
socket_mark_cloexec (result);
/* Like 'socketpair', but ensures that the returned file descriptors
have the close-on-exec flag set. */
-extern int gdb_socketpair_cloexec (int namespace, int style, int protocol,
+extern int gdb_socketpair_cloexec (int domain, int style, int protocol,
int filedes[2]);
/* Like 'socket', but ensures that the returned file descriptor has
the close-on-exec flag set. */
-extern int gdb_socket_cloexec (int namespace, int style, int protocol);
+extern int gdb_socket_cloexec (int domain, int style, int protocol);
/* Like 'pipe', but ensures that the returned file descriptors have
the close-on-exec flag set. */
continuation_ftype *function,
void *arg, void (*free_arg) (void *))
{
- struct continuation *new = XNEW (struct continuation);
+ struct continuation *newobj = XNEW (struct continuation);
- new->next = *pmy_chain;
- new->function = function;
- new->free_arg = free_arg;
- new->arg = arg;
- *pmy_chain = new;
+ newobj->next = *pmy_chain;
+ newobj->function = function;
+ newobj->free_arg = free_arg;
+ newobj->arg = arg;
+ *pmy_chain = newobj;
}
static void
const char *opname;
}
-%type <comp> exp exp1 type start start_opt operator colon_name
+%type <comp> exp exp1 type start start_opt oper colon_name
%type <comp> unqualified_name colon_ext_name
-%type <comp> template template_arg
+%type <comp> templ template_arg
%type <comp> builtin_type
%type <comp> typespec_2 array_indicator
%type <comp> colon_ext_only ext_only_name
{ $$ = fill_comp (DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE, $2, $4); }
;
-operator : OPERATOR NEW
+oper : OPERATOR NEW
{
/* Match the whitespacing of cplus_demangle_operators.
It would abort on unrecognized string otherwise. */
/* DEMANGLE_COMPONENT_NAME */
/* This accepts certain invalid placements of '~'. */
-unqualified_name: operator
- | operator '<' template_params '>'
+unqualified_name: oper
+ | oper '<' template_params '>'
{ $$ = fill_comp (DEMANGLE_COMPONENT_TEMPLATE, $1, $3.comp); }
| '~' NAME
{ $$ = make_dtor (gnu_v3_complete_object_dtor, $2); }
name : nested_name NAME %prec NAME
{ $$ = $1.comp; d_right ($1.last) = $2; }
| NAME %prec NAME
- | nested_name template %prec NAME
+ | nested_name templ %prec NAME
{ $$ = $1.comp; d_right ($1.last) = $2; }
- | template %prec NAME
+ | templ %prec NAME
;
colon_ext_name : colon_name
d_left ($$.last) = $2;
d_right ($$.last) = NULL;
}
- | template COLONCOLON
+ | templ COLONCOLON
{ $$.comp = make_empty (DEMANGLE_COMPONENT_QUAL_NAME);
d_left ($$.comp) = $1;
d_right ($$.comp) = NULL;
$$.last = $$.comp;
}
- | nested_name template COLONCOLON
+ | nested_name templ COLONCOLON
{ $$.comp = $1.comp;
d_right ($1.last) = make_empty (DEMANGLE_COMPONENT_QUAL_NAME);
$$.last = d_right ($1.last);
/* DEMANGLE_COMPONENT_TEMPLATE */
/* DEMANGLE_COMPONENT_TEMPLATE_ARGLIST */
-template : NAME '<' template_params '>'
+templ : NAME '<' template_params '>'
{ $$ = fill_comp (DEMANGLE_COMPONENT_TEMPLATE, $1, $3.comp); }
;
struct obstack *obstack)
{
struct using_direct *current;
- struct using_direct *new;
+ struct using_direct *newobj;
/* Has it already been added? */
return;
}
- new = obstack_alloc (obstack, (sizeof (*new)
+ newobj = obstack_alloc (obstack, (sizeof (*newobj)
+ (VEC_length (const_char_ptr, excludes)
- * sizeof (*new->excludes))));
- memset (new, 0, sizeof (*new));
+ * sizeof (*newobj->excludes))));
+ memset (newobj, 0, sizeof (*newobj));
if (copy_names)
{
- new->import_src = obstack_copy0 (obstack, src, strlen (src));
- new->import_dest = obstack_copy0 (obstack, dest, strlen (dest));
+ newobj->import_src = obstack_copy0 (obstack, src, strlen (src));
+ newobj->import_dest = obstack_copy0 (obstack, dest, strlen (dest));
}
else
{
- new->import_src = src;
- new->import_dest = dest;
+ newobj->import_src = src;
+ newobj->import_dest = dest;
}
if (alias != NULL && copy_names)
- new->alias = obstack_copy0 (obstack, alias, strlen (alias));
+ newobj->alias = obstack_copy0 (obstack, alias, strlen (alias));
else
- new->alias = alias;
+ newobj->alias = alias;
if (declaration != NULL && copy_names)
- new->declaration = obstack_copy0 (obstack,
+ newobj->declaration = obstack_copy0 (obstack,
declaration, strlen (declaration));
else
- new->declaration = declaration;
+ newobj->declaration = declaration;
- memcpy (new->excludes, VEC_address (const_char_ptr, excludes),
- VEC_length (const_char_ptr, excludes) * sizeof (*new->excludes));
- new->excludes[VEC_length (const_char_ptr, excludes)] = NULL;
+ memcpy (newobj->excludes, VEC_address (const_char_ptr, excludes),
+ VEC_length (const_char_ptr, excludes) * sizeof (*newobj->excludes));
+ newobj->excludes[VEC_length (const_char_ptr, excludes)] = NULL;
- new->next = using_directives;
- using_directives = new;
+ newobj->next = using_directives;
+ using_directives = newobj;
}
/* Test whether or not NAMESPACE looks like it mentions an anonymous
if (search)
{
- struct symbol *this;
+ struct symbol *lang_this;
struct type *type;
- this = lookup_language_this (language_def (language_cplus), block);
- if (this == NULL)
+ lang_this = lookup_language_this (language_def (language_cplus), block);
+ if (lang_this == NULL)
return NULL;
- type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (this)));
+ type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (lang_this)));
/* If TYPE_NAME is NULL, abandon trying to find this symbol.
This can happen for lambda functions compiled with clang++,
which outputs no name for the container class. */
"this" if we can compute it. */
static struct symbol *
-cp_lookup_symbol_in_namespace (const char *namespace, const char *name,
+cp_lookup_symbol_in_namespace (const char *the_namespace, const char *name,
const struct block *block,
const domain_enum domain, int search)
{
unsigned int prefix_len;
struct symbol *sym;
- if (namespace[0] != '\0')
+ if (the_namespace[0] != '\0')
{
- concatenated_name = alloca (strlen (namespace) + 2
+ concatenated_name = alloca (strlen (the_namespace) + 2
+ strlen (name) + 1);
- strcpy (concatenated_name, namespace);
+ strcpy (concatenated_name, the_namespace);
strcat (concatenated_name, "::");
strcat (concatenated_name, name);
name = concatenated_name;
class/namespace. Since we're only searching static and global blocks
there's often no need to first do that lookup. */
- is_in_anonymous = namespace[0] != '\0' && cp_is_in_anonymous (namespace);
+ is_in_anonymous
+ = the_namespace[0] != '\0' && cp_is_in_anonymous (the_namespace);
sym = cp_basic_lookup_symbol (name, block, domain, is_in_anonymous);
if (sym != NULL)
return sym;
const char *scope,
int scope_len)
{
- char *namespace;
+ char *the_namespace;
if (scope[scope_len] != '\0')
{
if (scope_len == 0 && strchr (name, ':') == NULL)
return cp_lookup_bare_symbol (langdef, name, block, domain, 1);
- namespace = alloca (scope_len + 1);
- strncpy (namespace, scope, scope_len);
- namespace[scope_len] = '\0';
- return cp_lookup_symbol_in_namespace (namespace, name,
+ the_namespace = alloca (scope_len + 1);
+ strncpy (the_namespace, scope, scope_len);
+ the_namespace[scope_len] = '\0';
+ return cp_lookup_symbol_in_namespace (the_namespace, name,
block, domain, 1);
}
const char *oload_name);
static void make_symbol_overload_list_using (const char *func_name,
- const char *namespace);
+ const char *the_namespace);
static void make_symbol_overload_list_qualified (const char *func_name);
{
if (d_left (comp)->type == DEMANGLE_COMPONENT_NAME)
{
- struct demangle_component new;
+ struct demangle_component newobj;
ui_file_write (buf, d_left (comp)->u.s_name.s,
d_left (comp)->u.s_name.len);
name = ui_file_obsavestring (buf, &info->obstack, &len);
- new.type = DEMANGLE_COMPONENT_NAME;
- new.u.s_name.s = name;
- new.u.s_name.len = len;
- if (inspect_type (info, &new, finder, data))
+ newobj.type = DEMANGLE_COMPONENT_NAME;
+ newobj.u.s_name.s = name;
+ newobj.u.s_name.len = len;
+ if (inspect_type (info, &newobj, finder, data))
{
char *n, *s;
long slen;
node. */
ui_file_rewind (buf);
- n = cp_comp_to_string (&new, 100);
+ n = cp_comp_to_string (&newobj, 100);
if (n == NULL)
{
/* If something went astray, abort typedef substitutions. */
struct symbol **
make_symbol_overload_list (const char *func_name,
- const char *namespace)
+ const char *the_namespace)
{
struct cleanup *old_cleanups;
const char *name;
old_cleanups = make_cleanup (xfree, sym_return_val);
- make_symbol_overload_list_using (func_name, namespace);
+ make_symbol_overload_list_using (func_name, the_namespace);
- if (namespace[0] == '\0')
+ if (the_namespace[0] == '\0')
name = func_name;
else
{
char *concatenated_name
- = alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
- strcpy (concatenated_name, namespace);
+ = alloca (strlen (the_namespace) + 2 + strlen (func_name) + 1);
+ strcpy (concatenated_name, the_namespace);
strcat (concatenated_name, "::");
strcat (concatenated_name, func_name);
name = concatenated_name;
static void
make_symbol_overload_list_namespace (const char *func_name,
- const char *namespace)
+ const char *the_namespace)
{
const char *name;
const struct block *block = NULL;
- if (namespace[0] == '\0')
+ if (the_namespace[0] == '\0')
name = func_name;
else
{
char *concatenated_name
- = alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
+ = alloca (strlen (the_namespace) + 2 + strlen (func_name) + 1);
- strcpy (concatenated_name, namespace);
+ strcpy (concatenated_name, the_namespace);
strcat (concatenated_name, "::");
strcat (concatenated_name, func_name);
name = concatenated_name;
make_symbol_overload_list_adl_namespace (struct type *type,
const char *func_name)
{
- char *namespace;
+ char *the_namespace;
const char *type_name;
int i, prefix_len;
if (prefix_len != 0)
{
- namespace = alloca (prefix_len + 1);
- strncpy (namespace, type_name, prefix_len);
- namespace[prefix_len] = '\0';
+ the_namespace = alloca (prefix_len + 1);
+ strncpy (the_namespace, type_name, prefix_len);
+ the_namespace[prefix_len] = '\0';
- make_symbol_overload_list_namespace (func_name, namespace);
+ make_symbol_overload_list_namespace (func_name, the_namespace);
}
/* Check public base type */
static void
make_symbol_overload_list_using (const char *func_name,
- const char *namespace)
+ const char *the_namespace)
{
struct using_direct *current;
const struct block *block;
if (current->alias != NULL || current->declaration != NULL)
continue;
- if (strcmp (namespace, current->import_dest) == 0)
+ if (strcmp (the_namespace, current->import_dest) == 0)
{
/* Mark this import as searched so that the recursive call
does not search it again. */
}
/* Now, add names for this namespace. */
- make_symbol_overload_list_namespace (func_name, namespace);
+ make_symbol_overload_list_namespace (func_name, the_namespace);
}
/* This does the bulk of the work of finding overloaded symbols.
const struct block *block,
const domain_enum domain);
-extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
+extern struct symbol *cp_lookup_symbol_namespace (const char *the_namespace,
const char *name,
const struct block *block,
const domain_enum domain);
int
cp_is_vtbl_ptr_type (struct type *type)
{
- const char *typename = type_name_no_tag (type);
+ const char *type_name = type_name_no_tag (type);
- return (typename != NULL && !strcmp (typename, vtbl_ptr_name));
+ return (type_name != NULL && !strcmp (type_name, vtbl_ptr_name));
}
/* Return truth value for the assertion that TYPE is of the type
struct token
{
- char *operator;
+ char *oper;
int token;
enum exp_opcode opcode;
};
tokstart = lexptr;
/* See if it is a special token of length 3. */
for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
- if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+ if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
{
lexptr += 3;
yylval.opcode = tokentab3[i].opcode;
/* See if it is a special token of length 2. */
for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
- if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+ if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
{
lexptr += 2;
yylval.opcode = tokentab2[i].opcode;
/* Catch specific keywords. */
copy = copy_name (yylval.sval);
for (i = 0; i < sizeof ident_tokens / sizeof ident_tokens[0]; i++)
- if (strcmp (copy, ident_tokens[i].operator) == 0)
+ if (strcmp (copy, ident_tokens[i].oper) == 0)
{
/* It is ok to always set this, even though we don't always
strictly need to. */
{
if (ptid_equal (inferior_ptid, null_ptid))
printf_unfiltered (_("No inferior running\n"));
- return current_inferior ()->private->task;
+ return current_inferior ()->priv->task;
}
if (strcmp (args, "gdb") == 0)
return mach_task_self ();
{
struct inferior *inf = current_inferior ();
- if (port == inf->private->task)
+ if (port == inf->priv->task)
printf_unfiltered (_(" inferior-task"));
- else if (port == inf->private->notify_port)
+ else if (port == inf->priv->notify_port)
printf_unfiltered (_(" inferior-notify"));
else
{
int k;
darwin_thread_t *t;
- for (k = 0; k < inf->private->exception_info.count; k++)
- if (port == inf->private->exception_info.ports[k])
+ for (k = 0; k < inf->priv->exception_info.count; k++)
+ if (port == inf->priv->exception_info.ports[k])
{
printf_unfiltered (_(" inferior-excp-port"));
break;
}
- if (inf->private->threads)
+ if (inf->priv->threads)
{
for (k = 0;
VEC_iterate(darwin_thread_t,
- inf->private->threads, k, t);
+ inf->priv->threads, k, t);
k++)
if (port == t->gdb_port)
{
printf_unfiltered (_(" inferior-thread for 0x%x"),
- inf->private->task);
+ inf->priv->task);
break;
}
}
error (_("Inferior not available"));
inf = current_inferior ();
- darwin_debug_region (inf->private->task, address);
+ darwin_debug_region (inf->priv->task, address);
}
static void
{
if (ptid_equal (inferior_ptid, null_ptid))
printf_unfiltered (_("No inferior running\n"));
- disp_exception (¤t_inferior ()->private->exception_info);
+ disp_exception (¤t_inferior ()->priv->exception_info);
return;
}
else if (strcmp (args, "host") == 0)
inf = current_inferior ();
kret = task_get_exception_ports
- (inf->private->task, EXC_MASK_ALL, info.masks,
+ (inf->priv->task, EXC_MASK_ALL, info.masks,
&info.count, info.ports, info.behaviors, info.flavors);
MACH_CHECK_ERROR (kret);
disp_exception (&info);
unsigned int new_nbr;
unsigned int old_nbr;
unsigned int new_ix, old_ix;
- darwin_inferior *darwin_inf = inf->private;
+ darwin_inferior *darwin_inf = inf->priv;
VEC (darwin_thread_t) *thread_vec;
/* Get list of threads. */
{
tp = find_thread_ptid (ptid_build (inf->pid, 0, 0));
gdb_assert (tp);
- tp->private = pti;
+ tp->priv = pti;
}
VEC_safe_push (darwin_thread_t, thread_vec, pti);
new_ix++;
static int
find_inferior_task_it (struct inferior *inf, void *port_ptr)
{
- return inf->private->task == *(task_t*)port_ptr;
+ return inf->priv->task == *(task_t*)port_ptr;
}
static int
find_inferior_notify_it (struct inferior *inf, void *port_ptr)
{
- return inf->private->notify_port == *(task_t*)port_ptr;
+ return inf->priv->notify_port == *(task_t*)port_ptr;
}
/* Return an inferior by task port. */
int k;
for (k = 0;
- VEC_iterate (darwin_thread_t, inf->private->threads, k, t);
+ VEC_iterate (darwin_thread_t, inf->priv->threads, k, t);
k++)
if (t->gdb_port == thread)
return t;
static void
darwin_suspend_inferior (struct inferior *inf)
{
- if (!inf->private->suspended)
+ if (!inf->priv->suspended)
{
kern_return_t kret;
- kret = task_suspend (inf->private->task);
+ kret = task_suspend (inf->priv->task);
MACH_CHECK_ERROR (kret);
- inf->private->suspended = 1;
+ inf->priv->suspended = 1;
}
}
static void
darwin_resume_inferior (struct inferior *inf)
{
- if (inf->private->suspended)
+ if (inf->priv->suspended)
{
kern_return_t kret;
- kret = task_resume (inf->private->task);
+ kret = task_resume (inf->priv->task);
MACH_CHECK_ERROR (kret);
- inf->private->suspended = 0;
+ inf->priv->suspended = 0;
}
}
MACH_PORT_NULL);
MACH_CHECK_ERROR (kret);
- inf->private->pending_messages--;
+ inf->priv->pending_messages--;
}
static void
int k;
for (k = 0;
- VEC_iterate (darwin_thread_t, inf->private->threads, k, thread);
+ VEC_iterate (darwin_thread_t, inf->priv->threads, k, thread);
k++)
darwin_resume_thread (inf, thread, step, nsignal);
}
int k;
for (k = 0;
- VEC_iterate (darwin_thread_t, inf->private->threads, k, thread);
+ VEC_iterate (darwin_thread_t, inf->priv->threads, k, thread);
k++)
switch (thread->msg_state)
{
}
*pinf = inf;
*pthread = thread;
- inf->private->pending_messages++;
+ inf->priv->pending_messages++;
status->kind = TARGET_WAITKIND_STOPPED;
thread->msg_state = DARWIN_MESSAGE;
inf = darwin_find_inferior_by_notify (hdr->msgh_local_port);
if (inf != NULL)
{
- if (!inf->private->no_ptrace)
+ if (!inf->priv->no_ptrace)
{
pid_t res;
int wstatus;
status->kind = TARGET_WAITKIND_STOPPED;
status->value.sig = GDB_SIGNAL_TRAP;
- thread = VEC_index (darwin_thread_t, inf->private->threads, 0);
+ thread = VEC_index (darwin_thread_t, inf->priv->threads, 0);
thread->msg_state = DARWIN_STOPPED;
return ptid_build (inf->pid, 0, thread->gdb_port);
}
struct inferior *inf = current_inferior ();
/* FIXME: handle in no_ptrace mode. */
- gdb_assert (!inf->private->no_ptrace);
+ gdb_assert (!inf->priv->no_ptrace);
kill (inf->pid, SIGINT);
}
int i;
/* Deallocate threads. */
- if (inf->private->threads)
+ if (inf->priv->threads)
{
int k;
darwin_thread_t *t;
for (k = 0;
- VEC_iterate (darwin_thread_t, inf->private->threads, k, t);
+ VEC_iterate (darwin_thread_t, inf->priv->threads, k, t);
k++)
{
kret = mach_port_deallocate (gdb_task, t->gdb_port);
MACH_CHECK_ERROR (kret);
}
- VEC_free (darwin_thread_t, inf->private->threads);
- inf->private->threads = NULL;
+ VEC_free (darwin_thread_t, inf->priv->threads);
+ inf->priv->threads = NULL;
}
kret = mach_port_move_member (gdb_task,
- inf->private->notify_port, MACH_PORT_NULL);
+ inf->priv->notify_port, MACH_PORT_NULL);
MACH_CHECK_ERROR (kret);
- kret = mach_port_request_notification (gdb_task, inf->private->task,
+ kret = mach_port_request_notification (gdb_task, inf->priv->task,
MACH_NOTIFY_DEAD_NAME, 0,
MACH_PORT_NULL,
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&prev);
/* This can fail if the task is dead. */
inferior_debug (4, "task=0x%x, prev=0x%x, notify_port=0x%x\n",
- inf->private->task, prev, inf->private->notify_port);
+ inf->priv->task, prev, inf->priv->notify_port);
if (kret == KERN_SUCCESS)
{
MACH_CHECK_ERROR (kret);
}
- kret = mach_port_destroy (gdb_task, inf->private->notify_port);
+ kret = mach_port_destroy (gdb_task, inf->priv->notify_port);
MACH_CHECK_ERROR (kret);
/* Deallocate saved exception ports. */
- for (i = 0; i < inf->private->exception_info.count; i++)
+ for (i = 0; i < inf->priv->exception_info.count; i++)
{
kret = mach_port_deallocate
- (gdb_task, inf->private->exception_info.ports[i]);
+ (gdb_task, inf->priv->exception_info.ports[i]);
MACH_CHECK_ERROR (kret);
}
- inf->private->exception_info.count = 0;
+ inf->priv->exception_info.count = 0;
- kret = mach_port_deallocate (gdb_task, inf->private->task);
+ kret = mach_port_deallocate (gdb_task, inf->priv->task);
MACH_CHECK_ERROR (kret);
- xfree (inf->private);
- inf->private = NULL;
+ xfree (inf->priv);
+ inf->priv = NULL;
inf_child_mourn_inferior (ops);
}
darwin_thread_t *t;
for (k = 0;
- VEC_iterate (darwin_thread_t, inf->private->threads, k, t);
+ VEC_iterate (darwin_thread_t, inf->priv->threads, k, t);
k++)
{
if (t->msg_state == DARWIN_MESSAGE)
darwin_reply_to_all_pending_messages (inf);
- if (inf->private->no_ptrace)
+ if (inf->priv->no_ptrace)
return;
res = kill (inf->pid, SIGSTOP);
gdb_assert (inf != NULL);
- kret = darwin_restore_exception_ports (inf->private);
+ kret = darwin_restore_exception_ports (inf->priv);
MACH_CHECK_ERROR (kret);
darwin_reply_to_all_pending_messages (inf);
mach_port_t prev_not;
exception_mask_t mask;
- inf->private = XCNEW (darwin_inferior);
+ inf->priv = XCNEW (darwin_inferior);
- kret = task_for_pid (gdb_task, inf->pid, &inf->private->task);
+ kret = task_for_pid (gdb_task, inf->pid, &inf->priv->task);
if (kret != KERN_SUCCESS)
{
int status;
}
inferior_debug (2, _("inferior task: 0x%x, pid: %d\n"),
- inf->private->task, inf->pid);
+ inf->priv->task, inf->pid);
if (darwin_ex_port == MACH_PORT_NULL)
{
/* Create a port to be notified when the child task terminates. */
kret = mach_port_allocate (gdb_task, MACH_PORT_RIGHT_RECEIVE,
- &inf->private->notify_port);
+ &inf->priv->notify_port);
if (kret != KERN_SUCCESS)
error (_("Unable to create notification port, mach_port_allocate "
"returned: %d"),
kret);
kret = mach_port_move_member (gdb_task,
- inf->private->notify_port, darwin_port_set);
+ inf->priv->notify_port, darwin_port_set);
if (kret != KERN_SUCCESS)
error (_("Unable to move notification port into new port set, "
"mach_port_move_member\n"
"returned: %d"),
kret);
- kret = mach_port_request_notification (gdb_task, inf->private->task,
+ kret = mach_port_request_notification (gdb_task, inf->priv->task,
MACH_NOTIFY_DEAD_NAME, 0,
- inf->private->notify_port,
+ inf->priv->notify_port,
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&prev_not);
if (kret != KERN_SUCCESS)
impact on the debugging session."));
}
- kret = darwin_save_exception_ports (inf->private);
+ kret = darwin_save_exception_ports (inf->priv);
if (kret != KERN_SUCCESS)
error (_("Unable to save exception ports, task_get_exception_ports"
"returned: %d"),
mask = EXC_MASK_ALL;
else
mask = EXC_MASK_SOFTWARE | EXC_MASK_BREAKPOINT;
- kret = task_set_exception_ports (inf->private->task, mask, darwin_ex_port,
+ kret = task_set_exception_ports (inf->priv->task, mask, darwin_ex_port,
EXCEPTION_DEFAULT, THREAD_STATE_NONE);
if (kret != KERN_SUCCESS)
error (_("Unable to set exception ports, task_set_exception_ports"
darwin_check_new_threads (inf);
- gdb_assert (inf->private->threads
- && VEC_length (darwin_thread_t, inf->private->threads) > 0);
- thread = VEC_index (darwin_thread_t, inf->private->threads, 0);
+ gdb_assert (inf->priv->threads
+ && VEC_length (darwin_thread_t, inf->priv->threads) > 0);
+ thread = VEC_index (darwin_thread_t, inf->priv->threads, 0);
/* Note: fork_inferior automatically add a thead but it uses a wrong ptid.
Fix up. */
as well. Otherwise, we'll try resuming it when resuming the
inferior, and get a warning because the thread's suspend count
is already zero, making the resume request useless. */
- thread = VEC_index (darwin_thread_t, inf->private->threads, 0);
+ thread = VEC_index (darwin_thread_t, inf->priv->threads, 0);
kret = thread_suspend (thread->gdb_port);
MACH_CHECK_ERROR (kret);
}
darwin_init_thread_list (inf);
- darwin_check_osabi (inf->private, ptid_get_tid (inferior_ptid));
+ darwin_check_osabi (inf->priv, ptid_get_tid (inferior_ptid));
darwin_setup_fake_stop_event (inf);
- inf->private->no_ptrace = 1;
+ inf->priv->no_ptrace = 1;
}
/* Take a program previously attached to and detaches it.
}
/* If ptrace() is in use, stop the process. */
- if (!inf->private->no_ptrace)
+ if (!inf->priv->no_ptrace)
darwin_stop_inferior (inf);
- kret = darwin_restore_exception_ports (inf->private);
+ kret = darwin_restore_exception_ports (inf->priv);
MACH_CHECK_ERROR (kret);
- if (!inf->private->no_ptrace)
+ if (!inf->priv->no_ptrace)
{
res = PTRACE (PT_DETACH, inf->pid, 0, 0);
if (res != 0)
/* When using ptrace, we have just performed a PT_DETACH, which
resumes the inferior. On the other hand, when we are not using
ptrace, we need to resume its execution ourselves. */
- if (inf->private->no_ptrace)
+ if (inf->priv->no_ptrace)
darwin_resume_inferior (inf);
darwin_mourn_inferior (ops);
{
case TARGET_OBJECT_MEMORY:
{
- int l = darwin_read_write_inferior (inf->private->task, offset,
+ int l = darwin_read_write_inferior (inf->priv->task, offset,
readbuf, writebuf, len);
if (l == 0)
/* Support only read. */
return TARGET_XFER_E_IO;
}
- return darwin_read_dyld_info (inf->private->task, offset, readbuf, len,
+ return darwin_read_dyld_info (inf->priv->task, offset, readbuf, len,
xfered_len);
#endif
default:
mask = EXC_MASK_ALL;
else
{
- darwin_restore_exception_ports (inf->private);
+ darwin_restore_exception_ports (inf->priv);
mask = EXC_MASK_SOFTWARE | EXC_MASK_BREAKPOINT;
}
- kret = task_set_exception_ports (inf->private->task, mask, darwin_ex_port,
+ kret = task_set_exception_ports (inf->priv->task, mask, darwin_ex_port,
EXCEPTION_DEFAULT, THREAD_STATE_NONE);
MACH_CHECK_ERROR (kret);
}
/* First linear search. */
for (k = 0;
- VEC_iterate (darwin_thread_t, inf->private->threads, k, t);
+ VEC_iterate (darwin_thread_t, inf->priv->threads, k, t);
k++)
if (t->inf_port == lwp)
return ptid_build (ptid_get_pid (inferior_ptid), 0, t->gdb_port);
/* Maybe the port was never extract. Do it now. */
/* First get inferior port names. */
- kret = mach_port_names (inf->private->task, &names, &names_count, &types,
+ kret = mach_port_names (inf->priv->task, &names, &names_count, &types,
&types_count);
MACH_CHECK_ERROR (kret);
if (kret != KERN_SUCCESS)
/* We just need to know the corresponding name in gdb name space.
So extract and deallocate the right. */
- kret = mach_port_extract_right (inf->private->task, names[i],
+ kret = mach_port_extract_right (inf->priv->task, names[i],
MACH_MSG_TYPE_COPY_SEND,
&local_name, &local_type);
if (kret != KERN_SUCCESS)
mach_port_deallocate (gdb_task, local_name);
for (k = 0;
- VEC_iterate (darwin_thread_t, inf->private->threads, k, t);
+ VEC_iterate (darwin_thread_t, inf->priv->threads, k, t);
k++)
if (t->gdb_port == local_name)
{
struct objfile *objfile)
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct context_stack *new;
+ struct context_stack *newobj;
/* This remembers the address of the start of a function. It is
used because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries
are relative to the current function's start address. On systems
}
within_function = 0;
- new = pop_context ();
+ newobj = pop_context ();
/* Make a block for the local symbols within. */
- block = finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr, new->start_addr + valu);
+ block = finish_block (newobj->name, &local_symbols,
+ newobj->old_blocks,
+ newobj->start_addr, newobj->start_addr + valu);
/* For C++, set the block's scope. */
- if (SYMBOL_LANGUAGE (new->name) == language_cplus)
- cp_set_block_scope (new->name, block, &objfile->objfile_obstack);
+ if (SYMBOL_LANGUAGE (newobj->name) == language_cplus)
+ cp_set_block_scope (newobj->name, block, &objfile->objfile_obstack);
/* May be switching to an assembler file which may not be using
block relative stabs, so reset the offset. */
break;
}
- new = pop_context ();
- if (desc != new->depth)
+ newobj = pop_context ();
+ if (desc != newobj->depth)
lbrac_mismatch_complaint (symnum);
if (local_symbols != NULL)
_("misplaced N_LBRAC entry; discarding local "
"symbols which have no enclosing block"));
}
- local_symbols = new->locals;
+ local_symbols = newobj->locals;
if (context_stack_depth > 1)
{
/* Muzzle a compiler bug that makes end < start.
??? Which compilers? Is this ever harmful?. */
- if (new->start_addr > valu)
+ if (newobj->start_addr > valu)
{
complaint (&symfile_complaints,
_("block start larger than block end"));
- new->start_addr = valu;
+ newobj->start_addr = valu;
}
/* Make a block for the local symbols within. */
- finish_block (0, &local_symbols, new->old_blocks,
- new->start_addr, valu);
+ finish_block (0, &local_symbols, newobj->old_blocks,
+ newobj->start_addr, valu);
}
}
else
{
struct block *block;
- new = pop_context ();
+ newobj = pop_context ();
/* Make a block for the local symbols within. */
- block = finish_block (new->name, &local_symbols,
- new->old_blocks, new->start_addr,
+ block = finish_block (newobj->name, &local_symbols,
+ newobj->old_blocks, newobj->start_addr,
valu);
/* For C++, set the block's scope. */
- if (SYMBOL_LANGUAGE (new->name) == language_cplus)
- cp_set_block_scope (new->name, block,
+ if (SYMBOL_LANGUAGE (newobj->name) == language_cplus)
+ cp_set_block_scope (newobj->name, block,
&objfile->objfile_obstack);
}
- new = push_context (0, valu);
- new->name = define_symbol (valu, name, desc, type, objfile);
+ newobj = push_context (0, valu);
+ newobj->name = define_symbol (valu, name, desc, type, objfile);
break;
default:
static void
dw2_map_matching_symbols (struct objfile *objfile,
- const char * name, domain_enum namespace,
+ const char * name, domain_enum domain,
int global,
int (*callback) (struct block *,
struct symbol *, void *),
{
struct objfile *objfile = cu->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct context_stack *new;
+ struct context_stack *newobj;
CORE_ADDR lowpc;
CORE_ADDR highpc;
struct die_info *child_die;
}
}
- new = push_context (0, lowpc);
- new->name = new_symbol_full (die, read_type_die (die, cu), cu,
+ newobj = push_context (0, lowpc);
+ newobj->name = new_symbol_full (die, read_type_die (die, cu), cu,
(struct symbol *) templ_func);
/* If there is a location expression for DW_AT_frame_base, record
it. */
attr = dwarf2_attr (die, DW_AT_frame_base, cu);
if (attr)
- dwarf2_symbol_mark_computed (attr, new->name, cu, 1);
+ dwarf2_symbol_mark_computed (attr, newobj->name, cu, 1);
cu->list_in_scope = &local_symbols;
}
}
- new = pop_context ();
+ newobj = pop_context ();
/* Make a block for the local symbols within. */
- block = finish_block (new->name, &local_symbols, new->old_blocks,
+ block = finish_block (newobj->name, &local_symbols, newobj->old_blocks,
lowpc, highpc);
/* For C++, set the block's scope. */
/* If we have address ranges, record them. */
dwarf2_record_block_ranges (die, block, baseaddr, cu);
- gdbarch_make_symbol_special (gdbarch, new->name, objfile);
+ gdbarch_make_symbol_special (gdbarch, newobj->name, objfile);
/* Attach template arguments to function. */
if (! VEC_empty (symbolp, template_args))
a function declares a class that has methods). This means that
when we finish processing a function scope, we may need to go
back to building a containing block's symbol lists. */
- local_symbols = new->locals;
- using_directives = new->using_directives;
+ local_symbols = newobj->locals;
+ using_directives = newobj->using_directives;
/* If we've finished processing a top-level function, subsequent
symbols go in the file symbol list. */
{
struct objfile *objfile = cu->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct context_stack *new;
+ struct context_stack *newobj;
CORE_ADDR lowpc, highpc;
struct die_info *child_die;
CORE_ADDR baseaddr;
child_die = sibling_die (child_die);
}
}
- new = pop_context ();
+ newobj = pop_context ();
if (local_symbols != NULL || using_directives != NULL)
{
struct block *block
- = finish_block (0, &local_symbols, new->old_blocks, new->start_addr,
- highpc);
+ = finish_block (0, &local_symbols, newobj->old_blocks,
+ newobj->start_addr, highpc);
/* Note that recording ranges after traversing children, as we
do here, means that recording a parent's ranges entails
to do. */
dwarf2_record_block_ranges (die, block, baseaddr, cu);
}
- local_symbols = new->locals;
- using_directives = new->using_directives;
+ local_symbols = newobj->locals;
+ using_directives = newobj->using_directives;
}
/* Read in DW_TAG_GNU_call_site and insert it to CU->call_site_htab. */
dwarf2_is_constructor (struct die_info *die, struct dwarf2_cu *cu)
{
const char *fieldname;
- const char *typename;
+ const char *type_name;
int len;
if (die->parent == NULL)
return 0;
fieldname = dwarf2_name (die, cu);
- typename = dwarf2_name (die->parent, cu);
- if (fieldname == NULL || typename == NULL)
+ type_name = dwarf2_name (die->parent, cu);
+ if (fieldname == NULL || type_name == NULL)
return 0;
len = strlen (fieldname);
- return (strncmp (fieldname, typename, len) == 0
- && (typename[len] == '\0' || typename[len] == '<'));
+ return (strncmp (fieldname, type_name, len) == 0
+ && (type_name[len] == '\0' || type_name[len] == '<'));
}
/* Add a member function to the proper fieldlist. */
while (--i >= 0)
{
int len = strlen (e->vector[i]);
- char *new = (char *) xmalloc (len + 1);
+ char *newobj = (char *) xmalloc (len + 1);
- memcpy (new, e->vector[i], len + 1);
- e->vector[i] = new;
+ memcpy (newobj, e->vector[i], len + 1);
+ e->vector[i] = newobj;
}
}
struct token
{
- char *operator;
+ char *oper;
int token;
enum exp_opcode opcode;
};
/* See if it is a special .foo. operator. */
- for (i = 0; dot_ops[i].operator != NULL; i++)
- if (strncmp (tokstart, dot_ops[i].operator,
- strlen (dot_ops[i].operator)) == 0)
+ for (i = 0; dot_ops[i].oper != NULL; i++)
+ if (strncmp (tokstart, dot_ops[i].oper,
+ strlen (dot_ops[i].oper)) == 0)
{
- lexptr += strlen (dot_ops[i].operator);
+ lexptr += strlen (dot_ops[i].oper);
yylval.opcode = dot_ops[i].opcode;
return dot_ops[i].token;
}
/* Catch specific keywords. */
- for (i = 0; f77_keywords[i].operator != NULL; i++)
- if (strlen (f77_keywords[i].operator) == namelen
- && strncmp (tokstart, f77_keywords[i].operator, namelen) == 0)
+ for (i = 0; f77_keywords[i].oper != NULL; i++)
+ if (strlen (f77_keywords[i].oper) == namelen
+ && strncmp (tokstart, f77_keywords[i].oper, namelen) == 0)
{
/* lexptr += strlen(f77_keywords[i].operator); */
yylval.opcode = f77_keywords[i].opcode;
for (frame = get_current_frame (); ; frame = prev_frame)
{
- struct frame_id this = get_frame_id (frame);
+ struct frame_id self = get_frame_id (frame);
- if (frame_id_eq (id, this))
+ if (frame_id_eq (id, self))
/* An exact match. */
return frame;
frame in the current frame chain can have this ID. See the
comment at frame_id_inner for details. */
if (get_frame_type (frame) == NORMAL_FRAME
- && !frame_id_inner (get_frame_arch (frame), id, this)
+ && !frame_id_inner (get_frame_arch (frame), id, self)
&& frame_id_inner (get_frame_arch (prev_frame), id,
get_frame_id (prev_frame)))
return NULL;
if (new_gdbarch->initialized_p)
{
struct gdbarch_list **list;
- struct gdbarch_list *this;
+ struct gdbarch_list *self;
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
"Previous architecture %s (%s) selected\n",
list = &(*list)->next);
/* It had better be in the list of architectures. */
gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
- /* Unlink THIS. */
- this = (*list);
- (*list) = this->next;
- /* Insert THIS at the front. */
- this->next = rego->arches;
- rego->arches = this;
+ /* Unlink SELF. */
+ self = (*list);
+ (*list) = self->next;
+ /* Insert SELF at the front. */
+ self->next = rego->arches;
+ rego->arches = self;
/* Return it. */
return new_gdbarch;
}
/* Insert the new architecture into the front of the architecture
list (keep the list sorted Most Recently Used). */
{
- struct gdbarch_list *this = XNEW (struct gdbarch_list);
- this->next = rego->arches;
- this->gdbarch = new_gdbarch;
- rego->arches = this;
+ struct gdbarch_list *self = XNEW (struct gdbarch_list);
+ self->next = rego->arches;
+ self->gdbarch = new_gdbarch;
+ rego->arches = self;
}
/* Check that the newly installed architecture is valid. Plug in
if (new_gdbarch->initialized_p)
{
struct gdbarch_list **list;
- struct gdbarch_list *this;
+ struct gdbarch_list *self;
if (gdbarch_debug)
fprintf_unfiltered (gdb_stdlog, "gdbarch_find_by_info: "
"Previous architecture %s (%s) selected\n",
list = &(*list)->next);
/* It had better be in the list of architectures. */
gdb_assert ((*list) != NULL && (*list)->gdbarch == new_gdbarch);
- /* Unlink THIS. */
- this = (*list);
- (*list) = this->next;
- /* Insert THIS at the front. */
- this->next = rego->arches;
- rego->arches = this;
+ /* Unlink SELF. */
+ self = (*list);
+ (*list) = self->next;
+ /* Insert SELF at the front. */
+ self->next = rego->arches;
+ rego->arches = self;
/* Return it. */
return new_gdbarch;
}
/* Insert the new architecture into the front of the architecture
list (keep the list sorted Most Recently Used). */
{
- struct gdbarch_list *this = XNEW (struct gdbarch_list);
- this->next = rego->arches;
- this->gdbarch = new_gdbarch;
- rego->arches = this;
+ struct gdbarch_list *self = XNEW (struct gdbarch_list);
+ self->next = rego->arches;
+ self->gdbarch = new_gdbarch;
+ rego->arches = self;
}
/* Check that the newly installed architecture is valid. Plug in
+2015-02-27 Tom Tromey <tromey@redhat.com>
+ Pedro Alves <palves@redhat.com>
+
+ Rename symbols whose names are reserved C++ keywords throughout.
+
2015-02-27 Pedro Alves <palves@redhat.com>
* Makefile.in (COMPILER): New, get it from autoconf.
const struct target_desc *tdesc;
/* Private target data. */
- struct process_info_private *private;
+ struct process_info_private *priv;
};
#define ptid_of(inf) ((inf)->entry.id)
struct process_info *proc;
proc = current_process ();
- return &proc->private->arch_private->debug_reg_state;
+ return &proc->priv->arch_private->debug_reg_state;
}
/* Record the insertion of one breakpoint/watchpoint, as represented
int tid = ptid_get_lwp (ptid);
struct process_info *proc = find_process_pid (ptid_get_pid (ptid));
struct aarch64_debug_reg_state *state
- = &proc->private->arch_private->debug_reg_state;
+ = &proc->priv->arch_private->debug_reg_state;
if (show_debug_regs)
fprintf (stderr, "prepare_to_resume thread %ld\n", lwpid_of (thread));
if (watch)
{
count = arm_linux_get_hw_watchpoint_count ();
- pts = proc->private->arch_private->wpts;
+ pts = proc->priv->arch_private->wpts;
}
else
{
count = arm_linux_get_hw_breakpoint_count ();
- pts = proc->private->arch_private->bpts;
+ pts = proc->priv->arch_private->bpts;
}
for (i = 0; i < count; i++)
if (watch)
{
count = arm_linux_get_hw_watchpoint_count ();
- pts = proc->private->arch_private->wpts;
+ pts = proc->priv->arch_private->wpts;
}
else
{
count = arm_linux_get_hw_breakpoint_count ();
- pts = proc->private->arch_private->bpts;
+ pts = proc->priv->arch_private->bpts;
}
for (i = 0; i < count; i++)
struct thread_info *thread = get_lwp_thread (lwp);
int pid = lwpid_of (thread);
struct process_info *proc = find_process_pid (pid_of (thread));
- struct arch_process_info *proc_info = proc->private->arch_private;
+ struct arch_process_info *proc_info = proc->priv->arch_private;
struct arch_lwp_info *lwp_info = lwp->arch_private;
int i;
struct process_info *proc;
proc = add_process (pid, attached);
- proc->private = xcalloc (1, sizeof (*proc->private));
+ proc->priv = xcalloc (1, sizeof (*proc->priv));
/* Set the arch when the first LWP stops. */
- proc->private->new_inferior = 1;
+ proc->priv->new_inferior = 1;
if (the_low_target.new_process != NULL)
- proc->private->arch_private = the_low_target.new_process ();
+ proc->priv->arch_private = the_low_target.new_process ();
return proc;
}
find_inferior (&all_threads, delete_lwp_callback, process);
/* Freeing all private data. */
- priv = process->private;
+ priv = process->priv;
free (priv->arch_private);
free (priv);
- process->private = NULL;
+ process->priv = NULL;
remove_process (process);
}
is stopped for the first time, but before we access any
inferior registers. */
proc = find_process_pid (pid_of (thread));
- if (proc->private->new_inferior)
+ if (proc->priv->new_inferior)
{
struct thread_info *saved_thread;
current_thread = saved_thread;
- proc->private->new_inferior = 0;
+ proc->priv->new_inferior = 0;
}
}
&& current_thread->last_resume_kind != resume_step
&& (
#if defined (USE_THREAD_DB) && !defined (__ANDROID__)
- (current_process ()->private->thread_db != NULL
+ (current_process ()->priv->thread_db != NULL
&& (WSTOPSIG (w) == __SIGRTMIN
|| WSTOPSIG (w) == __SIGRTMIN + 1))
||
#ifdef USE_THREAD_DB
struct process_info *proc = current_process ();
- if (proc->private->thread_db != NULL)
+ if (proc->priv->thread_db != NULL)
return;
/* If the kernel supports tracing clones, then we don't need to
{
char *document;
unsigned document_len;
- struct process_info_private *const priv = current_process ()->private;
+ struct process_info_private *const priv = current_process ()->priv;
char filename[PATH_MAX];
int pid, is_elf64;
{
ptid_t ptid = ptid_of (get_lwp_thread (lwp));
struct process_info *proc = find_process_pid (ptid_get_pid (ptid));
- struct arch_process_info *private = proc->private->arch_private;
+ struct arch_process_info *priv = proc->priv->arch_private;
if (lwp->arch_private->watch_registers_changed)
{
/* Only update the watch registers if we have set or unset a
watchpoint already. */
- if (mips_linux_watch_get_num_valid (&private->watch_mirror) > 0)
+ if (mips_linux_watch_get_num_valid (&priv->watch_mirror) > 0)
{
/* Write the mirrored watch register values. */
int tid = ptid_get_lwp (ptid);
if (-1 == ptrace (PTRACE_SET_WATCH_REGS, tid,
- &private->watch_mirror))
+ &priv->watch_mirror))
perror_with_name ("Couldn't write watch register");
}
int len, struct raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
- struct arch_process_info *private = proc->private->arch_private;
+ struct arch_process_info *priv = proc->priv->arch_private;
struct pt_watch_regs regs;
struct mips_watchpoint *new_watch;
struct mips_watchpoint **pw;
lwpid = lwpid_of (current_thread);
if (!mips_linux_read_watch_registers (lwpid,
- &private->watch_readback,
- &private->watch_readback_valid,
+ &priv->watch_readback,
+ &priv->watch_readback_valid,
0))
return -1;
if (len <= 0)
return -1;
- regs = private->watch_readback;
+ regs = priv->watch_readback;
/* Add the current watches. */
- mips_linux_watch_populate_regs (private->current_watches, ®s);
+ mips_linux_watch_populate_regs (priv->current_watches, ®s);
/* Now try to add the new watch. */
watch_type = raw_bkpt_type_to_target_hw_bp_type (type);
new_watch->type = watch_type;
new_watch->next = NULL;
- pw = &private->current_watches;
+ pw = &priv->current_watches;
while (*pw != NULL)
pw = &(*pw)->next;
*pw = new_watch;
- private->watch_mirror = regs;
+ priv->watch_mirror = regs;
/* Only update the threads of this process. */
pid = pid_of (proc);
int len, struct raw_breakpoint *bp)
{
struct process_info *proc = current_process ();
- struct arch_process_info *private = proc->private->arch_private;
+ struct arch_process_info *priv = proc->priv->arch_private;
int deleted_one;
int pid;
/* Search for a known watch that matches. Then unlink and free it. */
watch_type = raw_bkpt_type_to_target_hw_bp_type (type);
deleted_one = 0;
- pw = &private->current_watches;
+ pw = &priv->current_watches;
while ((w = *pw))
{
if (w->addr == addr && w->len == len && w->type == watch_type)
/* At this point watch_readback is known to be valid because we
could not have added the watch without reading it. */
- gdb_assert (private->watch_readback_valid == 1);
+ gdb_assert (priv->watch_readback_valid == 1);
- private->watch_mirror = private->watch_readback;
- mips_linux_watch_populate_regs (private->current_watches,
- &private->watch_mirror);
+ priv->watch_mirror = priv->watch_readback;
+ mips_linux_watch_populate_regs (priv->current_watches,
+ &priv->watch_mirror);
/* Only update the threads of this process. */
pid = pid_of (proc);
mips_stopped_by_watchpoint (void)
{
struct process_info *proc = current_process ();
- struct arch_process_info *private = proc->private->arch_private;
+ struct arch_process_info *priv = proc->priv->arch_private;
int n;
int num_valid;
long lwpid = lwpid_of (current_thread);
if (!mips_linux_read_watch_registers (lwpid,
- &private->watch_readback,
- &private->watch_readback_valid,
+ &priv->watch_readback,
+ &priv->watch_readback_valid,
1))
return 0;
- num_valid = mips_linux_watch_get_num_valid (&private->watch_readback);
+ num_valid = mips_linux_watch_get_num_valid (&priv->watch_readback);
for (n = 0; n < MAX_DEBUG_REGISTER && n < num_valid; n++)
- if (mips_linux_watch_get_watchhi (&private->watch_readback, n)
+ if (mips_linux_watch_get_watchhi (&priv->watch_readback, n)
& (R_MASK | W_MASK))
return 1;
mips_stopped_data_address (void)
{
struct process_info *proc = current_process ();
- struct arch_process_info *private = proc->private->arch_private;
+ struct arch_process_info *priv = proc->priv->arch_private;
int n;
int num_valid;
long lwpid = lwpid_of (current_thread);
triggered. */
if (!mips_linux_read_watch_registers (lwpid,
- &private->watch_readback,
- &private->watch_readback_valid,
+ &priv->watch_readback,
+ &priv->watch_readback_valid,
0))
return 0;
- num_valid = mips_linux_watch_get_num_valid (&private->watch_readback);
+ num_valid = mips_linux_watch_get_num_valid (&priv->watch_readback);
for (n = 0; n < MAX_DEBUG_REGISTER && n < num_valid; n++)
- if (mips_linux_watch_get_watchhi (&private->watch_readback, n)
+ if (mips_linux_watch_get_watchhi (&priv->watch_readback, n)
& (R_MASK | W_MASK))
{
CORE_ADDR t_low, t_hi;
int t_irw;
struct mips_watchpoint *watch;
- t_low = mips_linux_watch_get_watchlo (&private->watch_readback, n);
+ t_low = mips_linux_watch_get_watchlo (&priv->watch_readback, n);
t_irw = t_low & IRW_MASK;
- t_hi = (mips_linux_watch_get_watchhi (&private->watch_readback, n)
+ t_hi = (mips_linux_watch_get_watchhi (&priv->watch_readback, n)
| IRW_MASK);
t_low &= ~(CORE_ADDR)t_hi;
- for (watch = private->current_watches;
+ for (watch = priv->current_watches;
watch != NULL;
watch = watch->next)
{
enum target_hw_bp_type hw_type
= raw_bkpt_type_to_target_hw_bp_type (type);
struct x86_debug_reg_state *state
- = &proc->private->arch_private->debug_reg_state;
+ = &proc->priv->arch_private->debug_reg_state;
return x86_dr_insert_watchpoint (state, hw_type, addr, size);
}
enum target_hw_bp_type hw_type
= raw_bkpt_type_to_target_hw_bp_type (type);
struct x86_debug_reg_state *state
- = &proc->private->arch_private->debug_reg_state;
+ = &proc->priv->arch_private->debug_reg_state;
return x86_dr_remove_watchpoint (state, hw_type, addr, size);
}
x86_stopped_by_watchpoint (void)
{
struct process_info *proc = current_process ();
- return x86_dr_stopped_by_watchpoint (&proc->private->arch_private->debug_reg_state);
+ return x86_dr_stopped_by_watchpoint (&proc->priv->arch_private->debug_reg_state);
}
static CORE_ADDR
{
struct process_info *proc = current_process ();
CORE_ADDR addr;
- if (x86_dr_stopped_data_address (&proc->private->arch_private->debug_reg_state,
+ if (x86_dr_stopped_data_address (&proc->priv->arch_private->debug_reg_state,
&addr))
return addr;
return 0;
int pid = ptid_get_pid (ptid);
struct process_info *proc = find_process_pid (pid);
struct x86_debug_reg_state *state
- = &proc->private->arch_private->debug_reg_state;
+ = &proc->priv->arch_private->debug_reg_state;
x86_linux_dr_set (ptid, DR_CONTROL, 0);
proc = add_process (pid, attached);
proc->tdesc = lynx_tdesc;
- proc->private = xcalloc (1, sizeof (*proc->private));
- proc->private->last_wait_event_ptid = null_ptid;
+ proc->priv = xcalloc (1, sizeof (*proc->priv));
+ proc->priv->last_wait_event_ptid = null_ptid;
return proc;
}
unexpected signals (Eg SIG61) when we resume the inferior
using a different thread. */
if (ptid_equal (ptid, minus_one_ptid))
- ptid = current_process()->private->last_wait_event_ptid;
+ ptid = current_process()->priv->last_wait_event_ptid;
/* The ptid might still be minus_one_ptid; this can happen between
the moment we create the inferior or attach to a process, and
ret = lynx_waitpid (pid, &wstat);
new_ptid = lynx_ptid_build (ret, ((union wait *) &wstat)->w_tid);
- find_process_pid (ret)->private->last_wait_event_ptid = new_ptid;
+ find_process_pid (ret)->priv->last_wait_event_ptid = new_ptid;
/* If this is a new thread, then add it now. The reason why we do
this here instead of when handling new-thread events is because
lynx_mourn (struct process_info *proc)
{
/* Free our private data. */
- free (proc->private);
- proc->private = NULL;
+ free (proc->priv);
+ proc->priv = NULL;
clear_inferiors ();
}
td_event_msg_t msg;
td_err_e err;
struct lwp_info *lwp;
- struct thread_db *thread_db = current_process ()->private->thread_db;
+ struct thread_db *thread_db = current_process ()->priv->thread_db;
gdb_assert (thread_db->td_ta_event_getmsg_p != NULL);
td_thr_events_t events;
td_notify_t notify;
td_err_e err;
- struct thread_db *thread_db = current_process ()->private->thread_db;
+ struct thread_db *thread_db = current_process ()->priv->thread_db;
if (thread_db->td_ta_set_event_p == NULL
|| thread_db->td_ta_event_addr_p == NULL
td_err_e err;
struct thread_info *inferior;
struct lwp_info *lwp;
- struct thread_db *thread_db = current_process ()->private->thread_db;
+ struct thread_db *thread_db = current_process ()->priv->thread_db;
int lwpid = ptid_get_lwp (ptid);
inferior = (struct thread_info *) find_inferior_id (&all_threads, ptid);
if (thread_db_use_events)
{
td_err_e err;
- struct thread_db *thread_db = proc->private->thread_db;
+ struct thread_db *thread_db = proc->priv->thread_db;
err = thread_db->td_thr_event_enable_p (th_p, 1);
if (err != TD_OK)
{
td_thrinfo_t ti;
td_err_e err;
- struct thread_db *thread_db = current_process ()->private->thread_db;
+ struct thread_db *thread_db = current_process ()->priv->thread_db;
err = thread_db->td_thr_get_info_p (th_p, &ti);
if (err != TD_OK)
{
td_err_e err;
ptid_t ptid = current_ptid;
- struct thread_db *thread_db = current_process ()->private->thread_db;
+ struct thread_db *thread_db = current_process ()->priv->thread_db;
int loop, iteration;
/* This function is only called when we first initialize thread_db.
static void
thread_db_look_up_symbols (void)
{
- struct thread_db *thread_db = current_process ()->private->thread_db;
+ struct thread_db *thread_db = current_process ()->priv->thread_db;
const char **sym_list;
CORE_ADDR unused;
int
thread_db_look_up_one_symbol (const char *name, CORE_ADDR *addrp)
{
- struct thread_db *thread_db = current_process ()->private->thread_db;
+ struct thread_db *thread_db = current_process ()->priv->thread_db;
int may_ask_gdb = !thread_db->all_symbols_looked_up;
/* If we've passed the call to thread_db_look_up_symbols, then
struct thread_db *thread_db;
proc = get_thread_process (thread);
- thread_db = proc->private->thread_db;
+ thread_db = proc->priv->thread_db;
/* If the thread layer is not (yet) initialized, fail. */
if (thread_db == NULL || !thread_db->all_symbols_looked_up)
struct thread_db *tdb;
struct process_info *proc = current_process ();
- gdb_assert (proc->private->thread_db == NULL);
+ gdb_assert (proc->priv->thread_db == NULL);
tdb = xcalloc (1, sizeof (*tdb));
- proc->private->thread_db = tdb;
+ proc->priv->thread_db = tdb;
tdb->td_ta_new_p = &td_ta_new;
if (debug_threads)
debug_printf ("td_ta_new(): %s\n", thread_db_err_str (err));
free (tdb);
- proc->private->thread_db = NULL;
+ proc->priv->thread_db = NULL;
return 0;
}
struct thread_db *tdb;
struct process_info *proc = current_process ();
- gdb_assert (proc->private->thread_db == NULL);
+ gdb_assert (proc->priv->thread_db == NULL);
tdb = xcalloc (1, sizeof (*tdb));
- proc->private->thread_db = tdb;
+ proc->priv->thread_db = tdb;
tdb->handle = handle;
if (required) \
{ \
free (tdb); \
- proc->private->thread_db = NULL; \
+ proc->priv->thread_db = NULL; \
return 0; \
} \
} \
if (debug_threads)
debug_printf ("td_ta_new(): %s\n", thread_db_err_str (err));
free (tdb);
- proc->private->thread_db = NULL;
+ proc->priv->thread_db = NULL;
return 0;
}
static void
disable_thread_event_reporting (struct process_info *proc)
{
- struct thread_db *thread_db = proc->private->thread_db;
+ struct thread_db *thread_db = proc->priv->thread_db;
if (thread_db)
{
td_err_e (*td_ta_clear_event_p) (const td_thragent_t *ta,
static void
remove_thread_event_breakpoints (struct process_info *proc)
{
- struct thread_db *thread_db = proc->private->thread_db;
+ struct thread_db *thread_db = proc->priv->thread_db;
if (thread_db->td_create_bp != NULL)
{
void
thread_db_detach (struct process_info *proc)
{
- struct thread_db *thread_db = proc->private->thread_db;
+ struct thread_db *thread_db = proc->priv->thread_db;
if (thread_db)
{
void
thread_db_mourn (struct process_info *proc)
{
- struct thread_db *thread_db = proc->private->thread_db;
+ struct thread_db *thread_db = proc->priv->thread_db;
if (thread_db)
{
td_err_e (*td_ta_delete_p) (td_thragent_t *);
#endif /* USE_LIBTHREAD_DB_DIRECTLY */
free (thread_db);
- proc->private->thread_db = NULL;
+ proc->priv->thread_db = NULL;
}
}
struct frame_id initiating_frame;
/* Private data used by the target vector implementation. */
- struct private_thread_info *private;
+ struct private_thread_info *priv;
/* Function that is called to free PRIVATE. If this is NULL, then
xfree will be called on PRIVATE. */
lookup_struct_elt_type (struct type *type, const char *name, int noerr)
{
int i;
- char *typename;
+ char *type_name;
for (;;)
{
if (TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_UNION)
{
- typename = type_to_string (type);
- make_cleanup (xfree, typename);
- error (_("Type %s is not a structure or union type."), typename);
+ type_name = type_to_string (type);
+ make_cleanup (xfree, type_name);
+ error (_("Type %s is not a structure or union type."), type_name);
}
#if 0
I.e. when doing "ptype bell->bar" for "struct foo { int bar; int
foo; } bell;" Disabled by fnf. */
{
- char *typename;
+ char *type_name;
- typename = type_name_no_tag (type);
- if (typename != NULL && strcmp (typename, name) == 0)
+ type_name = type_name_no_tag (type);
+ if (type_name != NULL && strcmp (type_name, name) == 0)
return type;
}
#endif
return NULL;
}
- typename = type_to_string (type);
- make_cleanup (xfree, typename);
- error (_("Type %s has no component named %s."), typename, name);
+ type_name = type_to_string (type);
+ make_cleanup (xfree, type_name);
+ error (_("Type %s has no component named %s."), type_name, name);
}
/* Store in *MAX the largest number representable by unsigned integer type
distance_to_ancestor (A, D, 1) = -1. */
static int
-distance_to_ancestor (struct type *base, struct type *dclass, int public)
+distance_to_ancestor (struct type *base, struct type *dclass, int is_public)
{
int i;
int d;
for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++)
{
- if (public && ! BASETYPE_VIA_PUBLIC (dclass, i))
+ if (is_public && ! BASETYPE_VIA_PUBLIC (dclass, i))
continue;
- d = distance_to_ancestor (base, TYPE_BASECLASS (dclass, i), public);
+ d = distance_to_ancestor (base, TYPE_BASECLASS (dclass, i), is_public);
if (d >= 0)
return 1 + d;
}
struct type_pair
{
- struct type *old, *new;
+ struct type *old, *newobj;
};
static hashval_t
pair.old = type;
slot = htab_find_slot (copied_types, &pair, INSERT);
if (*slot != NULL)
- return ((struct type_pair *) *slot)->new;
+ return ((struct type_pair *) *slot)->newobj;
new_type = alloc_type_arch (get_type_arch (type));
stored
= obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair));
stored->old = type;
- stored->new = new_type;
+ stored->newobj = new_type;
*slot = stored;
/* Copy the common fields of types. For the main type, we simply
struct gdbarch *gdbarch;
struct cleanup *cleanup;
struct value *result;
- char *typename, *canonical;
+ char *type_name, *canonical;
/* We have to handle values a bit trickily here, to allow this code
to work properly with non_lvalue values that are really just
type = make_cv_type (0, 0, type, NULL);
gdbarch = get_type_arch (type);
- typename = type_to_string (type);
- if (typename == NULL)
+ type_name = type_to_string (type);
+ if (type_name == NULL)
error (_("cannot find typeinfo for unnamed type"));
- cleanup = make_cleanup (xfree, typename);
+ cleanup = make_cleanup (xfree, type_name);
/* We need to canonicalize the type name here, because we do lookups
using the demangled name, and so we must match the format it
uses. E.g., GDB tends to use "const char *" as a type name, but
the demangler uses "char const *". */
- canonical = cp_canonicalize_string (typename);
+ canonical = cp_canonicalize_string (type_name);
if (canonical != NULL)
{
make_cleanup (xfree, canonical);
- typename = canonical;
+ type_name = canonical;
}
typeinfo_type = gnuv3_get_typeid_type (gdbarch);
vtable = gnuv3_get_vtable (gdbarch, type, address);
if (vtable == NULL)
- error (_("cannot find typeinfo for object of type '%s'"), typename);
+ error (_("cannot find typeinfo for object of type '%s'"), type_name);
typeinfo_value = value_field (vtable, vtable_field_type_info);
result = value_ind (value_cast (make_pointer_type (typeinfo_type, NULL),
typeinfo_value));
char *sym_name;
struct bound_minimal_symbol minsym;
- sym_name = concat ("typeinfo for ", typename, (char *) NULL);
+ sym_name = concat ("typeinfo for ", type_name, (char *) NULL);
make_cleanup (xfree, sym_name);
minsym = lookup_minimal_symbol (sym_name, NULL, NULL);
if (minsym.minsym == NULL)
- error (_("could not find typeinfo symbol for '%s'"), typename);
+ error (_("could not find typeinfo symbol for '%s'"), type_name);
result = value_at_lazy (typeinfo_type, BMSYMBOL_VALUE_ADDRESS (minsym));
}
static struct type *
gnuv3_get_type_from_type_info (struct value *type_info_ptr)
{
- char *typename;
+ char *type_name;
struct cleanup *cleanup;
struct value *type_val;
struct expression *expr;
struct type *result;
- typename = gnuv3_get_typename_from_type_info (type_info_ptr);
- cleanup = make_cleanup (xfree, typename);
+ type_name = gnuv3_get_typename_from_type_info (type_info_ptr);
+ cleanup = make_cleanup (xfree, type_name);
/* We have to parse the type name, since in general there is not a
symbol for a type. This is somewhat bogus since there may be a
mis-parse. Another approach might be to re-use the demangler's
internal form to reconstruct the type somehow. */
- expr = parse_expression (typename);
+ expr = parse_expression (type_name);
make_cleanup (xfree, expr);
type_val = evaluate_type (expr);
struct token
{
- char *operator;
+ char *oper;
int token;
enum exp_opcode opcode;
};
tokstart = lexptr;
/* See if it is a special token of length 3. */
for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
- if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+ if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
{
lexptr += 3;
yylval.opcode = tokentab3[i].opcode;
/* See if it is a special token of length 2. */
for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
- if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+ if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
{
lexptr += 2;
yylval.opcode = tokentab2[i].opcode;
/* Catch specific keywords. */
copy = copy_name (yylval.sval);
for (i = 0; i < sizeof (ident_tokens) / sizeof (ident_tokens[0]); i++)
- if (strcmp (copy, ident_tokens[i].operator) == 0)
+ if (strcmp (copy, ident_tokens[i].oper) == 0)
{
/* It is ok to always set this, even though we don't always
strictly need to. */
\f
/* scm-utils.c */
-extern void gdbscm_define_variables (const scheme_variable *, int public);
+extern void gdbscm_define_variables (const scheme_variable *, int is_public);
-extern void gdbscm_define_functions (const scheme_function *, int public);
+extern void gdbscm_define_functions (const scheme_function *, int is_public);
extern void gdbscm_define_integer_constants (const scheme_integer_constant *,
- int public);
+ int is_public);
extern void gdbscm_printf (SCM port, const char *format, ...)
ATTRIBUTE_PRINTF (2, 3);
symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- enum address_class class;
+ enum address_class theclass;
- class = SYMBOL_CLASS (symbol);
+ theclass = SYMBOL_CLASS (symbol);
- return scm_from_bool (class == LOC_CONST || class == LOC_CONST_BYTES);
+ return scm_from_bool (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
}
/* (symbol-function? <gdb:symbol>) -> boolean */
symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- enum address_class class;
+ enum address_class theclass;
- class = SYMBOL_CLASS (symbol);
+ theclass = SYMBOL_CLASS (symbol);
- return scm_from_bool (class == LOC_BLOCK);
+ return scm_from_bool (theclass == LOC_BLOCK);
}
/* (symbol-variable? <gdb:symbol>) -> boolean */
symbol_smob *s_smob
= syscm_get_valid_symbol_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
const struct symbol *symbol = s_smob->symbol;
- enum address_class class;
+ enum address_class theclass;
- class = SYMBOL_CLASS (symbol);
+ theclass = SYMBOL_CLASS (symbol);
return scm_from_bool (!SYMBOL_IS_ARGUMENT (symbol)
- && (class == LOC_LOCAL || class == LOC_REGISTER
- || class == LOC_STATIC || class == LOC_COMPUTED
- || class == LOC_OPTIMIZED_OUT));
+ && (theclass == LOC_LOCAL || theclass == LOC_REGISTER
+ || theclass == LOC_STATIC || theclass == LOC_COMPUTED
+ || theclass == LOC_OPTIMIZED_OUT));
}
/* (symbol-needs-frame? <gdb:symbol>) -> boolean
/* Define VARIABLES in the gdb module. */
void
-gdbscm_define_variables (const scheme_variable *variables, int public)
+gdbscm_define_variables (const scheme_variable *variables, int is_public)
{
const scheme_variable *sv;
for (sv = variables; sv->name != NULL; ++sv)
{
scm_c_define (sv->name, sv->value);
- if (public)
+ if (is_public)
scm_c_export (sv->name, NULL);
}
}
/* Define FUNCTIONS in the gdb module. */
void
-gdbscm_define_functions (const scheme_function *functions, int public)
+gdbscm_define_functions (const scheme_function *functions, int is_public)
{
const scheme_function *sf;
scm_set_procedure_property_x (proc, gdbscm_documentation_symbol,
gdbscm_scm_from_c_string (sf->doc_string));
- if (public)
+ if (is_public)
scm_c_export (sf->name, NULL);
}
}
void
gdbscm_define_integer_constants (const scheme_integer_constant *constants,
- int public)
+ int is_public)
{
const scheme_integer_constant *sc;
for (sc = constants; sc->name != NULL; ++sc)
{
scm_c_define (sc->name, scm_from_int (sc->value));
- if (public)
+ if (is_public)
scm_c_export (sc->name, NULL);
}
}
{
unsigned int dummy[HPPA_MAX_INSN_PATTERN_LEN];
int offs = 0;
- int try;
+ int attempt;
/* offsets to try to find the trampoline */
static int pcoffs[] = { 0, 4*4, 5*4 };
/* offsets to the rt_sigframe structure */
e4008200 be,l 0x100(%sr2, %r0), %sr0, %r31
08000240 nop */
- for (try = 0; try < ARRAY_SIZE (pcoffs); try++)
+ for (attempt = 0; attempt < ARRAY_SIZE (pcoffs); attempt++)
{
- if (insns_match_pattern (gdbarch, sp + pcoffs[try],
+ if (insns_match_pattern (gdbarch, sp + pcoffs[attempt],
hppa_sigtramp, dummy))
{
- offs = sfoffs[try];
+ offs = sfoffs[attempt];
break;
}
}
/* sigaltstack case: we have no way of knowing which offset to
use in this case; default to new kernel handling. If this is
wrong the unwinding will fail. */
- try = 2;
- sp = pc - pcoffs[try];
+ attempt = 2;
+ sp = pc - pcoffs[attempt];
}
else
{
bad we cannot include system specific headers :-(.
sizeof(struct siginfo) == 128
offsetof(struct ucontext, uc_mcontext) == 24. */
- return sp + sfoffs[try] + 128 + 24;
+ return sp + sfoffs[attempt] + 128 + 24;
}
struct hppa_linux_sigtramp_unwind_cache
{
gdb_byte bundle[BUNDLE_LEN];
int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER;
- long long template;
+ long long templ;
int val;
/* Warn about slot numbers greater than 2. We used to generate
return 0;
*instr = slotN_contents (bundle, slotnum);
- template = extract_bit_field (bundle, 0, 5);
- *it = template_encoding_table[(int)template][slotnum];
+ templ = extract_bit_field (bundle, 0, 5);
+ *it = template_encoding_table[(int)templ][slotnum];
if (slotnum == 2 || (slotnum == 1 && *it == L))
addr += 16;
int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER, shadow_slotnum;
long long instr_breakpoint;
int val;
- int template;
+ int templ;
struct cleanup *cleanup;
if (slotnum > 2)
a breakpoint on an L-X instruction. */
bp_tgt->shadow_len = BUNDLE_LEN - shadow_slotnum;
- template = extract_bit_field (bundle, 0, 5);
- if (template_encoding_table[template][slotnum] == X)
+ templ = extract_bit_field (bundle, 0, 5);
+ if (template_encoding_table[templ][slotnum] == X)
{
/* X unit types can only be used in slot 2, and are actually
part of a 2-slot L-X instruction. We cannot break at this
gdb_assert (slotnum == 2);
error (_("Can't insert breakpoint for non-existing slot X"));
}
- if (template_encoding_table[template][slotnum] == L)
+ if (template_encoding_table[templ][slotnum] == L)
{
/* L unit types can only be used in slot 1. But the associated
opcode for that instruction is in slot 2, so bump the slot number
int slotnum = (addr & 0x0f) / SLOT_MULTIPLIER, shadow_slotnum;
long long instr_breakpoint, instr_saved;
int val;
- int template;
+ int templ;
struct cleanup *cleanup;
addr &= ~0x0f;
for addressing the SHADOW_CONTENTS placement. */
shadow_slotnum = slotnum;
- template = extract_bit_field (bundle_mem, 0, 5);
- if (template_encoding_table[template][slotnum] == X)
+ templ = extract_bit_field (bundle_mem, 0, 5);
+ if (template_encoding_table[templ][slotnum] == X)
{
/* X unit types can only be used in slot 2, and are actually
part of a 2-slot L-X instruction. We refuse to insert
do_cleanups (cleanup);
return -1;
}
- if (template_encoding_table[template][slotnum] == L)
+ if (template_encoding_table[templ][slotnum] == L)
{
/* L unit types can only be used in slot 1. But the breakpoint
was actually saved using slot 2, so update the slot number
int slotnum = (int) (*pcptr & 0x0f) / SLOT_MULTIPLIER, shadow_slotnum;
long long instr_fetched;
int val;
- int template;
+ int templ;
struct cleanup *cleanup;
if (slotnum > 2)
/* Check for L type instruction in slot 1, if present then bump up the slot
number to the slot 2. */
- template = extract_bit_field (bundle, 0, 5);
- if (template_encoding_table[template][slotnum] == X)
+ templ = extract_bit_field (bundle, 0, 5);
+ if (template_encoding_table[templ][slotnum] == X)
{
gdb_assert (slotnum == 2);
error (_("Can't insert breakpoint for non-existing slot X"));
}
- if (template_encoding_table[template][slotnum] == L)
+ if (template_encoding_table[templ][slotnum] == L)
{
gdb_assert (slotnum == 1);
slotnum = 2;
inf_ttrace_num_lwps_in_syscall = 0;
ti = inferior_thread ();
- ti->private =
+ ti->priv =
xmalloc (sizeof (struct inf_ttrace_private_thread_info));
- memset (ti->private, 0,
+ memset (ti->priv, 0,
sizeof (struct inf_ttrace_private_thread_info));
}
else
/* Add the stopped thread. */
ptid = ptid_build (pid, tts.tts_lwpid, 0);
ti = add_thread (ptid);
- ti->private = xzalloc (sizeof (struct inf_ttrace_private_thread_info));
+ ti->priv = xzalloc (sizeof (struct inf_ttrace_private_thread_info));
inf_ttrace_num_lwps++;
/* We use the "first stopped thread" as the currently active thread. */
ptid = ptid_build (tts.tts_pid, tts.tts_lwpid, 0);
ti = add_thread (ptid);
- ti->private = xzalloc (sizeof (struct inf_ttrace_private_thread_info));
+ ti->priv = xzalloc (sizeof (struct inf_ttrace_private_thread_info));
inf_ttrace_num_lwps++;
}
}
return 0;
lwpid = ptid_get_lwp (info->ptid);
- p = (struct inf_ttrace_private_thread_info *) info->private;
+ p = (struct inf_ttrace_private_thread_info *) info->priv;
/* Check if an lwp that was dying is still there or not. */
if (p->dying && (kill (lwpid, 0) == -1))
if (ttrace (request, pid, lwpid, TT_NOPC, sig, 0) == -1)
{
struct inf_ttrace_private_thread_info *p
- = (struct inf_ttrace_private_thread_info *) info->private;
+ = (struct inf_ttrace_private_thread_info *) info->priv;
if (p->dying && errno == EPROTO)
/* This is expected, it means the dying lwp is really gone
by now. If ttrace had an event to inform the debugger
/* We haven't set the private member on the main thread yet. Do
it now. */
ti = find_thread_ptid (inferior_ptid);
- gdb_assert (ti != NULL && ti->private == NULL);
- ti->private =
+ gdb_assert (ti != NULL && ti->priv == NULL);
+ ti->priv =
xmalloc (sizeof (struct inf_ttrace_private_thread_info));
- memset (ti->private, 0,
+ memset (ti->priv, 0,
sizeof (struct inf_ttrace_private_thread_info));
/* Notify the core that this ptid changed. This changes
lwpid = tts.tts_u.tts_thread.tts_target_lwpid;
ptid = ptid_build (tts.tts_pid, lwpid, 0);
ti = add_thread (ptid);
- ti->private =
+ ti->priv =
xmalloc (sizeof (struct inf_ttrace_private_thread_info));
- memset (ti->private, 0,
+ memset (ti->priv, 0,
sizeof (struct inf_ttrace_private_thread_info));
inf_ttrace_num_lwps++;
ptid = ptid_build (tts.tts_pid, tts.tts_lwpid, 0);
printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (ptid));
ti = find_thread_ptid (ptid);
gdb_assert (ti != NULL);
- ((struct inf_ttrace_private_thread_info *)ti->private)->dying = 1;
+ ((struct inf_ttrace_private_thread_info *)ti->priv)->dying = 1;
inf_ttrace_num_lwps--;
/* Let the thread really exit. */
ttrace (TT_LWP_CONTINUE, ptid_get_pid (ptid),
target_pid_to_str (ptid));
ti = find_thread_ptid (ptid);
gdb_assert (ti != NULL);
- ((struct inf_ttrace_private_thread_info *)ti->private)->dying = 1;
+ ((struct inf_ttrace_private_thread_info *)ti->priv)->dying = 1;
inf_ttrace_num_lwps--;
/* Resume the lwp_terminate-caller thread. */
inf_ttrace_extra_thread_info (struct target_ops *self,
struct thread_info *info)
{
- struct inf_ttrace_private_thread_info* private =
- (struct inf_ttrace_private_thread_info *) info->private;
+ struct inf_ttrace_private_thread_info* priv =
+ (struct inf_ttrace_private_thread_info *) info->priv;
- if (private != NULL && private->dying)
+ if (priv != NULL && priv->dying)
return "Exiting";
return NULL;
xfree (inf->terminal);
free_environ (inf->environment);
target_desc_info_free (inf->tdesc_info);
- xfree (inf->private);
+ xfree (inf->priv);
xfree (inf);
}
struct continuation *continuations;
/* Private data used by the target vector implementation. */
- struct private_inferior *private;
+ struct private_inferior *priv;
/* HAS_EXIT_CODE is true if the inferior exited with an exit code.
In this case, the EXIT_CODE field is also valid. */
static int
compare_block (const struct gdb_block *const old,
- const struct gdb_block *const new)
+ const struct gdb_block *const newobj)
{
if (old == NULL)
return 1;
- if (old->begin < new->begin)
+ if (old->begin < newobj->begin)
return 1;
- else if (old->begin == new->begin)
+ else if (old->begin == newobj->begin)
{
- if (old->end > new->end)
+ if (old->end > newobj->end)
return 1;
else
return 0;
jit_frame_this_id (struct frame_info *this_frame, void **cache,
struct frame_id *this_id)
{
- struct jit_unwind_private private;
+ struct jit_unwind_private priv;
struct gdb_frame_id frame_id;
struct gdb_reader_funcs *funcs;
struct gdb_unwind_callbacks callbacks;
- private.registers = NULL;
- private.this_frame = this_frame;
+ priv.registers = NULL;
+ priv.this_frame = this_frame;
/* We don't expect the frame_id function to set any registers, so we
set reg_set to NULL. */
callbacks.reg_get = jit_unwind_reg_get_impl;
callbacks.reg_set = NULL;
callbacks.target_read = jit_target_read_impl;
- callbacks.priv_data = &private;
+ callbacks.priv_data = &priv;
gdb_assert (loaded_jit_reader);
funcs = loaded_jit_reader->functions;
struct token
{
- char *operator;
+ char *oper;
int token;
enum exp_opcode opcode;
};
tokstart = lexptr;
/* See if it is a special token of length 3. */
for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
- if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
+ if (strncmp (tokstart, tokentab3[i].oper, 3) == 0)
{
lexptr += 3;
yylval.opcode = tokentab3[i].opcode;
/* See if it is a special token of length 2. */
for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
- if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
+ if (strncmp (tokstart, tokentab2[i].oper, 2) == 0)
{
lexptr += 2;
yylval.opcode = tokentab2[i].opcode;
copy_exp (struct expression *expr, int endpos)
{
int len = length_of_subexp (expr, endpos);
- struct expression *new
- = (struct expression *) malloc (sizeof (*new) + EXP_ELEM_TO_BYTES (len));
+ struct expression *newobj
+ = (struct expression *) malloc (sizeof (*newobj) + EXP_ELEM_TO_BYTES (len));
- new->nelts = len;
- memcpy (new->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len));
- new->language_defn = 0;
+ newobj->nelts = len;
+ memcpy (newobj->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len));
+ newobj->language_defn = 0;
- return new;
+ return newobj;
}
/* Insert the expression NEW into the current expression (expout) at POS. */
static void
-insert_exp (struct parser_state *par_state, int pos, struct expression *new)
+insert_exp (struct parser_state *par_state, int pos, struct expression *newobj)
{
- int newlen = new->nelts;
+ int newlen = newobj->nelts;
int i;
/* Grow expout if necessary. In this function's only use at present,
for (i = par_state->expout_ptr - 1; i >= pos; i--)
par_state->expout->elts[i + newlen] = par_state->expout->elts[i];
- memcpy (par_state->expout->elts + pos, new->elts,
+ memcpy (par_state->expout->elts + pos, newobj->elts,
EXP_ELEM_TO_BYTES (newlen));
par_state->expout_ptr += newlen;
}
if (ptid_get_pid (thread->ptid) != pid)
return 0;
- return thread->private != NULL;
+ return thread->priv != NULL;
}
static int
from libthread_db thread state information. */
static void
-update_thread_state (struct private_thread_info *private,
+update_thread_state (struct private_thread_info *priv,
const td_thrinfo_t *ti_p)
{
- private->dying = (ti_p->ti_state == TD_THR_UNKNOWN
- || ti_p->ti_state == TD_THR_ZOMBIE);
+ priv->dying = (ti_p->ti_state == TD_THR_UNKNOWN
+ || ti_p->ti_state == TD_THR_ZOMBIE);
}
/* Attach to a new thread. This function is called when we receive a
tp = find_thread_ptid (ptid);
if (tp != NULL)
{
- /* If tp->private is NULL, then GDB is already attached to this
+ /* If tp->priv is NULL, then GDB is already attached to this
thread, but we do not know anything about it. We can learn
about it here. This can only happen if we have some other
way besides libthread_db to notice new threads (i.e.
PTRACE_EVENT_CLONE); assume the same mechanism notices thread
exit, so this can not be a stale thread recreated with the
same ID. */
- if (tp->private != NULL)
+ if (tp->priv != NULL)
{
- if (!tp->private->dying)
+ if (!tp->priv->dying)
return 0;
delete_thread (ptid);
const td_thrinfo_t *ti_p)
{
td_err_e err;
- struct private_thread_info *private;
+ struct private_thread_info *priv;
int new_thread = (tp == NULL);
/* A thread ID of zero may mean the thread library has not
return;
/* Construct the thread's private data. */
- private = xmalloc (sizeof (struct private_thread_info));
- memset (private, 0, sizeof (struct private_thread_info));
+ priv = xmalloc (sizeof (struct private_thread_info));
+ memset (priv, 0, sizeof (struct private_thread_info));
- private->th = *th_p;
- private->tid = ti_p->ti_tid;
- update_thread_state (private, ti_p);
+ priv->th = *th_p;
+ priv->tid = ti_p->ti_tid;
+ update_thread_state (priv, ti_p);
/* Add the thread to GDB's thread list. */
if (tp == NULL)
- tp = add_thread_with_info (ptid, private);
+ tp = add_thread_with_info (ptid, priv);
else
- tp->private = private;
+ tp->priv = priv;
/* Enable thread event reporting for this thread, except when
debugging a core file. */
something re-uses its thread ID. We'll report the thread exit
when the underlying LWP dies. */
thread_info = find_thread_ptid (ptid);
- gdb_assert (thread_info != NULL && thread_info->private != NULL);
- thread_info->private->dying = 1;
+ gdb_assert (thread_info != NULL && thread_info->priv != NULL);
+ thread_info->priv->dying = 1;
}
static void
ptid = ptid_build (info->pid, ti.ti_lid, 0);
tp = find_thread_ptid (ptid);
- if (tp == NULL || tp->private == NULL)
+ if (tp == NULL || tp->priv == NULL)
{
if (attach_thread (ptid, th_p, &ti))
cb_data->new_threads += 1;
{
/* Need to update this if not using the libthread_db events
(particularly, the TD_DEATH event). */
- update_thread_state (tp->private, &ti);
+ update_thread_state (tp->priv, &ti);
}
return 0;
struct thread_info *thread_info = find_thread_ptid (ptid);
struct target_ops *beneath;
- if (thread_info != NULL && thread_info->private != NULL)
+ if (thread_info != NULL && thread_info->priv != NULL)
{
static char buf[64];
thread_t tid;
- tid = thread_info->private->tid;
+ tid = thread_info->priv->tid;
snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
tid, ptid_get_lwp (ptid));
thread_db_extra_thread_info (struct target_ops *self,
struct thread_info *info)
{
- if (info->private == NULL)
+ if (info->priv == NULL)
return NULL;
- if (info->private->dying)
+ if (info->priv->dying)
return "Exiting";
return NULL;
/* Find the matching thread. */
thread_info = find_thread_ptid (ptid);
- if (thread_info != NULL && thread_info->private != NULL)
+ if (thread_info != NULL && thread_info->priv != NULL)
{
td_err_e err;
psaddr_t address;
/* Note the cast through uintptr_t: this interface only works if
a target address fits in a psaddr_t, which is a host pointer.
So a 32-bit debugger can not access 64-bit TLS through this. */
- err = info->td_thr_tls_get_addr_p (&thread_info->private->th,
+ err = info->td_thr_tls_get_addr_p (&thread_info->priv->th,
(psaddr_t)(uintptr_t) lm,
offset, &address);
}
PR libc/16831 due to GDB PR threads/16954 LOAD_MODULE is also NULL.
The constant number 1 depends on GNU __libc_setup_tls
initialization of l_tls_modid to 1. */
- err = info->td_thr_tlsbase_p (&thread_info->private->th,
+ err = info->td_thr_tlsbase_p (&thread_info->priv->th,
1, &address);
address = (char *) address + offset;
}
int line,
const char *included)
{
- struct macro_source_file *new;
+ struct macro_source_file *newobj;
struct macro_source_file **link;
/* Find the right position in SOURCE's `includes' list for the new
/* At this point, we know that LINE is an unused line number, and
*LINK points to the entry an #inclusion at that line should
precede. */
- new = new_source_file (source->table, included);
- new->included_by = source;
- new->included_at_line = line;
- new->next_included = *link;
- *link = new;
+ newobj = new_source_file (source->table, included);
+ newobj->included_by = source;
+ newobj->included_at_line = line;
+ newobj->next_included = *link;
+ *link = newobj;
- return new;
+ return newobj;
}
static void
push_parse_stack (void)
{
- struct parse_stack *new;
+ struct parse_stack *newobj;
/* Reuse frames if possible. */
if (top_stack && top_stack->prev)
- new = top_stack->prev;
+ newobj = top_stack->prev;
else
- new = (struct parse_stack *) xzalloc (sizeof (struct parse_stack));
+ newobj = (struct parse_stack *) xzalloc (sizeof (struct parse_stack));
/* Initialize new frame with previous content. */
if (top_stack)
{
- struct parse_stack *prev = new->prev;
+ struct parse_stack *prev = newobj->prev;
- *new = *top_stack;
- top_stack->prev = new;
- new->prev = prev;
- new->next = top_stack;
+ *newobj = *top_stack;
+ top_stack->prev = newobj;
+ newobj->prev = prev;
+ newobj->next = top_stack;
}
- top_stack = new;
+ top_stack = newobj;
}
/* Exit a lexical context. */
struct type *t;
struct field *f;
int count = 1;
- enum address_class class;
+ enum address_class theclass;
TIR tir;
long svalue = sh->value;
int bitsize;
break;
case stGlobal: /* External symbol, goes into global block. */
- class = LOC_STATIC;
+ theclass = LOC_STATIC;
b = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (top_stack->cur_st),
GLOBAL_BLOCK);
s = new_symbol (name);
goto data;
case stStatic: /* Static data, goes into current block. */
- class = LOC_STATIC;
+ theclass = LOC_STATIC;
b = top_stack->cur_block;
s = new_symbol (name);
if (SC_IS_COMMON (sh->sc))
s = new_symbol (name);
SYMBOL_VALUE (s) = svalue;
if (sh->sc == scRegister)
- class = mdebug_register_index;
+ theclass = mdebug_register_index;
else
- class = LOC_LOCAL;
+ theclass = LOC_LOCAL;
data: /* Common code for symbols describing data. */
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
- SYMBOL_ACLASS_INDEX (s) = class;
+ SYMBOL_ACLASS_INDEX (s) = theclass;
add_symbol (s, top_stack->cur_st, b);
/* Type could be missing if file is compiled without debugging info. */
for (cur_sdx = 0; cur_sdx < fh->csym;)
{
char *name;
- enum address_class class;
+ enum address_class theclass;
CORE_ADDR minsym_value;
(*swap_sym_in) (cur_bfd,
mst_file_bss,
SECT_OFF_BSS (objfile),
objfile);
- class = LOC_STATIC;
+ theclass = LOC_STATIC;
break;
case stIndirect: /* Irix5 forward declaration */
structs from alpha and mips cc. */
if (sh.iss == 0 || has_opaque_xref (fh, &sh))
goto skip;
- class = LOC_TYPEDEF;
+ theclass = LOC_TYPEDEF;
break;
case stConstant: /* Constant decl */
- class = LOC_CONST;
+ theclass = LOC_CONST;
break;
case stUnion:
}
/* Use this gdb symbol. */
add_psymbol_to_list (name, strlen (name), 1,
- VAR_DOMAIN, class,
+ VAR_DOMAIN, theclass,
&objfile->static_psymbols,
0, sh.value, psymtab_language, objfile);
skip:
PST_PRIVATE (save_pst)->extern_tab = ext_ptr;
for (; --cur_sdx >= 0; ext_ptr++)
{
- enum address_class class;
+ enum address_class theclass;
SYMR *psh;
char *name;
CORE_ADDR svalue;
Ignore them, as parse_external will ignore them too. */
continue;
case stLabel:
- class = LOC_LABEL;
+ theclass = LOC_LABEL;
break;
default:
unknown_ext_complaint (debug_info->ssext + psh->iss);
if (SC_IS_COMMON (psh->sc))
continue;
- class = LOC_STATIC;
+ theclass = LOC_STATIC;
break;
}
name = debug_info->ssext + psh->iss;
add_psymbol_to_list (name, strlen (name), 1,
- VAR_DOMAIN, class,
+ VAR_DOMAIN, theclass,
&objfile->global_psymbols,
0, svalue,
psymtab_language, objfile);
static struct symbol *
mylookup_symbol (char *name, const struct block *block,
- domain_enum domain, enum address_class class)
+ domain_enum domain, enum address_class theclass)
{
struct block_iterator iter;
int inc;
{
if (SYMBOL_LINKAGE_NAME (sym)[0] == inc
&& SYMBOL_DOMAIN (sym) == domain
- && SYMBOL_CLASS (sym) == class
+ && SYMBOL_CLASS (sym) == theclass
&& strcmp (SYMBOL_LINKAGE_NAME (sym), name) == 0)
return sym;
}
block = BLOCK_SUPERBLOCK (block);
if (block)
- return mylookup_symbol (name, block, domain, class);
+ return mylookup_symbol (name, block, domain, theclass);
return 0;
}
/* Allocate a new memory region, with default settings. */
void
-mem_region_init (struct mem_region *new)
+mem_region_init (struct mem_region *newobj)
{
- memset (new, 0, sizeof (struct mem_region));
- new->enabled_p = 1;
- new->attrib = default_mem_attrib;
+ memset (newobj, 0, sizeof (struct mem_region));
+ newobj->enabled_p = 1;
+ newobj->attrib = default_mem_attrib;
}
/* This function should be called before any command which would
create_mem_region (CORE_ADDR lo, CORE_ADDR hi,
const struct mem_attrib *attrib)
{
- struct mem_region new;
+ struct mem_region newobj;
int i, ix;
/* lo == hi is a useless empty region. */
return;
}
- mem_region_init (&new);
- new.lo = lo;
- new.hi = hi;
+ mem_region_init (&newobj);
+ newobj.lo = lo;
+ newobj.hi = hi;
- ix = VEC_lower_bound (mem_region_s, mem_region_list, &new,
+ ix = VEC_lower_bound (mem_region_s, mem_region_list, &newobj,
mem_region_lessthan);
/* Check for an overlapping memory region. We only need to check
}
}
- new.number = ++mem_number;
- new.attrib = *attrib;
- VEC_safe_insert (mem_region_s, mem_region_list, ix, &new);
+ newobj.number = ++mem_number;
+ newobj.attrib = *attrib;
+ VEC_safe_insert (mem_region_s, mem_region_list, ix, &newobj);
}
/*
static void varobj_update_one (struct varobj *var,
enum print_values print_values,
- int explicit);
+ int is_explicit);
static int mi_print_value_p (struct varobj *var,
enum print_values print_values);
static void
varobj_update_one (struct varobj *var, enum print_values print_values,
- int explicit)
+ int is_explicit)
{
struct ui_out *uiout = current_uiout;
VEC (varobj_update_result) *changes;
varobj_update_result *r;
int i;
- changes = varobj_update (&var, explicit);
+ changes = varobj_update (&var, is_explicit);
for (i = 0; VEC_iterate (varobj_update_result, changes, i, r); ++i)
{
ui_out_field_int (uiout, "has_more",
varobj_has_more (r->varobj, to));
- if (r->new)
+ if (r->newobj)
{
int j;
varobj_p child;
struct cleanup *cleanup;
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "new_children");
- for (j = 0; VEC_iterate (varobj_p, r->new, j, child); ++j)
+ for (j = 0; VEC_iterate (varobj_p, r->newobj, j, child); ++j)
{
struct cleanup *cleanup_child;
}
do_cleanups (cleanup);
- VEC_free (varobj_p, r->new);
- r->new = NULL; /* Paranoia. */
+ VEC_free (varobj_p, r->newobj);
+ r->newobj = NULL; /* Paranoia. */
}
do_cleanups (cleanup);
{
int lo;
int hi;
- int new;
+ int newobj;
struct objfile *objfile;
struct minimal_symbol *msymbol;
struct minimal_symbol *best_symbol = NULL;
{
/* pc is still strictly less than highest address. */
/* Note "new" will always be >= lo. */
- new = (lo + hi) / 2;
- if ((MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[new]) >= pc)
- || (lo == new))
+ newobj = (lo + hi) / 2;
+ if ((MSYMBOL_VALUE_RAW_ADDRESS (&msymbol[newobj]) >= pc)
+ || (lo == newobj))
{
- hi = new;
+ hi = newobj;
}
else
{
- lo = new;
+ lo = newobj;
}
}
struct objfile *objfile)
{
struct obj_section *obj_section;
- struct msym_bunch *new;
+ struct msym_bunch *newobj;
struct minimal_symbol *msymbol;
/* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into
if (msym_bunch_index == BUNCH_SIZE)
{
- new = XCNEW (struct msym_bunch);
+ newobj = XCNEW (struct msym_bunch);
msym_bunch_index = 0;
- new->next = msym_bunch;
- msym_bunch = new;
+ newobj->next = msym_bunch;
+ msym_bunch = newobj;
}
msymbol = &msym_bunch->contents[msym_bunch_index];
MSYMBOL_SET_LANGUAGE (msymbol, language_auto,
int align = addr % max_wp_len;
/* Four (eight on AMD64) is the maximum length a debug register
can watch. */
- int try = (len > max_wp_len ? (max_wp_len - 1) : len - 1);
- int size = size_try_array[try][align];
+ int attempt = (len > max_wp_len ? (max_wp_len - 1) : len - 1);
+ int size = size_try_array[attempt][align];
if (what == WP_COUNT)
{
gdb_assert (newname != NULL);
gdb_assert (new_thread != NULL);
newnamelen = strlen (newname);
- if (!new_thread->private)
+ if (!new_thread->priv)
{
- new_thread->private = xmalloc (offsetof (struct private_thread_info,
+ new_thread->priv = xmalloc (offsetof (struct private_thread_info,
name)
+ newnamelen + 1);
- memcpy (new_thread->private->name, newname, newnamelen + 1);
+ memcpy (new_thread->priv->name, newname, newnamelen + 1);
}
- else if (strcmp (newname, new_thread->private->name) != 0)
+ else if (strcmp (newname, new_thread->priv->name) != 0)
{
/* Reallocate if neccessary. */
- int oldnamelen = strlen (new_thread->private->name);
+ int oldnamelen = strlen (new_thread->priv->name);
if (oldnamelen < newnamelen)
- new_thread->private = xrealloc (new_thread->private,
+ new_thread->priv = xrealloc (new_thread->priv,
offsetof (struct private_thread_info,
name)
+ newnamelen + 1);
- memcpy (new_thread->private->name, newname, newnamelen + 1);
+ memcpy (new_thread->priv->name, newname, newnamelen + 1);
}
}
update_thread_private_data_name (new_thread, tn->name_buf);
- pti = (struct private_thread_info *) new_thread->private;
+ pti = (struct private_thread_info *) new_thread->priv;
pti->tid = tid;
pti->state = state;
pti->flags = flags;
char *
nto_extra_thread_info (struct target_ops *self, struct thread_info *ti)
{
- if (ti && ti->private
- && ti->private->state < ARRAY_SIZE (nto_thread_state_str))
- return (char *)nto_thread_state_str [ti->private->state];
+ if (ti && ti->priv
+ && ti->priv->state < ARRAY_SIZE (nto_thread_state_str))
+ return (char *)nto_thread_state_str [ti->priv->state];
return "";
}
struct objc_super {
CORE_ADDR receiver;
- CORE_ADDR class;
+ CORE_ADDR theclass;
};
struct objc_method {
void
start_msglist(void)
{
- struct selname *new =
+ struct selname *newobj =
(struct selname *) xmalloc (sizeof (struct selname));
- new->next = selname_chain;
- new->msglist_len = msglist_len;
- new->msglist_sel = msglist_sel;
+ newobj->next = selname_chain;
+ newobj->msglist_len = msglist_len;
+ newobj->msglist_sel = msglist_sel;
msglist_len = 0;
msglist_sel = (char *)xmalloc(1);
*msglist_sel = 0;
- selname_chain = new;
+ selname_chain = newobj;
}
void
}
static char *
-parse_method (char *method, char *type, char **class,
+parse_method (char *method, char *type, char **theclass,
char **category, char **selector)
{
char *s1 = NULL;
char *nselector = NULL;
gdb_assert (type != NULL);
- gdb_assert (class != NULL);
+ gdb_assert (theclass != NULL);
gdb_assert (category != NULL);
gdb_assert (selector != NULL);
if (type != NULL)
*type = ntype;
- if (class != NULL)
- *class = nclass;
+ if (theclass != NULL)
+ *theclass = nclass;
if (category != NULL)
*category = ncategory;
if (selector != NULL)
}
static void
-find_methods (char type, const char *class, const char *category,
+find_methods (char type, const char *theclass, const char *category,
const char *selector,
VEC (const_char_ptr) **symbol_names)
{
if ((type != '\0') && (ntype != type))
continue;
- if ((class != NULL)
- && ((nclass == NULL) || (strcmp (class, nclass) != 0)))
+ if ((theclass != NULL)
+ && ((nclass == NULL) || (strcmp (theclass, nclass) != 0)))
continue;
if ((category != NULL) &&
find_imps (const char *method, VEC (const_char_ptr) **symbol_names)
{
char type = '\0';
- char *class = NULL;
+ char *theclass = NULL;
char *category = NULL;
char *selector = NULL;
buf = (char *) alloca (strlen (method) + 1);
strcpy (buf, method);
- tmp = parse_method (buf, &type, &class, &category, &selector);
+ tmp = parse_method (buf, &type, &theclass, &category, &selector);
if (tmp == NULL)
{
selector_case = 1;
}
- find_methods (type, class, category, selector, symbol_names);
+ find_methods (type, theclass, category, selector, symbol_names);
/* If we hit the "selector" case, and we found some methods, then
add the selector itself as a symbol, if it exists. */
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
super->receiver = read_memory_unsigned_integer (addr, 4, byte_order);
- super->class = read_memory_unsigned_integer (addr + 4, 4, byte_order);
+ super->theclass = read_memory_unsigned_integer (addr + 4, 4, byte_order);
};
static void
read_objc_class (struct gdbarch *gdbarch, CORE_ADDR addr,
- struct objc_class *class)
+ struct objc_class *theclass)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- class->isa = read_memory_unsigned_integer (addr, 4, byte_order);
- class->super_class = read_memory_unsigned_integer (addr + 4, 4, byte_order);
- class->name = read_memory_unsigned_integer (addr + 8, 4, byte_order);
- class->version = read_memory_unsigned_integer (addr + 12, 4, byte_order);
- class->info = read_memory_unsigned_integer (addr + 16, 4, byte_order);
- class->instance_size = read_memory_unsigned_integer (addr + 18, 4,
+ theclass->isa = read_memory_unsigned_integer (addr, 4, byte_order);
+ theclass->super_class = read_memory_unsigned_integer (addr + 4, 4, byte_order);
+ theclass->name = read_memory_unsigned_integer (addr + 8, 4, byte_order);
+ theclass->version = read_memory_unsigned_integer (addr + 12, 4, byte_order);
+ theclass->info = read_memory_unsigned_integer (addr + 16, 4, byte_order);
+ theclass->instance_size = read_memory_unsigned_integer (addr + 18, 4,
byte_order);
- class->ivars = read_memory_unsigned_integer (addr + 24, 4, byte_order);
- class->methods = read_memory_unsigned_integer (addr + 28, 4, byte_order);
- class->cache = read_memory_unsigned_integer (addr + 32, 4, byte_order);
- class->protocols = read_memory_unsigned_integer (addr + 36, 4, byte_order);
+ theclass->ivars = read_memory_unsigned_integer (addr + 24, 4, byte_order);
+ theclass->methods = read_memory_unsigned_integer (addr + 28, 4, byte_order);
+ theclass->cache = read_memory_unsigned_integer (addr + 32, 4, byte_order);
+ theclass->protocols = read_memory_unsigned_integer (addr + 36, 4, byte_order);
}
static CORE_ADDR
find_implementation_from_class (struct gdbarch *gdbarch,
- CORE_ADDR class, CORE_ADDR sel)
+ CORE_ADDR theclass, CORE_ADDR sel)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- CORE_ADDR subclass = class;
+ CORE_ADDR subclass = theclass;
while (subclass != 0)
{
sel = gdbarch_fetch_pointer_argument (gdbarch, frame, 1, ptr_type);
read_objc_super (gdbarch, super, &sstr);
- if (sstr.class == 0)
+ if (sstr.theclass == 0)
return 0;
- res = find_implementation_from_class (gdbarch, sstr.class, sel);
+ res = find_implementation_from_class (gdbarch, sstr.theclass, sel);
if (new_pc != 0)
*new_pc = res;
if (res == 0)
sel = gdbarch_fetch_pointer_argument (gdbarch, frame, 2, ptr_type);
read_objc_super (gdbarch, super, &sstr);
- if (sstr.class == 0)
+ if (sstr.theclass == 0)
return 0;
- res = find_implementation_from_class (gdbarch, sstr.class, sel);
+ res = find_implementation_from_class (gdbarch, sstr.theclass, sel);
if (new_pc != 0)
*new_pc = res;
if (res == 0)
struct token
{
- char *operator;
+ char *oper;
int token;
enum exp_opcode opcode;
};
/* See if it is a special token of length 3. */
if (explen > 2)
for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
- if (strncasecmp (tokstart, tokentab3[i].operator, 3) == 0
- && (!isalpha (tokentab3[i].operator[0]) || explen == 3
+ if (strncasecmp (tokstart, tokentab3[i].oper, 3) == 0
+ && (!isalpha (tokentab3[i].oper[0]) || explen == 3
|| (!isalpha (tokstart[3])
&& !isdigit (tokstart[3]) && tokstart[3] != '_')))
{
/* See if it is a special token of length 2. */
if (explen > 1)
for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
- if (strncasecmp (tokstart, tokentab2[i].operator, 2) == 0
- && (!isalpha (tokentab2[i].operator[0]) || explen == 2
+ if (strncasecmp (tokstart, tokentab2[i].oper, 2) == 0
+ && (!isalpha (tokentab2[i].oper[0]) || explen == 2
|| (!isalpha (tokstart[2])
&& !isdigit (tokstart[2]) && tokstart[2] != '_')))
{
int
pascal_object_is_vtbl_ptr_type (struct type *type)
{
- const char *typename = type_name_no_tag (type);
+ const char *type_name = type_name_no_tag (type);
- return (typename != NULL
- && strcmp (typename, pascal_vtbl_ptr_name) == 0);
+ return (type_name != NULL
+ && strcmp (type_name, pascal_vtbl_ptr_name) == 0);
}
/* Return truth value for the assertion that TYPE is of the type
void
start_arglist (void)
{
- struct funcall *new;
+ struct funcall *newobj;
- new = (struct funcall *) xmalloc (sizeof (struct funcall));
- new->next = funcall_chain;
- new->arglist_len = arglist_len;
+ newobj = (struct funcall *) xmalloc (sizeof (struct funcall));
+ newobj->next = funcall_chain;
+ newobj->arglist_len = arglist_len;
arglist_len = 0;
- funcall_chain = new;
+ funcall_chain = newobj;
}
/* Return the number of arguments in a function call just terminated,
{
struct stoken stoken;
struct type *type;
- int class;
+ int theclass;
};
typedef struct type *type_ptr;
{
struct format_data fmt;
struct expression *expr;
- struct display *new;
+ struct display *newobj;
int display_it = 1;
const char *exp = arg;
innermost_block = NULL;
expr = parse_expression (exp);
- new = (struct display *) xmalloc (sizeof (struct display));
+ newobj = (struct display *) xmalloc (sizeof (struct display));
- new->exp_string = xstrdup (exp);
- new->exp = expr;
- new->block = innermost_block;
- new->pspace = current_program_space;
- new->next = display_chain;
- new->number = ++display_number;
- new->format = fmt;
- new->enabled_p = 1;
- display_chain = new;
+ newobj->exp_string = xstrdup (exp);
+ newobj->exp = expr;
+ newobj->block = innermost_block;
+ newobj->pspace = current_program_space;
+ newobj->next = display_chain;
+ newobj->number = ++display_number;
+ newobj->format = fmt;
+ newobj->enabled_p = 1;
+ display_chain = newobj;
if (from_tty)
- do_one_display (new);
+ do_one_display (newobj);
dont_repeat ();
}
return ps->fullname;
}
-/* For all symbols, s, in BLOCK that are in NAMESPACE and match NAME
+/* For all symbols, s, in BLOCK that are in DOMAIN and match NAME
according to the function MATCH, call CALLBACK(BLOCK, s, DATA).
BLOCK is assumed to come from OBJFILE. Returns 1 iff CALLBACK
ever returns non-zero, and otherwise returns 0. */
static int
-map_block (const char *name, domain_enum namespace, struct objfile *objfile,
+map_block (const char *name, domain_enum domain, struct objfile *objfile,
struct block *block,
int (*callback) (struct block *, struct symbol *, void *),
void *data, symbol_compare_ftype *match)
sym != NULL; sym = block_iter_match_next (name, match, &iter))
{
if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
- SYMBOL_DOMAIN (sym), namespace))
+ SYMBOL_DOMAIN (sym), domain))
{
if (callback (block, sym, data))
return 1;
static void
psym_map_matching_symbols (struct objfile *objfile,
- const char *name, domain_enum namespace,
+ const char *name, domain_enum domain,
int global,
int (*callback) (struct block *,
struct symbol *, void *),
{
QUIT;
if (ps->readin
- || match_partial_symbol (objfile, ps, global, name, namespace, match,
+ || match_partial_symbol (objfile, ps, global, name, domain, match,
ordered_compare))
{
struct compunit_symtab *cust = psymtab_to_symtab (objfile, ps);
if (cust == NULL)
continue;
block = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), block_kind);
- if (map_block (name, namespace, objfile, block,
+ if (map_block (name, domain, objfile, block,
callback, data, match))
return;
if (callback (block, NULL, data))
struct partial_symbol *psymbol = (struct partial_symbol *) addr;
unsigned int lang = psymbol->ginfo.language;
unsigned int domain = PSYMBOL_DOMAIN (psymbol);
- unsigned int class = PSYMBOL_CLASS (psymbol);
+ unsigned int theclass = PSYMBOL_CLASS (psymbol);
h = hash_continue (&psymbol->ginfo.value, sizeof (psymbol->ginfo.value), h);
h = hash_continue (&lang, sizeof (unsigned int), h);
h = hash_continue (&domain, sizeof (unsigned int), h);
- h = hash_continue (&class, sizeof (unsigned int), h);
+ h = hash_continue (&theclass, sizeof (unsigned int), h);
h = hash_continue (psymbol->ginfo.name, strlen (psymbol->ginfo.name), h);
return h;
static const struct partial_symbol *
add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
domain_enum domain,
- enum address_class class,
+ enum address_class theclass,
long val, /* Value as a long */
CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
enum language language, struct objfile *objfile,
SYMBOL_SECTION (&psymbol) = -1;
SYMBOL_SET_LANGUAGE (&psymbol, language, &objfile->objfile_obstack);
PSYMBOL_DOMAIN (&psymbol) = domain;
- PSYMBOL_CLASS (&psymbol) = class;
+ PSYMBOL_CLASS (&psymbol) = theclass;
SYMBOL_SET_NAMES (&psymbol, name, namelength, copy_name, objfile);
void
add_psymbol_to_list (const char *name, int namelength, int copy_name,
domain_enum domain,
- enum address_class class,
+ enum address_class theclass,
struct psymbol_allocation_list *list,
long val, /* Value as a long */
CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
int added;
/* Stash the partial symbol away in the cache. */
- psym = add_psymbol_to_bcache (name, namelength, copy_name, domain, class,
+ psym = add_psymbol_to_bcache (name, namelength, copy_name, domain, theclass,
val, coreaddr, language, objfile, &added);
/* Do not duplicate global partial symbols. */
sympy_is_constant (PyObject *self, void *closure)
{
struct symbol *symbol = NULL;
- enum address_class class;
+ enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol);
- class = SYMBOL_CLASS (symbol);
+ theclass = SYMBOL_CLASS (symbol);
- return PyBool_FromLong (class == LOC_CONST || class == LOC_CONST_BYTES);
+ return PyBool_FromLong (theclass == LOC_CONST || theclass == LOC_CONST_BYTES);
}
static PyObject *
sympy_is_function (PyObject *self, void *closure)
{
struct symbol *symbol = NULL;
- enum address_class class;
+ enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol);
- class = SYMBOL_CLASS (symbol);
+ theclass = SYMBOL_CLASS (symbol);
- return PyBool_FromLong (class == LOC_BLOCK);
+ return PyBool_FromLong (theclass == LOC_BLOCK);
}
static PyObject *
sympy_is_variable (PyObject *self, void *closure)
{
struct symbol *symbol = NULL;
- enum address_class class;
+ enum address_class theclass;
SYMPY_REQUIRE_VALID (self, symbol);
- class = SYMBOL_CLASS (symbol);
+ theclass = SYMBOL_CLASS (symbol);
return PyBool_FromLong (!SYMBOL_IS_ARGUMENT (symbol)
- && (class == LOC_LOCAL || class == LOC_REGISTER
- || class == LOC_STATIC || class == LOC_COMPUTED
- || class == LOC_OPTIMIZED_OUT));
+ && (theclass == LOC_LOCAL || theclass == LOC_REGISTER
+ || theclass == LOC_STATIC || theclass == LOC_COMPUTED
+ || theclass == LOC_OPTIMIZED_OUT));
}
/* Implementation of gdb.Symbol.needs_frame -> Boolean.
/* unsigned */ int len;
unsigned char *packet;
int cksum;
- int try;
+ int attempt;
len = strlen (s);
if (len > DATA_MAXLEN)
/* We can only have one outstanding data packet, so we just wait for
the acknowledgement here. Keep retransmitting the packet until
we get one, or until we've tried too many times. */
- for (try = 0; try < mips_send_retries; try++)
+ for (attempt = 0; attempt < mips_send_retries; attempt++)
{
int garbage;
int ch;
gdb_assert (info);
- if (!info->private)
+ if (!info->priv)
{
- info->private = xmalloc (sizeof (*(info->private)));
+ info->priv = xmalloc (sizeof (*(info->priv)));
info->private_dtor = free_private_thread_info;
- info->private->core = -1;
- info->private->extra = 0;
+ info->priv->core = -1;
+ info->priv->extra = 0;
}
- return info->private;
+ return info->priv;
}
/* Call this function as a result of
{
struct thread_info *info = find_thread_ptid (tp->ptid);
- if (info && info->private)
- return info->private->extra;
+ if (info && info->priv)
+ return info->priv->extra;
else
return NULL;
}
{
struct thread_info *info = find_thread_ptid (ptid);
- if (info && info->private)
- return info->private->core;
+ if (info && info->priv)
+ return info->priv->core;
return -1;
}
char *file_path;
int errcode;
struct darwin_so_list *dnew;
- struct so_list *new;
+ struct so_list *newobj;
struct cleanup *old_chain;
/* Read image info from inferior. */
/* Create and fill the new so_list element. */
dnew = XCNEW (struct darwin_so_list);
- new = &dnew->sl;
+ newobj = &dnew->sl;
old_chain = make_cleanup (xfree, dnew);
- new->lm_info = &dnew->li;
+ newobj->lm_info = &dnew->li;
- strncpy (new->so_name, file_path, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (new->so_original_name, new->so_name);
+ strncpy (newobj->so_name, file_path, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strcpy (newobj->so_original_name, newobj->so_name);
xfree (file_path);
- new->lm_info->lm_addr = load_addr;
+ newobj->lm_info->lm_addr = load_addr;
if (head == NULL)
- head = new;
+ head = newobj;
else
- tail->next = new;
- tail = new;
+ tail->next = newobj;
+ tail = newobj;
discard_cleanups (old_chain);
}
struct regcache *regcache = get_thread_regcache (ptid);
CORE_ADDR pc = regcache_read_pc (regcache);
struct address_space *aspace = get_regcache_aspace (regcache);
- ia64_insn t0, t1, slot[3], template, insn;
+ ia64_insn t0, t1, slot[3], templ, insn;
int slotnum;
bfd_byte bundle[16];
/* bundles are always in little-endian byte order */
t0 = bfd_getl64 (bundle);
t1 = bfd_getl64 (bundle + 8);
- template = (t0 >> 1) & 0xf;
+ templ = (t0 >> 1) & 0xf;
slot[0] = (t0 >> 5) & 0x1ffffffffffLL;
slot[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18);
slot[2] = (t1 >> 23) & 0x1ffffffffffLL;
- if (template == 2 && slotnum == 1)
+ if (templ == 2 && slotnum == 1)
{
/* skip L slot in MLI template: */
slotnum = 2;
{
struct load_module_desc dll_desc;
char *dll_path;
- struct so_list *new;
+ struct so_list *newobj;
struct cleanup *old_chain;
if (dll_index == 0)
pa64_target_read_memory,
0, dld_cache.load_map);
- new = (struct so_list *) xmalloc (sizeof (struct so_list));
- memset (new, 0, sizeof (struct so_list));
- new->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
- memset (new->lm_info, 0, sizeof (struct lm_info));
+ newobj = (struct so_list *) xmalloc (sizeof (struct so_list));
+ memset (newobj, 0, sizeof (struct so_list));
+ newobj->lm_info = (struct lm_info *) xmalloc (sizeof (struct lm_info));
+ memset (newobj->lm_info, 0, sizeof (struct lm_info));
- strncpy (new->so_name, dll_path, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (new->so_original_name, new->so_name);
+ strncpy (newobj->so_name, dll_path, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strcpy (newobj->so_original_name, newobj->so_name);
- memcpy (&new->lm_info->desc, &dll_desc, sizeof (dll_desc));
+ memcpy (&newobj->lm_info->desc, &dll_desc, sizeof (dll_desc));
#ifdef SOLIB_PA64_DBG
{
- struct load_module_desc *d = &new->lm_info->desc;
+ struct load_module_desc *d = &newobj->lm_info->desc;
- printf ("\n+ library \"%s\" is described at index %d\n", new->so_name,
+ printf ("\n+ library \"%s\" is described at index %d\n", newobj->so_name,
dll_index);
printf (" text_base = %s\n", hex_string (d->text_base));
printf (" text_size = %s\n", hex_string (d->text_size));
#endif
/* Link the new object onto the list. */
- new->next = NULL;
- *link_ptr = new;
- link_ptr = &new->next;
+ newobj->next = NULL;
+ *link_ptr = newobj;
+ link_ptr = &newobj->next;
}
return head;
{
char *namebuf;
CORE_ADDR addr;
- struct so_list *new;
+ struct so_list *newobj;
struct cleanup *old_chain;
int errcode;
struct dld_list dbuf;
gdb_byte tsdbuf[4];
- new = (struct so_list *) xmalloc (sizeof (struct so_list));
- old_chain = make_cleanup (xfree, new);
+ newobj = (struct so_list *) xmalloc (sizeof (struct so_list));
+ old_chain = make_cleanup (xfree, newobj);
- memset (new, 0, sizeof (*new));
- new->lm_info = xmalloc (sizeof (struct lm_info));
- make_cleanup (xfree, new->lm_info);
+ memset (newobj, 0, sizeof (*newobj));
+ newobj->lm_info = xmalloc (sizeof (struct lm_info));
+ make_cleanup (xfree, newobj->lm_info);
read_memory (lm, (gdb_byte *)&dbuf, sizeof (struct dld_list));
safe_strerror (errcode));
else
{
- strncpy (new->so_name, namebuf, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strncpy (newobj->so_name, namebuf, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
xfree (namebuf);
- strcpy (new->so_original_name, new->so_name);
+ strcpy (newobj->so_original_name, newobj->so_name);
}
- if (new->so_name[0] && !match_main (new->so_name))
+ if (newobj->so_name[0] && !match_main (newobj->so_name))
{
- struct lm_info *lmi = new->lm_info;
+ struct lm_info *lmi = newobj->lm_info;
unsigned int tmp;
lmi->lm_addr = lm;
= extract_unsigned_integer (tsdbuf, 4, byte_order);
#ifdef SOLIB_SOM_DBG
- printf ("\n+ library \"%s\" is described at %s\n", new->so_name,
+ printf ("\n+ library \"%s\" is described at %s\n", newobj->so_name,
paddress (target_gdbarch (), lm));
- printf (" 'version' is %d\n", new->lm_info->struct_version);
- printf (" 'bind_mode' is %d\n", new->lm_info->bind_mode);
+ printf (" 'version' is %d\n", newobj->lm_info->struct_version);
+ printf (" 'bind_mode' is %d\n", newobj->lm_info->bind_mode);
printf (" 'library_version' is %d\n",
- new->lm_info->library_version);
+ newobj->lm_info->library_version);
printf (" 'text_addr' is %s\n",
- paddress (target_gdbarch (), new->lm_info->text_addr));
+ paddress (target_gdbarch (), newobj->lm_info->text_addr));
printf (" 'text_link_addr' is %s\n",
- paddress (target_gdbarch (), new->lm_info->text_link_addr));
+ paddress (target_gdbarch (), newobj->lm_info->text_link_addr));
printf (" 'text_end' is %s\n",
- paddress (target_gdbarch (), new->lm_info->text_end));
+ paddress (target_gdbarch (), newobj->lm_info->text_end));
printf (" 'data_start' is %s\n",
- paddress (target_gdbarch (), new->lm_info->data_start));
+ paddress (target_gdbarch (), newobj->lm_info->data_start));
printf (" 'bss_start' is %s\n",
- paddress (target_gdbarch (), new->lm_info->bss_start));
+ paddress (target_gdbarch (), newobj->lm_info->bss_start));
printf (" 'data_end' is %s\n",
- paddress (target_gdbarch (), new->lm_info->data_end));
+ paddress (target_gdbarch (), newobj->lm_info->data_end));
printf (" 'got_value' is %s\n",
- paddress (target_gdbarch (), new->lm_info->got_value));
+ paddress (target_gdbarch (), newobj->lm_info->got_value));
printf (" 'tsd_start_addr' is %s\n",
- paddress (target_gdbarch (), new->lm_info->tsd_start_addr));
+ paddress (target_gdbarch (), newobj->lm_info->tsd_start_addr));
#endif
- new->addr_low = lmi->text_addr;
- new->addr_high = lmi->text_end;
+ newobj->addr_low = lmi->text_addr;
+ newobj->addr_high = lmi->text_end;
/* Link the new object onto the list. */
- new->next = NULL;
- *link_ptr = new;
- link_ptr = &new->next;
+ newobj->next = NULL;
+ *link_ptr = newobj;
+ link_ptr = &newobj->next;
}
else
{
- free_so (new);
+ free_so (newobj);
}
lm = EXTRACT (next);
byte_order);
if (data != 0x0)
{
- struct so_list *new;
+ struct so_list *newobj;
/* Allocate so_list structure. */
- new = XCNEW (struct so_list);
+ newobj = XCNEW (struct so_list);
/* Encode FD and object ID in path name. */
- xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>",
+ xsnprintf (newobj->so_name, sizeof newobj->so_name, "@%s <%d>",
hex_string (data),
SPUADDR_SPU (*ocl_program_addr_base));
- strcpy (new->so_original_name, new->so_name);
+ strcpy (newobj->so_original_name, newobj->so_name);
- *link_ptr = new;
- link_ptr = &new->next;
+ *link_ptr = newobj;
+ link_ptr = &newobj->next;
}
}
if (ex.reason < 0)
for (i = 0; i < size; i += 4)
{
int fd = extract_unsigned_integer (buf + i, 4, byte_order);
- struct so_list *new;
+ struct so_list *newobj;
unsigned long long addr;
char annex[32], id[100];
continue;
/* Allocate so_list structure. */
- new = XCNEW (struct so_list);
+ newobj = XCNEW (struct so_list);
/* Encode FD and object ID in path name. Choose the name so as not
to conflict with any (normal) SVR4 library path name. */
- xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>",
+ xsnprintf (newobj->so_name, sizeof newobj->so_name, "@%s <%d>",
hex_string (addr), fd);
- strcpy (new->so_original_name, new->so_name);
+ strcpy (newobj->so_original_name, newobj->so_name);
- *link_ptr = new;
- link_ptr = &new->next;
+ *link_ptr = newobj;
+ link_ptr = &newobj->next;
}
/* Append OpenCL sos. */
{
struct svr4_info *info;
CORE_ADDR ldsomap;
- struct so_list *new;
+ struct so_list *newobj;
struct cleanup *old_chain;
CORE_ADDR name_lm;
if (!ldsomap)
return 0;
- new = XCNEW (struct so_list);
- old_chain = make_cleanup (xfree, new);
- new->lm_info = lm_info_read (ldsomap);
- make_cleanup (xfree, new->lm_info);
- name_lm = new->lm_info ? new->lm_info->l_name : 0;
+ newobj = XCNEW (struct so_list);
+ old_chain = make_cleanup (xfree, newobj);
+ newobj->lm_info = lm_info_read (ldsomap);
+ make_cleanup (xfree, newobj->lm_info);
+ name_lm = newobj->lm_info ? newobj->lm_info->l_name : 0;
do_cleanups (old_chain);
return (name_lm >= vaddr && name_lm < vaddr + size);
while (src != NULL)
{
- struct so_list *new;
+ struct so_list *newobj;
- new = xmalloc (sizeof (struct so_list));
- memcpy (new, src, sizeof (struct so_list));
+ newobj = xmalloc (sizeof (struct so_list));
+ memcpy (newobj, src, sizeof (struct so_list));
- new->lm_info = xmalloc (sizeof (struct lm_info));
- memcpy (new->lm_info, src->lm_info, sizeof (struct lm_info));
+ newobj->lm_info = xmalloc (sizeof (struct lm_info));
+ memcpy (newobj->lm_info, src->lm_info, sizeof (struct lm_info));
- new->next = NULL;
- *link = new;
- link = &new->next;
+ newobj->next = NULL;
+ *link = newobj;
+ link = &newobj->next;
src = src->next;
}
svr4_default_sos (void)
{
struct svr4_info *info = get_svr4_info ();
- struct so_list *new;
+ struct so_list *newobj;
if (!info->debug_loader_offset_p)
return NULL;
- new = XCNEW (struct so_list);
+ newobj = XCNEW (struct so_list);
- new->lm_info = xzalloc (sizeof (struct lm_info));
+ newobj->lm_info = xzalloc (sizeof (struct lm_info));
/* Nothing will ever check the other fields if we set l_addr_p. */
- new->lm_info->l_addr = info->debug_loader_offset;
- new->lm_info->l_addr_p = 1;
+ newobj->lm_info->l_addr = info->debug_loader_offset;
+ newobj->lm_info->l_addr_p = 1;
- strncpy (new->so_name, info->debug_loader_name, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (new->so_original_name, new->so_name);
+ strncpy (newobj->so_name, info->debug_loader_name, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strcpy (newobj->so_original_name, newobj->so_name);
- return new;
+ return newobj;
}
/* Read the whole inferior libraries chain starting at address LM.
for (; lm != 0; prev_lm = lm, lm = next_lm)
{
- struct so_list *new;
+ struct so_list *newobj;
struct cleanup *old_chain;
int errcode;
char *buffer;
- new = XCNEW (struct so_list);
- old_chain = make_cleanup_free_so (new);
+ newobj = XCNEW (struct so_list);
+ old_chain = make_cleanup_free_so (newobj);
- new->lm_info = lm_info_read (lm);
- if (new->lm_info == NULL)
+ newobj->lm_info = lm_info_read (lm);
+ if (newobj->lm_info == NULL)
{
do_cleanups (old_chain);
return 0;
}
- next_lm = new->lm_info->l_next;
+ next_lm = newobj->lm_info->l_next;
- if (new->lm_info->l_prev != prev_lm)
+ if (newobj->lm_info->l_prev != prev_lm)
{
warning (_("Corrupted shared library list: %s != %s"),
paddress (target_gdbarch (), prev_lm),
- paddress (target_gdbarch (), new->lm_info->l_prev));
+ paddress (target_gdbarch (), newobj->lm_info->l_prev));
do_cleanups (old_chain);
return 0;
}
SVR4, it has no name. For others (Solaris 2.3 for example), it
does have a name, so we can no longer use a missing name to
decide when to ignore it. */
- if (ignore_first && new->lm_info->l_prev == 0)
+ if (ignore_first && newobj->lm_info->l_prev == 0)
{
struct svr4_info *info = get_svr4_info ();
- first_l_name = new->lm_info->l_name;
- info->main_lm_addr = new->lm_info->lm_addr;
+ first_l_name = newobj->lm_info->l_name;
+ info->main_lm_addr = newobj->lm_info->lm_addr;
do_cleanups (old_chain);
continue;
}
/* Extract this shared object's name. */
- target_read_string (new->lm_info->l_name, &buffer,
+ target_read_string (newobj->lm_info->l_name, &buffer,
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
{
inferior executable, then this is not a normal shared
object, but (most likely) a vDSO. In this case, silently
skip it; otherwise emit a warning. */
- if (first_l_name == 0 || new->lm_info->l_name != first_l_name)
+ if (first_l_name == 0 || newobj->lm_info->l_name != first_l_name)
warning (_("Can't read pathname for load map: %s."),
safe_strerror (errcode));
do_cleanups (old_chain);
continue;
}
- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- strcpy (new->so_original_name, new->so_name);
+ strncpy (newobj->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ newobj->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ strcpy (newobj->so_original_name, newobj->so_name);
xfree (buffer);
/* If this entry has no name, or its name matches the name
for the main executable, don't include it in the list. */
- if (! new->so_name[0] || match_main (new->so_name))
+ if (! newobj->so_name[0] || match_main (newobj->so_name))
{
do_cleanups (old_chain);
continue;
}
discard_cleanups (old_chain);
- new->next = 0;
- **link_ptr_ptr = new;
- *link_ptr_ptr = &new->next;
+ newobj->next = 0;
+ **link_ptr_ptr = newobj;
+ *link_ptr_ptr = &newobj->next;
}
return 1;
while (**pp && **pp != '#')
{
struct type *arg_type = read_type (pp, objfile);
- struct type_list *new = alloca (sizeof (*new));
- new->type = arg_type;
- new->next = arg_types;
- arg_types = new;
+ struct type_list *newobj = alloca (sizeof (*newobj));
+ newobj->type = arg_type;
+ newobj->next = arg_types;
+ arg_types = newobj;
num_args++;
}
if (**pp == '#')
struct objfile *objfile)
{
char *p;
- struct nextfield *new;
+ struct nextfield *newobj;
/* We better set p right now, in case there are no fields at all... */
{
STABS_CONTINUE (pp, objfile);
/* Get space to record the next field's data. */
- new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
- make_cleanup (xfree, new);
- memset (new, 0, sizeof (struct nextfield));
- new->next = fip->list;
- fip->list = new;
+ newobj = (struct nextfield *) xmalloc (sizeof (struct nextfield));
+ make_cleanup (xfree, newobj);
+ memset (newobj, 0, sizeof (struct nextfield));
+ newobj->next = fip->list;
+ fip->list = newobj;
/* Get the field name. */
p = *pp;
struct objfile *objfile)
{
int i;
- struct nextfield *new;
+ struct nextfield *newobj;
if (**pp != '!')
{
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
- new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
- make_cleanup (xfree, new);
- memset (new, 0, sizeof (struct nextfield));
- new->next = fip->list;
- fip->list = new;
- FIELD_BITSIZE (new->field) = 0; /* This should be an unpacked
+ newobj = (struct nextfield *) xmalloc (sizeof (struct nextfield));
+ make_cleanup (xfree, newobj);
+ memset (newobj, 0, sizeof (struct nextfield));
+ newobj->next = fip->list;
+ fip->list = newobj;
+ FIELD_BITSIZE (newobj->field) = 0; /* This should be an unpacked
field! */
STABS_CONTINUE (pp, objfile);
}
++(*pp);
- new->visibility = *(*pp)++;
- switch (new->visibility)
+ newobj->visibility = *(*pp)++;
+ switch (newobj->visibility)
{
case VISIBILITY_PRIVATE:
case VISIBILITY_PROTECTED:
{
complaint (&symfile_complaints,
_("Unknown visibility `%c' for baseclass"),
- new->visibility);
- new->visibility = VISIBILITY_PUBLIC;
+ newobj->visibility);
+ newobj->visibility = VISIBILITY_PUBLIC;
}
}
corresponding to this baseclass. Always zero in the absence of
multiple inheritance. */
- SET_FIELD_BITPOS (new->field, read_huge_number (pp, ',', &nbits, 0));
+ SET_FIELD_BITPOS (newobj->field, read_huge_number (pp, ',', &nbits, 0));
if (nbits != 0)
return 0;
}
base class. Read it, and remember it's type name as this
field's name. */
- new->field.type = read_type (pp, objfile);
- new->field.name = type_name_no_tag (new->field.type);
+ newobj->field.type = read_type (pp, objfile);
+ newobj->field.name = type_name_no_tag (newobj->field.type);
/* Skip trailing ';' and bump count of number of fields seen. */
if (**pp == ';')
symbol for the common block name for later fixup. */
int i;
struct symbol *sym;
- struct pending *new = 0;
+ struct pending *newobj = 0;
struct pending *next;
int j;
next = next->next)
{
for (j = 0; j < next->nsyms; j++)
- add_symbol_to_list (next->symbol[j], &new);
+ add_symbol_to_list (next->symbol[j], &newobj);
}
/* Copy however much of COMMON_BLOCK we need. If COMMON_BLOCK is
if (common_block != NULL)
for (j = common_block_i; j < common_block->nsyms; j++)
- add_symbol_to_list (common_block->symbol[j], &new);
+ add_symbol_to_list (common_block->symbol[j], &newobj);
- SYMBOL_TYPE (sym) = (struct type *) new;
+ SYMBOL_TYPE (sym) = (struct type *) newobj;
/* Should we be putting local_symbols back to what it was?
Does it matter? */
struct pending *ppt;
int i;
/* Name of the type, without "struct" or "union". */
- const char *typename = TYPE_TAG_NAME (*type);
+ const char *type_name = TYPE_TAG_NAME (*type);
- if (typename == NULL)
+ if (type_name == NULL)
{
complaint (&symfile_complaints, _("need a type name"));
break;
&& (TYPE_INSTANCE_FLAGS (*type) ==
TYPE_INSTANCE_FLAGS (SYMBOL_TYPE (sym)))
&& strcmp (SYMBOL_LINKAGE_NAME (sym),
- typename) == 0)
+ type_name) == 0)
replace_type (*type, SYMBOL_TYPE (sym));
}
}
static void
debug_qf_map_matching_symbols (struct objfile *objfile,
- const char *name, domain_enum namespace,
+ const char *name, domain_enum domain,
int global,
int (*callback) (struct block *,
struct symbol *, void *),
fprintf_filtered (gdb_stdlog,
"qf->map_matching_symbols (%s, \"%s\", %s, %d, %s, %s, %s, %s)\n",
objfile_debug_name (objfile), name,
- domain_name (namespace), global,
+ domain_name (domain), global,
host_address_to_string (callback),
host_address_to_string (data),
host_address_to_string (match),
host_address_to_string (ordered_compare));
debug_data->real_sf->qf->map_matching_symbols (objfile, name,
- namespace, global,
+ domain, global,
callback, data,
match,
ordered_compare);
void (*expand_symtabs_with_fullname) (struct objfile *objfile,
const char *fullname);
- /* Find global or static symbols in all tables that are in NAMESPACE
+ /* Find global or static symbols in all tables that are in DOMAIN
and for which MATCH (symbol name, NAME) == 0, passing each to
CALLBACK, reading in partial symbol tables as needed. Look
through global symbols if GLOBAL and otherwise static symbols.
non-zero to indicate that the scan should be terminated. */
void (*map_matching_symbols) (struct objfile *,
- const char *name, domain_enum namespace,
+ const char *name, domain_enum domain,
int global,
int (*callback) (struct block *,
struct symbol *, void *),
of matches. Note that the name is moved to freshly malloc'd space. */
{
- char *new;
+ char *newobj;
enum maybe_add_completion_enum add_status;
if (word == sym_text)
{
- new = xmalloc (strlen (symname) + 5);
- strcpy (new, symname);
+ newobj = xmalloc (strlen (symname) + 5);
+ strcpy (newobj, symname);
}
else if (word > sym_text)
{
/* Return some portion of symname. */
- new = xmalloc (strlen (symname) + 5);
- strcpy (new, symname + (word - sym_text));
+ newobj = xmalloc (strlen (symname) + 5);
+ strcpy (newobj, symname + (word - sym_text));
}
else
{
/* Return some of SYM_TEXT plus symname. */
- new = xmalloc (strlen (symname) + (sym_text - word) + 5);
- strncpy (new, word, sym_text - word);
- new[sym_text - word] = '\0';
- strcat (new, symname);
+ newobj = xmalloc (strlen (symname) + (sym_text - word) + 5);
+ strncpy (newobj, word, sym_text - word);
+ newobj[sym_text - word] = '\0';
+ strcat (newobj, symname);
}
- add_status = maybe_add_completion (completion_tracker, new);
+ add_status = maybe_add_completion (completion_tracker, newobj);
switch (add_status)
{
case MAYBE_ADD_COMPLETION_OK:
- VEC_safe_push (char_ptr, return_val, new);
+ VEC_safe_push (char_ptr, return_val, newobj);
break;
case MAYBE_ADD_COMPLETION_OK_MAX_REACHED:
- VEC_safe_push (char_ptr, return_val, new);
+ VEC_safe_push (char_ptr, return_val, newobj);
throw_max_completions_reached_error ();
case MAYBE_ADD_COMPLETION_MAX_REACHED:
- xfree (new);
+ xfree (newobj);
throw_max_completions_reached_error ();
case MAYBE_ADD_COMPLETION_DUPLICATE:
- xfree (new);
+ xfree (newobj);
break;
}
}
add_filename_to_list (const char *fname, const char *text, const char *word,
VEC (char_ptr) **list)
{
- char *new;
+ char *newobj;
size_t fnlen = strlen (fname);
if (word == text)
{
/* Return exactly fname. */
- new = xmalloc (fnlen + 5);
- strcpy (new, fname);
+ newobj = xmalloc (fnlen + 5);
+ strcpy (newobj, fname);
}
else if (word > text)
{
/* Return some portion of fname. */
- new = xmalloc (fnlen + 5);
- strcpy (new, fname + (word - text));
+ newobj = xmalloc (fnlen + 5);
+ strcpy (newobj, fname + (word - text));
}
else
{
/* Return some of TEXT plus fname. */
- new = xmalloc (fnlen + (text - word) + 5);
- strncpy (new, word, text - word);
- new[text - word] = '\0';
- strcat (new, fname);
+ newobj = xmalloc (fnlen + (text - word) + 5);
+ strncpy (newobj, word, text - word);
+ newobj[text - word] = '\0';
+ strcat (newobj, fname);
}
- VEC_safe_push (char_ptr, *list, new);
+ VEC_safe_push (char_ptr, *list, newobj);
}
static int
static void
free_thread (struct thread_info *tp)
{
- if (tp->private)
+ if (tp->priv)
{
if (tp->private_dtor)
- tp->private_dtor (tp->private);
+ tp->private_dtor (tp->priv);
else
- xfree (tp->private);
+ xfree (tp->priv);
}
xfree (tp->name);
}
struct thread_info *
-add_thread_with_info (ptid_t ptid, struct private_thread_info *private)
+add_thread_with_info (ptid_t ptid, struct private_thread_info *priv)
{
struct thread_info *result = add_thread_silent (ptid);
- result->private = private;
+ result->priv = priv;
if (print_thread_events)
printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid));
deprecated_cmd_warning (line);
/* c->user_commands would be NULL in the case of a python command. */
- if (c->class == class_user && c->user_commands)
+ if (c->theclass == class_user && c->user_commands)
execute_user_command (c, arg);
else if (c->type == set_cmd)
do_set_command (arg, from_tty, c);
has changed (data_element_ptr, frame, &new_value)
{
data_element_ptr->value = new_value;
- update the display with the new value, hiliting it.
+ update the display with the newobj value, hiliting it.
}
#endif
}
NEW is the new name for a type TYPE. */
void
-typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
+typedef_print (struct type *type, struct symbol *newobj, struct ui_file *stream)
{
- LA_PRINT_TYPEDEF (type, new, stream);
+ LA_PRINT_TYPEDEF (type, newobj, stream);
}
/* The default way to print a typedef. */
/* TYPENAME is either the name of a type, or an expression. */
static void
-ptype_command (char *typename, int from_tty)
+ptype_command (char *type_name, int from_tty)
{
- whatis_exp (typename, 1);
+ whatis_exp (type_name, 1);
}
/* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
and whatis_command(). */
void
-maintenance_print_type (char *typename, int from_tty)
+maintenance_print_type (char *type_name, int from_tty)
{
struct value *val;
struct type *type;
struct cleanup *old_chain;
struct expression *expr;
- if (typename != NULL)
+ if (type_name != NULL)
{
- expr = parse_expression (typename);
+ expr = parse_expression (type_name);
old_chain = make_cleanup (free_current_contents, &expr);
if (expr->elts[0].opcode == OP_TYPE)
{
typedef void (ui_file_delete_ftype) (struct ui_file * stream);
extern void set_ui_file_data (struct ui_file *stream, void *data,
- ui_file_delete_ftype *delete);
+ ui_file_delete_ftype *to_delete);
typedef int (ui_file_fseek_ftype) (struct ui_file *stream, long offset,
int whence);
situations or combinations thereof. */
static struct value *
-value_user_defined_cpp_op (struct value **args, int nargs, char *operator,
+value_user_defined_cpp_op (struct value **args, int nargs, char *oper,
int *static_memfuncp, enum noside noside)
{
struct symbol *symp = NULL;
struct value *valp = NULL;
- find_overload_match (args, nargs, operator, BOTH /* could be method */,
+ find_overload_match (args, nargs, oper, BOTH /* could be method */,
&args[0] /* objp */,
NULL /* pass NULL symbol since symbol is unknown */,
&valp, &symp, static_memfuncp, 0, noside);
return value_of_variable (symp, 0);
}
- error (_("Could not find %s."), operator);
+ error (_("Could not find %s."), oper);
}
/* Lookup user defined operator NAME. Return a value representing the
i = value_history_count % VALUE_HISTORY_CHUNK;
if (i == 0)
{
- struct value_history_chunk *new
+ struct value_history_chunk *newobj
= (struct value_history_chunk *)
xmalloc (sizeof (struct value_history_chunk));
- memset (new->values, 0, sizeof new->values);
- new->next = value_history_chain;
- value_history_chain = new;
+ memset (newobj->values, 0, sizeof newobj->values);
+ newobj->next = value_history_chain;
+ value_history_chain = newobj;
}
value_history_chain->values[i] = val;
install_dynamic_child (struct varobj *var,
VEC (varobj_p) **changed,
VEC (varobj_p) **type_changed,
- VEC (varobj_p) **new,
+ VEC (varobj_p) **newobj,
VEC (varobj_p) **unchanged,
int *cchanged,
int index,
/* There's no child yet. */
struct varobj *child = varobj_add_child (var, item);
- if (new)
+ if (newobj)
{
- VEC_safe_push (varobj_p, *new, child);
+ VEC_safe_push (varobj_p, *newobj, child);
*cchanged = 1;
}
}
update_dynamic_varobj_children (struct varobj *var,
VEC (varobj_p) **changed,
VEC (varobj_p) **type_changed,
- VEC (varobj_p) **new,
+ VEC (varobj_p) **newobj,
VEC (varobj_p) **unchanged,
int *cchanged,
int update_children,
install_dynamic_child (var, can_mention ? changed : NULL,
can_mention ? type_changed : NULL,
- can_mention ? new : NULL,
+ can_mention ? newobj : NULL,
can_mention ? unchanged : NULL,
can_mention ? cchanged : NULL, i,
item);
to point to the new varobj. */
VEC(varobj_update_result) *
-varobj_update (struct varobj **varp, int explicit)
+varobj_update (struct varobj **varp, int is_explicit)
{
int type_changed = 0;
int i;
- struct value *new;
+ struct value *newobj;
VEC (varobj_update_result) *stack = NULL;
VEC (varobj_update_result) *result = NULL;
changing type. One use case for frozen varobjs is
retaining previously evaluated expressions, and we don't
want them to be reevaluated at all. */
- if (!explicit && (*varp)->frozen)
+ if (!is_explicit && (*varp)->frozen)
return result;
if (!(*varp)->root->is_valid)
the frame in which a local existed. We are letting the
value_of_root variable dispose of the varobj if the type
has changed. */
- new = value_of_root (varp, &type_changed);
- if (update_type_if_necessary(*varp, new))
+ newobj = value_of_root (varp, &type_changed);
+ if (update_type_if_necessary(*varp, newobj))
type_changed = 1;
r.varobj = *varp;
r.type_changed = type_changed;
- if (install_new_value ((*varp), new, type_changed))
+ if (install_new_value ((*varp), newobj, type_changed))
r.changed = 1;
- if (new == NULL)
+ if (newobj == NULL)
r.status = VAROBJ_NOT_IN_SCOPE;
r.value_installed = 1;
{
struct type *new_type;
- new = value_of_child (v->parent, v->index);
- if (update_type_if_necessary(v, new))
+ newobj = value_of_child (v->parent, v->index);
+ if (update_type_if_necessary(v, newobj))
r.type_changed = 1;
- if (new)
- new_type = value_type (new);
+ if (newobj)
+ new_type = value_type (newobj);
else
new_type = v->root->lang_ops->type_of_child (v->parent, v->index);
- if (varobj_value_has_mutated (v, new, new_type))
+ if (varobj_value_has_mutated (v, newobj, new_type))
{
/* The children are no longer valid; delete them now.
Report the fact that its type changed as well. */
r.type_changed = 1;
}
- if (install_new_value (v, new, r.type_changed))
+ if (install_new_value (v, newobj, r.type_changed))
{
r.changed = 1;
v->updated = 0;
if (varobj_is_dynamic_p (v))
{
VEC (varobj_p) *changed = 0, *type_changed = 0, *unchanged = 0;
- VEC (varobj_p) *new = 0;
+ VEC (varobj_p) *newobj = 0;
int i, children_changed = 0;
if (v->frozen)
/* If update_dynamic_varobj_children returns 0, then we have
a non-conforming pretty-printer, so we skip it. */
- if (update_dynamic_varobj_children (v, &changed, &type_changed, &new,
+ if (update_dynamic_varobj_children (v, &changed, &type_changed, &newobj,
&unchanged, &children_changed, 1,
v->from, v->to))
{
- if (children_changed || new)
+ if (children_changed || newobj)
{
r.children_changed = 1;
- r.new = new;
+ r.newobj = newobj;
}
/* Push in reverse order so that the first child is
popped from the work stack first, and so will be
It lists the new children (which must necessarily come at the end
of the child list) added during an update. The caller is
responsible for freeing this vector. */
- VEC (varobj_p) *new;
+ VEC (varobj_p) *newobj;
} varobj_update_result;
DEF_VEC_O (varobj_update_result);
void *data);
extern VEC(varobj_update_result) *varobj_update (struct varobj **varp,
- int explicit);
+ int is_explicit);
extern void varobj_invalidate (void);
/* fcn_cs_saved is global because process_xcoff_symbol needs it. */
union internal_auxent fcn_aux_saved = main_aux;
- struct context_stack *new;
+ struct context_stack *newobj;
char *filestring = " _start_ "; /* Name of the current file. */
within_function = 1;
- new = push_context (0, fcn_start_addr + off);
+ newobj = push_context (0, fcn_start_addr + off);
- new->name = define_symbol
+ newobj->name = define_symbol
(fcn_cs_saved.c_value + off,
fcn_stab_saved.c_name, 0, 0, objfile);
- if (new->name != NULL)
- SYMBOL_SECTION (new->name) = SECT_OFF_TEXT (objfile);
+ if (newobj->name != NULL)
+ SYMBOL_SECTION (newobj->name) = SECT_OFF_TEXT (objfile);
}
else if (strcmp (cs->c_name, ".ef") == 0)
{
within_function = 0;
break;
}
- new = pop_context ();
+ newobj = pop_context ();
/* Stack must be empty now. */
- if (context_stack_depth > 0 || new == NULL)
+ if (context_stack_depth > 0 || newobj == NULL)
{
ef_complaint (cs->c_symnum);
within_function = 0;
break;
}
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr,
+ finish_block (newobj->name, &local_symbols, newobj->old_blocks,
+ newobj->start_addr,
(fcn_cs_saved.c_value
+ fcn_aux_saved.x_sym.x_misc.x_fsize
+ ANOFFSET (objfile->section_offsets,
if (strcmp (cs->c_name, ".bb") == 0)
{
depth++;
- new = push_context (depth,
+ newobj = push_context (depth,
(cs->c_value
+ ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT (objfile))));
eb_complaint (cs->c_symnum);
break;
}
- new = pop_context ();
- if (depth-- != new->depth)
+ newobj = pop_context ();
+ if (depth-- != newobj->depth)
{
eb_complaint (cs->c_symnum);
break;
if (local_symbols && context_stack_depth > 0)
{
/* Make a block for the local symbols within. */
- finish_block (new->name, &local_symbols, new->old_blocks,
- new->start_addr,
+ finish_block (newobj->name, &local_symbols, newobj->old_blocks,
+ newobj->start_addr,
(cs->c_value
+ ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT (objfile))));
}
- local_symbols = new->locals;
+ local_symbols = newobj->locals;
}
break;