From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Pedro Alves <pedro@codesourcery.com>
Subject: [RFA] breakpoint.c, update_static_tracepoint, variable same name as param.
Date: Tue, 01 Mar 2011 22:51:00 -0000 [thread overview]
Message-ID: <4D6D7881.8000304@vmware.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 106 bytes --]
Note, this is just the simple-minded suggestion --
there might actually be a bug hidden here.
Comments?
[-- Attachment #2: shadow9.txt --]
[-- Type: text/plain, Size: 2382 bytes --]
2011-03-01 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* breakpoint.c (update_static_tracepoint): Rename inner block
var which shadows function parameter.
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.546
diff -u -p -u -p -r1.546 breakpoint.c
--- breakpoint.c 1 Mar 2011 02:16:56 -0000 1.546
+++ breakpoint.c 1 Mar 2011 22:49:01 -0000
@@ -10301,7 +10301,7 @@ update_static_tracepoint (struct breakpo
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;
@@ -10314,11 +10314,11 @@ update_static_tracepoint (struct breakpo
"found at previous line number"),
b->number, b->static_trace_marker_id);
- init_sal (&sal);
+ init_sal (&sal2);
- sal.pc = marker->address;
+ sal2.pc = marker->address;
- sal = find_pc_line (marker->address, 0);
+ sal2 = find_pc_line (marker->address, 0);
sym = find_pc_sect_function (marker->address, NULL);
ui_out_text (uiout, "Now in ");
if (sym)
@@ -10327,31 +10327,31 @@ update_static_tracepoint (struct breakpo
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. */
next reply other threads:[~2011-03-01 22:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 22:51 Michael Snyder [this message]
2011-03-02 16:12 ` Pedro Alves
2011-03-07 20:27 ` Michael Snyder
2011-03-07 20:48 ` 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=4D6D7881.8000304@vmware.com \
--to=msnyder@vmware.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