Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] breakpoint.c, update_static_tracepoint, variable same name as param.
@ 2011-03-01 22:51 Michael Snyder
  2011-03-02 16:12 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2011-03-01 22:51 UTC (permalink / raw)
  To: gdb-patches, Pedro Alves

[-- 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.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-07 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-01 22:51 [RFA] breakpoint.c, update_static_tracepoint, variable same name as param Michael Snyder
2011-03-02 16:12 ` Pedro Alves
2011-03-07 20:27   ` Michael Snyder
2011-03-07 20:48     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox