From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11023 invoked by alias); 21 Oct 2013 15:37:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10919 invoked by uid 89); 21 Oct 2013 15:37:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKTIP,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Oct 2013 15:37:33 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9LFbVxo016534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Oct 2013 11:37:32 -0400 Received: from redhat.brq.redhat.com (unused-4-133.brq.redhat.com [10.34.4.133]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9LFbRIk025201; Mon, 21 Oct 2013 11:37:30 -0400 From: Ondrej Oprala To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 02/18] poison "new" Date: Mon, 21 Oct 2013 15:37:00 -0000 Message-Id: <1382369846-5817-3-git-send-email-ooprala@redhat.com> In-Reply-To: <1382369846-5817-1-git-send-email-ooprala@redhat.com> References: <1382369846-5817-1-git-send-email-ooprala@redhat.com> X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00644.txt.bz2 From: Tom Tromey gdb/ChangeLog 2013-10-21 Tom Tromey * bcache.c (new_bstr): Renamed from new. * buildsym.c (new_ctx): Likewise. * cleanups.c (new_cleanup): Likewise. * cli/cli-setshow.c (new_str): Likewise. * coffread.c (new_ctx): Likewise. * continuations.c (new_cont): Likewise. * cp-namespace.c (new_direct): Likewise. * cp-support.c (new_comp): Likewise. * dbxread.c (new_ctx): Likewise. * dwarf2read.c (new_ctx): Likewise. * environ.c (new_str): Likewise. * gdbtypes.c (new_type): Likewise. * jit.c (new_block): Likewise. * jv-exp.y (new_expr): Likewise. * macrotab.c (new_file): Likewise. * mdebugread.c (new_stack): Likewise. * memattr.c (new_region): Likewise. * mi/mi-cmd-var.c (new_children): Likewise. * minsyms.c (new_elt, new_bunch): Likewise. * objc-lang.c (new_selname): Likewise. * parse.c (new_call): Likewise. * printcmd.c (new_disp): Likewise. * solib-darwin.c (new_so): Likewise. * solib-irix.c (new_so): Likewise. * solib-som.c (new_so): Likewise. * solib-spu.c (new_so): Likewise. * solib-svr4.c (new_so): Likewise. * stabsread.c (new_types): Likewise. * symtab.c (new_str): Likewise. * typeprint.c (new_sym): Likewise. * value.c (new_chunk): Likewise. * varobj.c (new_children): Likewise. * varobj.h (new_children): Likewise. * xcoffread.c (new_ctx): Likewise. --- gdb/bcache.c | 14 ++++----- gdb/buildsym.c | 18 +++++------ gdb/cleanups.c | 12 +++---- gdb/cli/cli-setshow.c | 14 ++++----- gdb/coffread.c | 38 +++++++++++------------ gdb/continuations.c | 12 +++---- gdb/cp-namespace.c | 35 +++++++++++---------- gdb/cp-support.c | 14 ++++----- gdb/dbxread.c | 43 ++++++++++++++------------ gdb/dwarf2read.c | 28 ++++++++--------- gdb/environ.c | 6 ++-- gdb/gdbtypes.c | 6 ++-- gdb/jit.c | 8 ++--- gdb/jv-exp.y | 21 +++++++------ gdb/macrotab.c | 14 ++++----- gdb/mdebugread.c | 18 +++++------ gdb/memattr.c | 24 +++++++------- gdb/mi/mi-cmd-var.c | 8 ++--- gdb/minsyms.c | 22 ++++++------- gdb/objc-lang.c | 10 +++--- gdb/parse.c | 10 +++--- gdb/printcmd.c | 24 +++++++------- gdb/solib-darwin.c | 20 ++++++------ gdb/solib-irix.c | 24 +++++++------- gdb/solib-som.c | 66 ++++++++++++++++++++++----------------- gdb/solib-spu.c | 25 ++++++++------- gdb/solib-svr4.c | 86 +++++++++++++++++++++++++-------------------------- gdb/stabsread.c | 60 +++++++++++++++++------------------ gdb/symtab.c | 40 ++++++++++++------------ gdb/typeprint.c | 5 +-- gdb/value.c | 8 ++--- gdb/varobj.c | 41 ++++++++++++------------ gdb/varobj.h | 2 +- gdb/xcoffread.c | 31 ++++++++++--------- 34 files changed, 412 insertions(+), 395 deletions(-) diff --git a/gdb/bcache.c b/gdb/bcache.c index 712142d..1d68a00 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -269,14 +269,14 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added) /* The user's string isn't in the list. Insert it after *ps. */ { - struct bstring *new + struct bstring *new_bstr = 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 (&new_bstr->d.data, addr, length); + new_bstr->length = length; + new_bstr->next = bcache->bucket[hash_index]; + new_bstr->half_hash = half_hash; + bcache->bucket[hash_index] = new_bstr; bcache->unique_count++; bcache->unique_size += length; @@ -285,7 +285,7 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added) if (added) *added = 1; - return &new->d.data; + return &new_bstr->d.data; } } diff --git a/gdb/buildsym.c b/gdb/buildsym.c index cee0cc5..14756e1 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -1439,7 +1439,7 @@ augment_type_symtab (struct objfile *objfile, struct symtab *primary_symtab) struct context_stack * push_context (int desc, CORE_ADDR valu) { - struct context_stack *new; + struct context_stack *new_ctx; if (context_stack_depth == context_stack_size) { @@ -1449,18 +1449,18 @@ push_context (int desc, CORE_ADDR valu) (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; + new_ctx = &context_stack[context_stack_depth++]; + new_ctx->depth = desc; + new_ctx->locals = local_symbols; + new_ctx->old_blocks = pending_blocks; + new_ctx->start_addr = valu; + new_ctx->using_directives = using_directives; + new_ctx->name = NULL; local_symbols = NULL; using_directives = NULL; - return new; + return new_ctx; } /* Pop a context block. Returns the address of the context block just diff --git a/gdb/cleanups.c b/gdb/cleanups.c index 898e526..d83313c 100644 --- a/gdb/cleanups.c +++ b/gdb/cleanups.c @@ -79,15 +79,15 @@ static struct cleanup * make_my_cleanup2 (struct cleanup **pmy_chain, make_cleanup_ftype *function, void *arg, void (*free_arg) (void *)) { - struct cleanup *new + struct cleanup *new_cleanup = (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; + new_cleanup->next = *pmy_chain; + new_cleanup->function = function; + new_cleanup->free_arg = free_arg; + new_cleanup->arg = arg; + *pmy_chain = new_cleanup; gdb_assert (old_chain != NULL); return old_chain; diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 0cd36c2..3e2cf91 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -159,16 +159,16 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c) { case var_string: { - char *new; + char *new_str; const char *p; char *q; int ch; if (arg == NULL) arg = ""; - new = (char *) xmalloc (strlen (arg) + 2); + new_str = (char *) xmalloc (strlen (arg) + 2); p = arg; - q = new; + q = new_str; while ((ch = *p++) != '\000') { if (ch == '\\') @@ -196,18 +196,18 @@ do_set_command (char *arg, int from_tty, struct cmd_list_element *c) *q++ = ' '; #endif *q++ = '\0'; - new = (char *) xrealloc (new, q - new); + new_str = (char *) xrealloc (new_str, q - new_str); if (*(char **) c->var == NULL - || strcmp (*(char **) c->var, new) != 0) + || strcmp (*(char **) c->var, new_str) != 0) { xfree (*(char **) c->var); - *(char **) c->var = new; + *(char **) c->var = new_str; option_changed = 1; } else - xfree (new); + xfree (new_str); } break; case var_string_noescape: diff --git a/gdb/coffread.c b/gdb/coffread.c index 959e96a..70d5e23 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -776,7 +776,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, struct objfile *objfile) { struct gdbarch *gdbarch = get_objfile_arch (objfile); - struct context_stack *new; + struct context_stack *new_ctx; struct coff_symbol coff_symbol; struct coff_symbol *cs = &coff_symbol; static struct internal_syment main_sym; @@ -1071,9 +1071,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, context_stack_depth is zero, and complain if not. */ depth = 0; - new = push_context (depth, fcn_start_addr); + new_ctx = push_context (depth, fcn_start_addr); fcn_cs_saved.c_name = getsymname (&fcn_sym_saved); - new->name = + new_ctx->name = process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved, objfile); } @@ -1096,9 +1096,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, break; } - new = pop_context (); + new_ctx = pop_context (); /* Stack must be empty now. */ - if (context_stack_depth > 0 || new == NULL) + if (context_stack_depth > 0 || new_ctx == NULL) { complaint (&symfile_complaints, _("Unmatched .ef symbol(s) ignored " @@ -1133,8 +1133,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, 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 (new_ctx->name, &local_symbols, + new_ctx->old_blocks, new_ctx->start_addr, fcn_cs_saved.c_value + fcn_aux_saved.x_sym.x_misc.x_fsize + ANOFFSET (objfile->section_offsets, @@ -1164,8 +1164,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, break; } - new = pop_context (); - if (depth-- != new->depth) + new_ctx = pop_context (); + if (depth-- != new_ctx->depth) { complaint (&symfile_complaints, _("Mismatched .eb symbol ignored " @@ -1179,11 +1179,11 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, 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, objfile); + finish_block (0, &local_symbols, new_ctx->old_blocks, + new_ctx->start_addr, tmpaddr, objfile); } /* Now pop locals of block just finished. */ - local_symbols = new->locals; + local_symbols = new_ctx->locals; } break; @@ -2061,7 +2061,7 @@ coff_read_struct_type (int index, int length, int lastsym, struct type *type; struct nextfield *list = 0; - struct nextfield *new; + struct nextfield *new_ctx; int nfields = 0; int n; char *name; @@ -2088,9 +2088,9 @@ coff_read_struct_type (int index, int length, int lastsym, case C_MOU: /* Get space to record the next field's data. */ - new = (struct nextfield *) alloca (sizeof (struct nextfield)); - new->next = list; - list = new; + new_ctx = (struct nextfield *) alloca (sizeof (struct nextfield)); + new_ctx->next = list; + list = new_ctx; /* Save the data. */ list->field.name = obstack_copy0 (&objfile->objfile_obstack, @@ -2105,9 +2105,9 @@ coff_read_struct_type (int index, int length, int lastsym, case C_FIELD: /* Get space to record the next field's data. */ - new = (struct nextfield *) alloca (sizeof (struct nextfield)); - new->next = list; - list = new; + new_ctx = (struct nextfield *) alloca (sizeof (struct nextfield)); + new_ctx->next = list; + list = new_ctx; /* Save the data. */ list->field.name = obstack_copy0 (&objfile->objfile_obstack, diff --git a/gdb/continuations.c b/gdb/continuations.c index 2dfbbb3..23470fc 100644 --- a/gdb/continuations.c +++ b/gdb/continuations.c @@ -39,13 +39,13 @@ make_continuation (struct continuation **pmy_chain, continuation_ftype *function, void *arg, void (*free_arg) (void *)) { - struct continuation *new = XNEW (struct continuation); + struct continuation *new_cont = XNEW (struct continuation); - new->next = *pmy_chain; - new->function = function; - new->free_arg = free_arg; - new->arg = arg; - *pmy_chain = new; + new_cont->next = *pmy_chain; + new_cont->function = function; + new_cont->free_arg = free_arg; + new_cont->arg = arg; + *pmy_chain = new_cont; } static void diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 36134c0..f7db48c 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -133,7 +133,7 @@ cp_add_using_directive (const char *dest, struct obstack *obstack) { struct using_direct *current; - struct using_direct *new; + struct using_direct *new_direct; /* Has it already been added? */ @@ -170,39 +170,40 @@ cp_add_using_directive (const char *dest, return; } - new = obstack_alloc (obstack, (sizeof (*new) + new_direct = obstack_alloc (obstack, (sizeof (*new_direct) + (VEC_length (const_char_ptr, excludes) - * sizeof (*new->excludes)))); - memset (new, 0, sizeof (*new)); + * sizeof (*new_direct->excludes)))); + memset (new_direct, 0, sizeof (*new_direct)); if (copy_names) { - new->import_src = obstack_copy0 (obstack, src, strlen (src)); - new->import_dest = obstack_copy0 (obstack, dest, strlen (dest)); + new_direct->import_src = obstack_copy0 (obstack, src, strlen (src)); + new_direct->import_dest = obstack_copy0 (obstack, dest, strlen (dest)); } else { - new->import_src = src; - new->import_dest = dest; + new_direct->import_src = src; + new_direct->import_dest = dest; } if (alias != NULL && copy_names) - new->alias = obstack_copy0 (obstack, alias, strlen (alias)); + new_direct->alias = obstack_copy0 (obstack, alias, strlen (alias)); else - new->alias = alias; + new_direct->alias = alias; if (declaration != NULL && copy_names) - new->declaration = obstack_copy0 (obstack, + new_direct->declaration = obstack_copy0 (obstack, declaration, strlen (declaration)); else - new->declaration = declaration; + new_direct->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 (new_direct->excludes, VEC_address (const_char_ptr, excludes), + VEC_length (const_char_ptr, excludes) + * sizeof (*new_direct->excludes)); + new_direct->excludes[VEC_length (const_char_ptr, excludes)] = NULL; - new->next = using_directives; - using_directives = new; + new_direct->next = using_directives; + using_directives = new_direct; } /* Test whether or not NAMESPACE looks like it mentions an anonymous diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 86f19de..2042b93 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -320,25 +320,25 @@ replace_typedefs_qualified_name (struct demangle_parse_info *info, { if (d_left (comp)->type == DEMANGLE_COMPONENT_NAME) { - struct demangle_component new; + struct demangle_component new_comp; 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)) + new_comp.type = DEMANGLE_COMPONENT_NAME; + new_comp.u.s_name.s = name; + new_comp.u.s_name.len = len; + if (inspect_type (info, &new_comp, finder, data)) { char *n, *s; long slen; - /* A typedef was substituted in NEW. Convert it to a + /* A typedef was substituted in NEW_COMP. Convert it to a string and replace the top DEMANGLE_COMPONENT_QUAL_NAME node. */ ui_file_rewind (buf); - n = cp_comp_to_string (&new, 100); + n = cp_comp_to_string (&new_comp, 100); if (n == NULL) { /* If something went astray, abort typedef substitutions. */ diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 00949ac..8c055f8 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2721,7 +2721,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, struct objfile *objfile) { struct gdbarch *gdbarch = get_objfile_arch (objfile); - struct context_stack *new; + struct context_stack *new_ctx; /* 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 @@ -2798,16 +2798,18 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, } within_function = 0; - new = pop_context (); + new_ctx = 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 (new_ctx->name, &local_symbols, + new_ctx->old_blocks, + new_ctx->start_addr, new_ctx->start_addr + valu, objfile); /* 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 (new_ctx->name) == language_cplus) + cp_set_block_scope (new_ctx->name, block, + &objfile->objfile_obstack); /* May be switching to an assembler file which may not be using block relative stabs, so reset the offset. */ @@ -2867,8 +2869,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, break; } - new = pop_context (); - if (desc != new->depth) + new_ctx = pop_context (); + if (desc != new_ctx->depth) lbrac_mismatch_complaint (symnum); if (local_symbols != NULL) @@ -2881,7 +2883,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, _("misplaced N_LBRAC entry; discarding local " "symbols which have no enclosing block")); } - local_symbols = new->locals; + local_symbols = new_ctx->locals; if (context_stack_depth > 1) { @@ -2896,15 +2898,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, /* Muzzle a compiler bug that makes end < start. ??? Which compilers? Is this ever harmful?. */ - if (new->start_addr > valu) + if (new_ctx->start_addr > valu) { complaint (&symfile_complaints, _("block start larger than block end")); - new->start_addr = valu; + new_ctx->start_addr = valu; } /* Make a block for the local symbols within. */ - finish_block (0, &local_symbols, new->old_blocks, - new->start_addr, valu, objfile); + finish_block (0, &local_symbols, new_ctx->old_blocks, + new_ctx->start_addr, valu, objfile); } } else @@ -3203,20 +3205,21 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, { struct block *block; - new = pop_context (); + new_ctx = 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 (new_ctx->name, &local_symbols, + new_ctx->old_blocks, + new_ctx->start_addr, valu, objfile); /* For C++, set the block's scope. */ - if (SYMBOL_LANGUAGE (new->name) == language_cplus) - cp_set_block_scope (new->name, block, + if (SYMBOL_LANGUAGE (new_ctx->name) == language_cplus) + cp_set_block_scope (new_ctx->name, block, &objfile->objfile_obstack); } - new = push_context (0, valu); - new->name = define_symbol (valu, name, desc, type, objfile); + new_ctx = push_context (0, valu); + new_ctx->name = define_symbol (valu, name, desc, type, objfile); break; default: diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 3974d0b..a563a6d 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -10827,7 +10827,7 @@ static void read_func_scope (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; - struct context_stack *new; + struct context_stack *new_ctx; CORE_ADDR lowpc; CORE_ADDR highpc; struct die_info *child_die; @@ -10895,15 +10895,15 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) } } - new = push_context (0, lowpc); - new->name = new_symbol_full (die, read_type_die (die, cu), cu, + new_ctx = push_context (0, lowpc); + new_ctx->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, new_ctx->name, cu, 1); cu->list_in_scope = &local_symbols; @@ -10953,9 +10953,9 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) } } - new = pop_context (); + new_ctx = pop_context (); /* Make a block for the local symbols within. */ - block = finish_block (new->name, &local_symbols, new->old_blocks, + block = finish_block (new_ctx->name, &local_symbols, new_ctx->old_blocks, lowpc, highpc, objfile); /* For C++, set the block's scope. */ @@ -10987,8 +10987,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) 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 = new_ctx->locals; + using_directives = new_ctx->using_directives; /* If we've finished processing a top-level function, subsequent symbols go in the file symbol list. */ @@ -11003,7 +11003,7 @@ static void read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; - struct context_stack *new; + struct context_stack *new_ctx; CORE_ADDR lowpc, highpc; struct die_info *child_die; CORE_ADDR baseaddr; @@ -11030,13 +11030,13 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) child_die = sibling_die (child_die); } } - new = pop_context (); + new_ctx = pop_context (); if (local_symbols != NULL || using_directives != NULL) { struct block *block - = finish_block (0, &local_symbols, new->old_blocks, new->start_addr, - highpc, objfile); + = finish_block (0, &local_symbols, new_ctx->old_blocks, + new_ctx->start_addr, highpc, objfile); /* Note that recording ranges after traversing children, as we do here, means that recording a parent's ranges entails @@ -11050,8 +11050,8 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) to do. */ dwarf2_record_block_ranges (die, block, baseaddr, cu); } - local_symbols = new->locals; - using_directives = new->using_directives; + local_symbols = new_ctx->locals; + using_directives = new_ctx->using_directives; } /* Read in DW_TAG_GNU_call_site and insert it to CU->call_site_htab. */ diff --git a/gdb/environ.c b/gdb/environ.c index 50653da..0992492 100644 --- a/gdb/environ.c +++ b/gdb/environ.c @@ -79,10 +79,10 @@ init_environ (struct gdb_environ *e) while (--i >= 0) { int len = strlen (e->vector[i]); - char *new = (char *) xmalloc (len + 1); + char *new_str = (char *) xmalloc (len + 1); - memcpy (new, e->vector[i], len + 1); - e->vector[i] = new; + memcpy (new_str, e->vector[i], len + 1); + e->vector[i] = new_str; } } diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 9069a11..bbac3c6 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3400,7 +3400,7 @@ recursive_dump_type (struct type *type, int spaces) struct type_pair { - struct type *old, *new; + struct type *old, *new_type; }; static hashval_t @@ -3456,7 +3456,7 @@ copy_type_recursive (struct objfile *objfile, 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)->new_type; new_type = alloc_type_arch (get_type_arch (type)); @@ -3465,7 +3465,7 @@ copy_type_recursive (struct objfile *objfile, stored = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair)); stored->old = type; - stored->new = new_type; + stored->new_type = new_type; *slot = stored; /* Copy the common fields of types. For the main type, we simply diff --git a/gdb/jit.c b/gdb/jit.c index ba0be5e..4eb818c 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -531,15 +531,15 @@ jit_symtab_open_impl (struct gdb_symbol_callbacks *cb, static int compare_block (const struct gdb_block *const old, - const struct gdb_block *const new) + const struct gdb_block *const new_block) { if (old == NULL) return 1; - if (old->begin < new->begin) + if (old->begin < new_block->begin) return 1; - else if (old->begin == new->begin) + else if (old->begin == new_block->begin) { - if (old->end > new->end) + if (old->end > new_block->end) return 1; else return 0; diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 2c5154e..e4b1cec 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -1421,20 +1421,21 @@ static struct expression * 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)); - new->nelts = len; - memcpy (new->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len)); - new->language_defn = 0; - - return new; + struct expression *new_expr + = (struct expression *) malloc (sizeof (*new_expr) + + EXP_ELEM_TO_BYTES (len)); + new_expr->nelts = len; + memcpy (new_expr->elts, expr->elts + endpos - len, EXP_ELEM_TO_BYTES (len)); + new_expr->language_defn = 0; + + return new_expr; } /* Insert the expression NEW into the current expression (expout) at POS. */ static void -insert_exp (int pos, struct expression *new) +insert_exp (int pos, struct expression *new_expr) { - int newlen = new->nelts; + int newlen = new_expr->nelts; /* Grow expout if necessary. In this function's only use at present, this should never be necessary. */ @@ -1453,6 +1454,6 @@ insert_exp (int pos, struct expression *new) expout->elts[i + newlen] = expout->elts[i]; } - memcpy (expout->elts + pos, new->elts, EXP_ELEM_TO_BYTES (newlen)); + memcpy (expout->elts + pos, new_expr->elts, EXP_ELEM_TO_BYTES (newlen)); expout_ptr += newlen; } diff --git a/gdb/macrotab.c b/gdb/macrotab.c index 2e5592b..6ee0698 100644 --- a/gdb/macrotab.c +++ b/gdb/macrotab.c @@ -452,7 +452,7 @@ macro_include (struct macro_source_file *source, int line, const char *included) { - struct macro_source_file *new; + struct macro_source_file *new_file; struct macro_source_file **link; /* Find the right position in SOURCE's `includes' list for the new @@ -498,13 +498,13 @@ macro_include (struct macro_source_file *source, /* 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; + new_file = new_source_file (source->table, included); + new_file->included_by = source; + new_file->included_at_line = line; + new_file->next_included = *link; + *link = new_file; - return new; + return new_file; } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index c27b114..a417f3c 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -432,24 +432,24 @@ static struct parse_stack static void push_parse_stack (void) { - struct parse_stack *new; + struct parse_stack *new_stack; /* Reuse frames if possible. */ if (top_stack && top_stack->prev) - new = top_stack->prev; + new_stack = top_stack->prev; else - new = (struct parse_stack *) xzalloc (sizeof (struct parse_stack)); + new_stack = (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 = new_stack->prev; - *new = *top_stack; - top_stack->prev = new; - new->prev = prev; - new->next = top_stack; + *new_stack = *top_stack; + top_stack->prev = new_stack; + new_stack->prev = prev; + new_stack->next = top_stack; } - top_stack = new; + top_stack = new_stack; } /* Exit a lexical context. */ diff --git a/gdb/memattr.c b/gdb/memattr.c index 5c2adaa..412b0c7 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -112,11 +112,11 @@ mem_region_cmp (const void *untyped_lhs, const void *untyped_rhs) /* Allocate a new memory region, with default settings. */ void -mem_region_init (struct mem_region *new) +mem_region_init (struct mem_region *new_region) { - memset (new, 0, sizeof (struct mem_region)); - new->enabled_p = 1; - new->attrib = default_mem_attrib; + memset (new_region, 0, sizeof (struct mem_region)); + new_region->enabled_p = 1; + new_region->attrib = default_mem_attrib; } /* This function should be called before any command which would @@ -174,7 +174,7 @@ static void create_mem_region (CORE_ADDR lo, CORE_ADDR hi, const struct mem_attrib *attrib) { - struct mem_region new; + struct mem_region new_region; int i, ix; /* lo == hi is a useless empty region. */ @@ -184,11 +184,11 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi, return; } - mem_region_init (&new); - new.lo = lo; - new.hi = hi; + mem_region_init (&new_region); + new_region.lo = lo; + new_region.hi = hi; - ix = VEC_lower_bound (mem_region_s, mem_region_list, &new, + ix = VEC_lower_bound (mem_region_s, mem_region_list, &new_region, mem_region_lessthan); /* Check for an overlapping memory region. We only need to check @@ -214,9 +214,9 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi, } } - new.number = ++mem_number; - new.attrib = *attrib; - VEC_safe_insert (mem_region_s, mem_region_list, ix, &new); + new_region.number = ++mem_number; + new_region.attrib = *attrib; + VEC_safe_insert (mem_region_s, mem_region_list, ix, &new_region); } /* diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 57a2f6b..f32ba69 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -783,14 +783,14 @@ varobj_update_one (struct varobj *var, enum print_values print_values, ui_out_field_int (uiout, "has_more", varobj_has_more (r->varobj, to)); - if (r->new) + if (r->new_children) { 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->new_children, j, child); ++j) { struct cleanup *cleanup_child; @@ -801,8 +801,8 @@ varobj_update_one (struct varobj *var, enum print_values print_values, } do_cleanups (cleanup); - VEC_free (varobj_p, r->new); - r->new = NULL; /* Paranoia. */ + VEC_free (varobj_p, r->new_children); + r->new_children = NULL; /* Paranoia. */ } do_cleanups (cleanup); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 95dd6cf..4c388d7 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -486,7 +486,7 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc, { int lo; int hi; - int new; + int new_elt; struct objfile *objfile; struct minimal_symbol *msymbol; struct minimal_symbol *best_symbol = NULL; @@ -550,16 +550,16 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc, while (SYMBOL_VALUE_ADDRESS (&msymbol[hi]) > pc) { /* pc is still strictly less than highest address. */ - /* Note "new" will always be >= lo. */ - new = (lo + hi) / 2; - if ((SYMBOL_VALUE_ADDRESS (&msymbol[new]) >= pc) || - (lo == new)) + /* Note "new_elt" will always be >= lo. */ + new_elt = (lo + hi) / 2; + if ((SYMBOL_VALUE_ADDRESS (&msymbol[new_elt]) >= pc) || + (lo == new_elt)) { - hi = new; + hi = new_elt; } else { - lo = new; + lo = new_elt; } } @@ -911,7 +911,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name, struct objfile *objfile) { struct obj_section *obj_section; - struct msym_bunch *new; + struct msym_bunch *new_bunch; struct minimal_symbol *msymbol; /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into @@ -937,10 +937,10 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name, if (msym_bunch_index == BUNCH_SIZE) { - new = XCALLOC (1, struct msym_bunch); + new_bunch = XCALLOC (1, struct msym_bunch); msym_bunch_index = 0; - new->next = msym_bunch; - msym_bunch = new; + new_bunch->next = msym_bunch; + msym_bunch = new_bunch; } msymbol = &msym_bunch->contents[msym_bunch_index]; SYMBOL_SET_LANGUAGE (msymbol, language_auto, &objfile->objfile_obstack); diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 8f0f858..d70c76c 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -411,16 +411,16 @@ static char *msglist_sel; void start_msglist(void) { - struct selname *new = + struct selname *new_selname = (struct selname *) xmalloc (sizeof (struct selname)); - new->next = selname_chain; - new->msglist_len = msglist_len; - new->msglist_sel = msglist_sel; + new_selname->next = selname_chain; + new_selname->msglist_len = msglist_len; + new_selname->msglist_sel = msglist_sel; msglist_len = 0; msglist_sel = (char *)xmalloc(1); *msglist_sel = 0; - selname_chain = new; + selname_chain = new_selname; } void diff --git a/gdb/parse.c b/gdb/parse.c index 07c1765..f828bbb 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -146,13 +146,13 @@ static struct funcall *funcall_chain; void start_arglist (void) { - struct funcall *new; + struct funcall *new_call; - new = (struct funcall *) xmalloc (sizeof (struct funcall)); - new->next = funcall_chain; - new->arglist_len = arglist_len; + new_call = (struct funcall *) xmalloc (sizeof (struct funcall)); + new_call->next = funcall_chain; + new_call->arglist_len = arglist_len; arglist_len = 0; - funcall_chain = new; + funcall_chain = new_call; } /* Return the number of arguments in a function call just terminated, diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 9bca6dd..03936f2 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -1505,7 +1505,7 @@ display_command (char *arg, int from_tty) { struct format_data fmt; struct expression *expr; - struct display *new; + struct display *new_disp; int display_it = 1; const char *exp = arg; @@ -1544,20 +1544,20 @@ display_command (char *arg, int from_tty) innermost_block = NULL; expr = parse_expression (exp); - new = (struct display *) xmalloc (sizeof (struct display)); + new_disp = (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; + new_disp->exp_string = xstrdup (exp); + new_disp->exp = expr; + new_disp->block = innermost_block; + new_disp->pspace = current_program_space; + new_disp->next = display_chain; + new_disp->number = ++display_number; + new_disp->format = fmt; + new_disp->enabled_p = 1; + display_chain = new_disp; if (from_tty && target_has_execution) - do_one_display (new); + do_one_display (new_disp); dont_repeat (); } diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index c4c6308..65565f0 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -277,7 +277,7 @@ darwin_current_sos (void) char *file_path; int errcode; struct darwin_so_list *dnew; - struct so_list *new; + struct so_list *new_so; struct cleanup *old_chain; /* Read image info from inferior. */ @@ -308,22 +308,22 @@ darwin_current_sos (void) /* Create and fill the new so_list element. */ dnew = XZALLOC (struct darwin_so_list); - new = &dnew->sl; + new_so = &dnew->sl; old_chain = make_cleanup (xfree, dnew); - new->lm_info = &dnew->li; + new_so->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 (new_so->so_name, file_path, SO_NAME_MAX_PATH_SIZE - 1); + new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; + strcpy (new_so->so_original_name, new_so->so_name); xfree (file_path); - new->lm_info->lm_addr = load_addr; + new_so->lm_info->lm_addr = load_addr; if (head == NULL) - head = new; + head = new_so; else - tail->next = new; - tail = new; + tail->next = new_so; + tail = new_so; discard_cleanups (old_chain); } diff --git a/gdb/solib-irix.c b/gdb/solib-irix.c index 0dbbb1b..3ed9772 100644 --- a/gdb/solib-irix.c +++ b/gdb/solib-irix.c @@ -484,16 +484,16 @@ irix_current_sos (void) int errcode; char *name_buf; int name_size; - struct so_list *new + struct so_list *new_so = (struct so_list *) xmalloc (sizeof (struct so_list)); - struct cleanup *old_chain = make_cleanup (xfree, new); + struct cleanup *old_chain = make_cleanup (xfree, new_so); - memset (new, 0, sizeof (*new)); + memset (new_so, 0, sizeof (*new_so)); - new->lm_info = xmalloc (sizeof (struct lm_info)); - make_cleanup (xfree, new->lm_info); + new_so->lm_info = xmalloc (sizeof (struct lm_info)); + make_cleanup (xfree, new_so->lm_info); - *new->lm_info = lm; + *new_so->lm_info = lm; /* Extract this shared object's name. */ name_size = lm.pathname_len; @@ -515,15 +515,15 @@ irix_current_sos (void) safe_strerror (errcode)); else { - strncpy (new->so_name, name_buf, name_size); - new->so_name[name_size] = '\0'; + strncpy (new_so->so_name, name_buf, name_size); + new_so->so_name[name_size] = '\0'; xfree (name_buf); - strcpy (new->so_original_name, new->so_name); + strcpy (new_so->so_original_name, new_so->so_name); } - new->next = 0; - *link_ptr = new; - link_ptr = &new->next; + new_so->next = 0; + *link_ptr = new_so; + link_ptr = &new_so->next; discard_cleanups (old_chain); } diff --git a/gdb/solib-som.c b/gdb/solib-som.c index fd0ff81..08fb283 100644 --- a/gdb/solib-som.c +++ b/gdb/solib-som.c @@ -584,18 +584,18 @@ som_current_sos (void) { char *namebuf; CORE_ADDR addr; - struct so_list *new; + struct so_list *new_so; 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); + new_so = (struct so_list *) xmalloc (sizeof (struct so_list)); + old_chain = make_cleanup (xfree, new_so); - memset (new, 0, sizeof (*new)); - new->lm_info = xmalloc (sizeof (struct lm_info)); - make_cleanup (xfree, new->lm_info); + memset (new_so, 0, sizeof (*new_so)); + new_so->lm_info = xmalloc (sizeof (struct lm_info)); + make_cleanup (xfree, new_so->lm_info); read_memory (lm, (gdb_byte *)&dbuf, sizeof (struct dld_list)); @@ -607,15 +607,15 @@ som_current_sos (void) 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 (new_so->so_name, namebuf, SO_NAME_MAX_PATH_SIZE - 1); + new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; xfree (namebuf); - strcpy (new->so_original_name, new->so_name); + strcpy (new_so->so_original_name, new_so->so_name); } - if (new->so_name[0] && !match_main (new->so_name)) + if (new_so->so_name[0] && !match_main (new_so->so_name)) { - struct lm_info *lmi = new->lm_info; + struct lm_info *lmi = new_so->lm_info; unsigned int tmp; lmi->lm_addr = lm; @@ -641,41 +641,49 @@ som_current_sos (void) = 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", new_so->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", new_so->lm_info->struct_version); + printf (" 'bind_mode' is %d\n", new_so->lm_info->bind_mode); printf (" 'library_version' is %d\n", - new->lm_info->library_version); + new_so->lm_info->library_version); printf (" 'text_addr' is %s\n", - paddress (target_gdbarch (), new->lm_info->text_addr)); + paddress (target_gdbarch (), + new_so->lm_info->text_addr)); printf (" 'text_link_addr' is %s\n", - paddress (target_gdbarch (), new->lm_info->text_link_addr)); + paddress (target_gdbarch (), + new_so->lm_info->text_link_addr)); printf (" 'text_end' is %s\n", - paddress (target_gdbarch (), new->lm_info->text_end)); + paddress (target_gdbarch (), + new_so->lm_info->text_end)); printf (" 'data_start' is %s\n", - paddress (target_gdbarch (), new->lm_info->data_start)); + paddress (target_gdbarch (), + new_so->lm_info->data_start)); printf (" 'bss_start' is %s\n", - paddress (target_gdbarch (), new->lm_info->bss_start)); + paddress (target_gdbarch (), + new_so->lm_info->bss_start)); printf (" 'data_end' is %s\n", - paddress (target_gdbarch (), new->lm_info->data_end)); + paddress (target_gdbarch (), + new_so->lm_info->data_end)); printf (" 'got_value' is %s\n", - paddress (target_gdbarch (), new->lm_info->got_value)); + paddress (target_gdbarch (), + new_so->lm_info->got_value)); printf (" 'tsd_start_addr' is %s\n", - paddress (target_gdbarch (), new->lm_info->tsd_start_addr)); + paddress (target_gdbarch (), + new_so->lm_info->tsd_start_addr)); #endif - new->addr_low = lmi->text_addr; - new->addr_high = lmi->text_end; + new_so->addr_low = lmi->text_addr; + new_so->addr_high = lmi->text_end; /* Link the new object onto the list. */ - new->next = NULL; - *link_ptr = new; - link_ptr = &new->next; + new_so->next = NULL; + *link_ptr = new_so; + link_ptr = &new_so->next; } else { - free_so (new); + free_so (new_so); } lm = EXTRACT (next); diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c index 626cc8f..eb3900d 100644 --- a/gdb/solib-spu.c +++ b/gdb/solib-spu.c @@ -122,19 +122,20 @@ append_ocl_sos (struct so_list **link_ptr) byte_order); if (data != 0x0) { - struct so_list *new; + struct so_list *new_so; /* Allocate so_list structure. */ - new = XZALLOC (struct so_list); + new_so = XZALLOC (struct so_list); /* Encode FD and object ID in path name. */ - xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>", + xsnprintf (new_so->so_name, sizeof new_so->so_name, + "@%s <%d>", hex_string (data), SPUADDR_SPU (*ocl_program_addr_base)); - strcpy (new->so_original_name, new->so_name); + strcpy (new_so->so_original_name, new_so->so_name); - *link_ptr = new; - link_ptr = &new->next; + *link_ptr = new_so; + link_ptr = &new_so->next; } } if (ex.reason < 0) @@ -198,7 +199,7 @@ spu_current_sos (void) for (i = 0; i < size; i += 4) { int fd = extract_unsigned_integer (buf + i, 4, byte_order); - struct so_list *new; + struct so_list *new_so; unsigned long long addr; char annex[32], id[100]; @@ -217,16 +218,16 @@ spu_current_sos (void) continue; /* Allocate so_list structure. */ - new = XZALLOC (struct so_list); + new_so = XZALLOC (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 (new_so->so_name, sizeof new_so->so_name, "@%s <%d>", hex_string (addr), fd); - strcpy (new->so_original_name, new->so_name); + strcpy (new_so->so_original_name, new_so->so_name); - *link_ptr = new; - link_ptr = &new->next; + *link_ptr = new_so; + link_ptr = &new_so->next; } /* Append OpenCL sos. */ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index ddbbd94..3a88723 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -938,7 +938,7 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size) { struct svr4_info *info; CORE_ADDR ldsomap; - struct so_list *new; + struct so_list *new_so; struct cleanup *old_chain; CORE_ADDR name_lm; @@ -953,11 +953,11 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size) if (!ldsomap) return 0; - new = XZALLOC (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; + new_so = XZALLOC (struct so_list); + old_chain = make_cleanup (xfree, new_so); + new_so->lm_info = lm_info_read (ldsomap); + make_cleanup (xfree, new_so->lm_info); + name_lm = new_so->lm_info ? new_so->lm_info->l_name : 0; do_cleanups (old_chain); return (name_lm >= vaddr && name_lm < vaddr + size); @@ -1093,17 +1093,17 @@ svr4_copy_library_list (struct so_list *src) while (src != NULL) { - struct so_list *new; + struct so_list *new_so; - new = xmalloc (sizeof (struct so_list)); - memcpy (new, src, sizeof (struct so_list)); + new_so = xmalloc (sizeof (struct so_list)); + memcpy (new_so, src, sizeof (struct so_list)); - new->lm_info = xmalloc (sizeof (struct lm_info)); - memcpy (new->lm_info, src->lm_info, sizeof (struct lm_info)); + new_so->lm_info = xmalloc (sizeof (struct lm_info)); + memcpy (new_so->lm_info, src->lm_info, sizeof (struct lm_info)); - new->next = NULL; - *link = new; - link = &new->next; + new_so->next = NULL; + *link = new_so; + link = &new_so->next; src = src->next; } @@ -1278,24 +1278,24 @@ static struct so_list * svr4_default_sos (void) { struct svr4_info *info = get_svr4_info (); - struct so_list *new; + struct so_list *new_so; if (!info->debug_loader_offset_p) return NULL; - new = XZALLOC (struct so_list); + new_so = XZALLOC (struct so_list); - new->lm_info = xzalloc (sizeof (struct lm_info)); + new_so->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; + new_so->lm_info->l_addr = info->debug_loader_offset; + new_so->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 (new_so->so_name, info->debug_loader_name, SO_NAME_MAX_PATH_SIZE - 1); + new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; + strcpy (new_so->so_original_name, new_so->so_name); - return new; + return new_so; } /* Read the whole inferior libraries chain starting at address LM. @@ -1315,28 +1315,28 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, for (; lm != 0; prev_lm = lm, lm = next_lm) { - struct so_list *new; + struct so_list *new_so; struct cleanup *old_chain; int errcode; char *buffer; - new = XZALLOC (struct so_list); - old_chain = make_cleanup_free_so (new); + new_so = XZALLOC (struct so_list); + old_chain = make_cleanup_free_so (new_so); - new->lm_info = lm_info_read (lm); - if (new->lm_info == NULL) + new_so->lm_info = lm_info_read (lm); + if (new_so->lm_info == NULL) { do_cleanups (old_chain); return 0; } - next_lm = new->lm_info->l_next; + next_lm = new_so->lm_info->l_next; - if (new->lm_info->l_prev != prev_lm) + if (new_so->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 (), new_so->lm_info->l_prev)); do_cleanups (old_chain); return 0; } @@ -1346,18 +1346,18 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, 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 && new_so->lm_info->l_prev == 0) { struct svr4_info *info = get_svr4_info (); - first = new; - info->main_lm_addr = new->lm_info->lm_addr; + first = new_so; + info->main_lm_addr = new_so->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 (new_so->lm_info->l_name, &buffer, SO_NAME_MAX_PATH_SIZE - 1, &errcode); if (errcode != 0) { @@ -1366,30 +1366,30 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, object, but (most likely) a vDSO. In this case, silently skip it; otherwise emit a warning. */ if (first == NULL - || new->lm_info->l_name != first->lm_info->l_name) + || new_so->lm_info->l_name != first->lm_info->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 (new_so->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); + new_so->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; + strcpy (new_so->so_original_name, new_so->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 (! new_so->so_name[0] || match_main (new_so->so_name)) { do_cleanups (old_chain); continue; } discard_cleanups (old_chain); - new->next = 0; - **link_ptr_ptr = new; - *link_ptr_ptr = &new->next; + new_so->next = 0; + **link_ptr_ptr = new_so; + *link_ptr_ptr = &new_so->next; } return 1; diff --git a/gdb/stabsread.c b/gdb/stabsread.c index da95a7e..2ac4dae 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1809,10 +1809,10 @@ again: 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 *new_types = alloca (sizeof (*new_types)); + new_types->type = arg_type; + new_types->next = arg_types; + arg_types = new_types; num_args++; } if (**pp == '#') @@ -2994,7 +2994,7 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type, struct objfile *objfile) { char *p; - struct nextfield *new; + struct nextfield *new_fields; /* We better set p right now, in case there are no fields at all... */ @@ -3010,11 +3010,11 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type, { 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; + new_fields = (struct nextfield *) xmalloc (sizeof (struct nextfield)); + make_cleanup (xfree, new_fields); + memset (new_fields, 0, sizeof (struct nextfield)); + new_fields->next = fip->list; + fip->list = new_fields; /* Get the field name. */ p = *pp; @@ -3092,7 +3092,7 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, struct objfile *objfile) { int i; - struct nextfield *new; + struct nextfield *new_fields; if (**pp != '!') { @@ -3132,14 +3132,13 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, 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 - field! */ - + new_fields = (struct nextfield *) xmalloc (sizeof (struct nextfield)); + make_cleanup (xfree, new_fields); + memset (new_fields, 0, sizeof (struct nextfield)); + new_fields->next = fip->list; + fip->list = new_fields; + /* This should be an unpacked field! */ + FIELD_BITSIZE (new_fields->field) = 0; STABS_CONTINUE (pp, objfile); switch (**pp) { @@ -3159,8 +3158,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, } ++(*pp); - new->visibility = *(*pp)++; - switch (new->visibility) + new_fields->visibility = *(*pp)++; + switch (new_fields->visibility) { case VISIBILITY_PRIVATE: case VISIBILITY_PROTECTED: @@ -3172,8 +3171,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, { complaint (&symfile_complaints, _("Unknown visibility `%c' for baseclass"), - new->visibility); - new->visibility = VISIBILITY_PUBLIC; + new_fields->visibility); + new_fields->visibility = VISIBILITY_PUBLIC; } } @@ -3184,7 +3183,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, 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 (new_fields->field, + read_huge_number (pp, ',', &nbits, 0)); if (nbits != 0) return 0; } @@ -3193,8 +3193,8 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type, 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); + new_fields->field.type = read_type (pp, objfile); + new_fields->field.name = type_name_no_tag (new_fields->field.type); /* Skip trailing ';' and bump count of number of fields seen. */ if (**pp == ';') @@ -4344,7 +4344,7 @@ common_block_end (struct objfile *objfile) symbol for the common block name for later fixup. */ int i; struct symbol *sym; - struct pending *new = 0; + struct pending *new_pending = 0; struct pending *next; int j; @@ -4367,7 +4367,7 @@ common_block_end (struct objfile *objfile) 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], &new_pending); } /* Copy however much of COMMON_BLOCK we need. If COMMON_BLOCK is @@ -4376,9 +4376,9 @@ common_block_end (struct objfile *objfile) 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], &new_pending); - SYMBOL_TYPE (sym) = (struct type *) new; + SYMBOL_TYPE (sym) = (struct type *) new_pending; /* Should we be putting local_symbols back to what it was? Does it matter? */ diff --git a/gdb/symtab.c b/gdb/symtab.c index 3660f1a..06997b6 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4050,29 +4050,29 @@ completion_list_add_name (const char *symname, of matches. Note that the name is moved to freshly malloc'd space. */ { - char *new; + char *new_str; if (word == sym_text) { - new = xmalloc (strlen (symname) + 5); - strcpy (new, symname); + new_str = xmalloc (strlen (symname) + 5); + strcpy (new_str, symname); } else if (word > sym_text) { /* Return some portion of symname. */ - new = xmalloc (strlen (symname) + 5); - strcpy (new, symname + (word - sym_text)); + new_str = xmalloc (strlen (symname) + 5); + strcpy (new_str, 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); + new_str = xmalloc (strlen (symname) + (sym_text - word) + 5); + strncpy (new_str, word, sym_text - word); + new_str[sym_text - word] = '\0'; + strcat (new_str, symname); } - VEC_safe_push (char_ptr, return_val, new); + VEC_safe_push (char_ptr, return_val, new_str); } } @@ -4617,30 +4617,30 @@ static void add_filename_to_list (const char *fname, const char *text, const char *word, VEC (char_ptr) **list) { - char *new; + char *new_str; size_t fnlen = strlen (fname); if (word == text) { /* Return exactly fname. */ - new = xmalloc (fnlen + 5); - strcpy (new, fname); + new_str = xmalloc (fnlen + 5); + strcpy (new_str, fname); } else if (word > text) { /* Return some portion of fname. */ - new = xmalloc (fnlen + 5); - strcpy (new, fname + (word - text)); + new_str = xmalloc (fnlen + 5); + strcpy (new_str, 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); + new_str = xmalloc (fnlen + (text - word) + 5); + strncpy (new_str, word, text - word); + new_str[text - word] = '\0'; + strcat (new_str, fname); } - VEC_safe_push (char_ptr, *list, new); + VEC_safe_push (char_ptr, *list, new_str); } static int diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 4e70593..36b2f47 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -338,9 +338,10 @@ find_typedef_in_hash (const struct type_print_options *flags, struct type *t) 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 *new_sym, + struct ui_file *stream) { - LA_PRINT_TYPEDEF (type, new, stream); + LA_PRINT_TYPEDEF (type, new_sym, stream); } /* The default way to print a typedef. */ diff --git a/gdb/value.c b/gdb/value.c index d96d285..216e87c 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1530,13 +1530,13 @@ record_latest_value (struct value *val) i = value_history_count % VALUE_HISTORY_CHUNK; if (i == 0) { - struct value_history_chunk *new + struct value_history_chunk *new_chunk = (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 (new_chunk->values, 0, sizeof new_chunk->values); + new_chunk->next = value_history_chain; + value_history_chain = new_chunk; } value_history_chain->values[i] = val; diff --git a/gdb/varobj.c b/gdb/varobj.c index 01cf3d2..ad42135 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -725,7 +725,7 @@ static void install_dynamic_child (struct varobj *var, VEC (varobj_p) **changed, VEC (varobj_p) **type_changed, - VEC (varobj_p) **new, + VEC (varobj_p) **new_children, VEC (varobj_p) **unchanged, int *cchanged, int index, @@ -737,9 +737,9 @@ install_dynamic_child (struct varobj *var, /* There's no child yet. */ struct varobj *child = varobj_add_child (var, name, value); - if (new) + if (new_children) { - VEC_safe_push (varobj_p, *new, child); + VEC_safe_push (varobj_p, *new_children, child); *cchanged = 1; } } @@ -785,7 +785,7 @@ static int update_dynamic_varobj_children (struct varobj *var, VEC (varobj_p) **changed, VEC (varobj_p) **type_changed, - VEC (varobj_p) **new, + VEC (varobj_p) **new_children, VEC (varobj_p) **unchanged, int *cchanged, int update_children, @@ -921,7 +921,7 @@ update_dynamic_varobj_children (struct varobj *var, gdbpy_print_stack (); install_dynamic_child (var, can_mention ? changed : NULL, can_mention ? type_changed : NULL, - can_mention ? new : NULL, + can_mention ? new_children : NULL, can_mention ? unchanged : NULL, can_mention ? cchanged : NULL, i, xstrdup (name), v); @@ -1689,7 +1689,7 @@ varobj_update (struct varobj **varp, int explicit) { int type_changed = 0; int i; - struct value *new; + struct value *new_val; VEC (varobj_update_result) *stack = NULL; VEC (varobj_update_result) *result = NULL; @@ -1723,15 +1723,15 @@ varobj_update (struct varobj **varp, int explicit) 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)) + new_val = value_of_root (varp, &type_changed); + if (update_type_if_necessary(*varp, new_val)) type_changed = 1; r.varobj = *varp; r.type_changed = type_changed; - if (install_new_value ((*varp), new, type_changed)) + if (install_new_value ((*varp), new_val, type_changed)) r.changed = 1; - if (new == NULL) + if (new_val == NULL) r.status = VAROBJ_NOT_IN_SCOPE; r.value_installed = 1; @@ -1766,15 +1766,15 @@ varobj_update (struct varobj **varp, int explicit) { struct type *new_type; - new = value_of_child (v->parent, v->index); - if (update_type_if_necessary(v, new)) + new_val = value_of_child (v->parent, v->index); + if (update_type_if_necessary(v, new_val)) r.type_changed = 1; - if (new) - new_type = value_type (new); + if (new_val) + new_type = value_type (new_val); else new_type = v->root->lang->type_of_child (v->parent, v->index); - if (varobj_value_has_mutated (v, new, new_type)) + if (varobj_value_has_mutated (v, new_val, new_type)) { /* The children are no longer valid; delete them now. Report the fact that its type changed as well. */ @@ -1786,7 +1786,7 @@ varobj_update (struct varobj **varp, int explicit) r.type_changed = 1; } - if (install_new_value (v, new, r.type_changed)) + if (install_new_value (v, new_val, r.type_changed)) { r.changed = 1; v->updated = 0; @@ -1799,7 +1799,7 @@ varobj_update (struct varobj **varp, int explicit) if (v->dynamic->pretty_printer != NULL) { VEC (varobj_p) *changed = 0, *type_changed = 0, *unchanged = 0; - VEC (varobj_p) *new = 0; + VEC (varobj_p) *new_children = 0; int i, children_changed = 0; if (v->frozen) @@ -1831,14 +1831,15 @@ varobj_update (struct varobj **varp, int explicit) /* 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, + &new_children, &unchanged, &children_changed, 1, v->from, v->to)) { - if (children_changed || new) + if (children_changed || new_children) { r.children_changed = 1; - r.new = new; + r.new_children = new_children; } /* Push in reverse order so that the first child is popped from the work stack first, and so will be diff --git a/gdb/varobj.h b/gdb/varobj.h index e32c6ef..87b747e 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h @@ -85,7 +85,7 @@ typedef struct varobj_update_result_t 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) *new_children; } varobj_update_result; DEF_VEC_O (varobj_update_result); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 7f34ac9..bd19a89 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1039,7 +1039,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst) /* 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 *new_ctx; char *filestring = " _start_ "; /* Name of the current file. */ @@ -1366,13 +1366,13 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst) within_function = 1; - new = push_context (0, fcn_start_addr + off); + new_ctx = push_context (0, fcn_start_addr + off); - new->name = define_symbol + new_ctx->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 (new_ctx->name != NULL) + SYMBOL_SECTION (new_ctx->name) = SECT_OFF_TEXT (objfile); } else if (strcmp (cs->c_name, ".ef") == 0) { @@ -1390,17 +1390,17 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst) within_function = 0; break; } - new = pop_context (); + new_ctx = pop_context (); /* Stack must be empty now. */ - if (context_stack_depth > 0 || new == NULL) + if (context_stack_depth > 0 || new_ctx == NULL) { ef_complaint (cs->c_symnum); within_function = 0; break; } - finish_block (new->name, &local_symbols, new->old_blocks, - new->start_addr, + finish_block (new_ctx->name, &local_symbols, new_ctx->old_blocks, + new_ctx->start_addr, (fcn_cs_saved.c_value + fcn_aux_saved.x_sym.x_misc.x_fsize + ANOFFSET (objfile->section_offsets, @@ -1471,7 +1471,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst) if (strcmp (cs->c_name, ".bb") == 0) { depth++; - new = push_context (depth, + new_ctx = push_context (depth, (cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)))); @@ -1483,8 +1483,8 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst) eb_complaint (cs->c_symnum); break; } - new = pop_context (); - if (depth-- != new->depth) + new_ctx = pop_context (); + if (depth-- != new_ctx->depth) { eb_complaint (cs->c_symnum); break; @@ -1492,14 +1492,15 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst) 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 (new_ctx->name, &local_symbols, + new_ctx->old_blocks, + new_ctx->start_addr, (cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))), objfile); } - local_symbols = new->locals; + local_symbols = new_ctx->locals; } break; -- 1.8.3.1