From: Joel Brobecker <brobecker@adacore.com>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: gdb-patches@sourceware.org, Pedro Alves <pedro@codesourcery.com>
Subject: Re: [PATCH 034/238] [misc.] Fix -Wshadow warnings.
Date: Mon, 05 Dec 2011 11:30:00 -0000 [thread overview]
Message-ID: <20111205113032.GK2777@adacore.com> (raw)
In-Reply-To: <1322493561-29643-1-git-send-email-andrew.smirnov@gmail.com>
> * 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
next prev parent reply other threads:[~2011-12-05 11:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 13:25 [PATCH 35/358] Fix -Wsahdow warnings Andrey Smirnov
2011-11-22 19:19 ` Tom Tromey
2011-11-23 0:35 ` Stan Shebs
2011-11-23 4:46 ` Andrey Smirnov
2011-11-28 15:19 ` [PATCH 034/238] [misc.] Fix -Wshadow warnings Andrey Smirnov
2011-12-05 11:30 ` Joel Brobecker [this message]
2011-12-05 13:27 ` Andrey Smirnov
2011-12-05 13:31 ` Joel Brobecker
2011-12-06 18:25 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111205113032.GK2777@adacore.com \
--to=brobecker@adacore.com \
--cc=andrew.smirnov@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox