This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] breakpoint.c, update_static_tracepoint, variable same name as param.


Note, this is just the simple-minded suggestion --
there might actually be a bug hidden here.

Comments?

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]