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]

Re: [MI non-stop 04/11] Implement --thread and --frame.


On Sunday 13 July 2008 00:14:42 Ulrich Weigand wrote:
> Vladimir Prus wrote:
> 
> >  mi_cmd_execute (struct mi_parse *parse)
> >  {
> >    struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
> > +  char *thread_str;
> > +  char *frame_str;
> > +  int thread;
> > +  int i;
> 
> [snip]
> 
> > +	error (_("Invalid frame id: %s"), frame_str);
> 
> This variable is used uninitialized, which breaks the -Werror
> build for me.
> 
> (Also, it seems the other local variables introduced by this
> patch are never used ...)

Apologies. I've checked in the attached to fix this.

- Volodya

Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.9550
diff -u -p -r1.9550 ChangeLog
--- gdb/ChangeLog	12 Jul 2008 17:10:59 -0000	1.9550
+++ gdb/ChangeLog	13 Jul 2008 03:51:22 -0000
@@ -1,3 +1,8 @@
+2008-07-13  Vladimir Prus  <vladimir@codesourcery.com>
+
+	* mi/mi-main.c (mi_cmd_execute): Remove unused variable.
+	Fix printing of frame, when frame is wrong.
+	
 2008-07-12  Vladimir Prus  <vladimir@codesourcery.com>
 
 	Implement -exec-continue/-exec-interrupt --all.
Index: gdb/mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.126
diff -u -p -r1.126 mi-main.c
--- gdb/mi/mi-main.c	12 Jul 2008 17:10:59 -0000	1.126
+++ gdb/mi/mi-main.c	13 Jul 2008 03:51:22 -0000
@@ -1068,9 +1068,6 @@ static void
 mi_cmd_execute (struct mi_parse *parse)
 {
   struct cleanup *cleanup;
-  char *thread_str;
-  char *frame_str;
-  int thread;
   int i;
   free_all_values ();
 
@@ -1101,7 +1098,7 @@ mi_cmd_execute (struct mi_parse *parse)
 	/* find_relative_frame was successful */
 	select_frame (fid);
       else
-	error (_("Invalid frame id: %s"), frame_str);
+	error (_("Invalid frame id: %d"), frame);
     }
   
   if (parse->cmd->argv_func != NULL)

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