From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Seitz To: "Martin M. Hunt" Cc: Insight Mailing List Subject: Re: [RFA] gdbtk_set_result Date: Sun, 04 Nov 2001 11:25:00 -0000 Message-id: References: <200111030001.QAA15373@cygnus.com> X-SW-Source: 2001-q4/msg00266.html On Fri, 2 Nov 2001, Martin M. Hunt wrote: > This patch uses the new function gdbtk_set_result() to correctly set return > strings on errors. Wow, this looks great. I just have one or two questions... > Index: gdbtk-varobj.c > =================================================================== > RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-varobj.c,v > retrieving revision 1.9 > diff -u -p -r1.9 gdbtk-varobj.c > --- gdbtk-varobj.c 2001/10/17 20:35:32 1.9 > +++ gdbtk-varobj.c 2001/11/02 23:59:42 > @@ -597,9 +595,7 @@ variable_value (interp, objc, objv, var) > s = Tcl_GetStringFromObj (objv[2], NULL); > if (!varobj_set_value (var, s)) > { > - r = error_last_message (); > - Tcl_SetObjResult (interp, Tcl_NewStringObj (r, -1)); > - FREEIF (r); > + gdbtk_set_result (interp, "%s", error_last_message()); > return TCL_ERROR; > } > } This doesn't look right. Don't we still need to free error_last_message's return result? Otherwise, this is just fantastic! I get to knock something off my TODO list!! Yippee!!! Keith