This is the mail archive of the insight@sources.redhat.com 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]

Re: [RFA] gdbtk_set_result


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



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