This is the mail archive of the insight@sourceware.org mailing list for the Insight 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: [OBV] Fix gdbtk/generic/gdbtk-varobj.c compilation failure


Thanks for catching that error, Tom.

  I still checked that one also as obvious,
despite the fact that my error probably means that
I was wrong to consider it as obvious in the first place :(
  
Pierre Muller
Pascal language support maintainer for GDB


2009-09-17  Pierre Muller  <muller@ics.u-strasbg.fr>

        * generic/gdbtk-varobj.c (variable_children): Initialize new locals
        used in varobj_list_children function call.



Index: generic/gdbtk-varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-varobj.c,v
retrieving revision 1.24
diff -u -p -r1.24 gdbtk-varobj.c
--- generic/gdbtk-varobj.c      16 Sep 2009 09:46:58 -0000      1.24
+++ generic/gdbtk-varobj.c      17 Sep 2009 06:59:31 -0000
@@ -420,6 +420,9 @@ variable_children (Tcl_Interp *interp, s

   list = Tcl_NewListObj (0, NULL);

+  from = -1;
+  to = -1;
+
   children = varobj_list_children (var, &from, &to);

   for (ix = from; ix < to && VEC_iterate (varobj_p, children, ix, child);
++ix)


> -----Message d'origine-----
> De?: insight-owner@sourceware.org [mailto:insight-owner@sourceware.org]
> De la part de Tom Tromey
> Envoyé?: Wednesday, September 16, 2009 6:32 PM
> À?: Pierre Muller
> Cc?: insight@sourceware.org
> Objet?: Re: [OBV] Fix gdbtk/generic/gdbtk-varobj.c compilation failure
> 
> >>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
> 
> Pierre> +  int ix, from, to;
> 
> Pierre>    list = Tcl_NewListObj (0, NULL);
> 
> Pierre> -  children = varobj_list_children (var);
> Pierre> +  children = varobj_list_children (var, &from, &to);
> 
> You have to initialize from and to first -- they are in/out parameters.
> -1 is the correct initial value to use.
> 
> Tom


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