From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9425 invoked by alias); 5 Dec 2011 11:30:50 -0000 Received: (qmail 9415 invoked by uid 22791); 5 Dec 2011 11:30:49 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Dec 2011 11:30:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 402BB2BAC47; Mon, 5 Dec 2011 06:30:36 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id h1e2ywa2ZrYF; Mon, 5 Dec 2011 06:30:36 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 005C92BABF9; Mon, 5 Dec 2011 06:30:35 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 0108D145615; Mon, 5 Dec 2011 03:30:32 -0800 (PST) Date: Mon, 05 Dec 2011 11:30:00 -0000 From: Joel Brobecker To: Andrey Smirnov Cc: gdb-patches@sourceware.org, Pedro Alves Subject: Re: [PATCH 034/238] [misc.] Fix -Wshadow warnings. Message-ID: <20111205113032.GK2777@adacore.com> References: <4ECC3FD2.1000309@earthlink.net> <1322493561-29643-1-git-send-email-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1322493561-29643-1-git-send-email-andrew.smirnov@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-SW-Source: 2011-12/txt/msg00125.txt.bz2 > * breakpoint.c (update_static_tracepoint): Rename `sal' to > `sal2'(-Wshadow). Looks OK to me. But Pedro might comment on the new variable name (sal->sal2). (weird mis-alignment of the ChangeLog, but I assume that'll be fixed by the time it gets inserted in the ChangeLog file). > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 91a4224..9b359aa 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -11640,26 +11640,26 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal) > > if (!VEC_empty(static_tracepoint_marker_p, markers)) > { > - struct symtab_and_line sal; > + struct symtab_and_line sal2; > struct symbol *sym; > - struct static_tracepoint_marker *marker; > + struct static_tracepoint_marker *tpmarker; > struct ui_out *uiout = current_uiout; > > - marker = VEC_index (static_tracepoint_marker_p, markers, 0); > + tpmarker = VEC_index (static_tracepoint_marker_p, markers, 0); > > xfree (tp->static_trace_marker_id); > - tp->static_trace_marker_id = xstrdup (marker->str_id); > + tp->static_trace_marker_id = xstrdup (tpmarker->str_id); > > warning (_("marker for static tracepoint %d (%s) not " > "found at previous line number"), > b->number, tp->static_trace_marker_id); > > - init_sal (&sal); > + init_sal (&sal2); > > - sal.pc = marker->address; > + sal2.pc = tpmarker->address; > > - sal = find_pc_line (marker->address, 0); > - sym = find_pc_sect_function (marker->address, NULL); > + sal2 = find_pc_line (tpmarker->address, 0); > + sym = find_pc_sect_function (tpmarker->address, NULL); > ui_out_text (uiout, "Now in "); > if (sym) > { > @@ -11667,36 +11667,36 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal) > SYMBOL_PRINT_NAME (sym)); > ui_out_text (uiout, " at "); > } > - ui_out_field_string (uiout, "file", sal.symtab->filename); > + ui_out_field_string (uiout, "file", sal2.symtab->filename); > ui_out_text (uiout, ":"); > > if (ui_out_is_mi_like_p (uiout)) > { > - char *fullname = symtab_to_fullname (sal.symtab); > + char *fullname = symtab_to_fullname (sal2.symtab); > > if (fullname) > ui_out_field_string (uiout, "fullname", fullname); > } > > - ui_out_field_int (uiout, "line", sal.line); > + ui_out_field_int (uiout, "line", sal2.line); > ui_out_text (uiout, "\n"); > > - b->line_number = sal.line; > + b->line_number = sal2.line; > > xfree (b->source_file); > if (sym) > - b->source_file = xstrdup (sal.symtab->filename); > + b->source_file = xstrdup (sal2.symtab->filename); > else > b->source_file = NULL; > > xfree (b->addr_string); > b->addr_string = xstrprintf ("%s:%d", > - sal.symtab->filename, b->line_number); > + sal2.symtab->filename, b->line_number); > > /* Might be nice to check if function changed, and warn if > so. */ > > - release_static_tracepoint_marker (marker); > + release_static_tracepoint_marker (tpmarker); > } > } > return sal; > -- > 1.7.5.4 -- Joel