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]

REPOST [patch] Fix to "Assertion failed: Could not find variable object..."


(forgot the ChangeLog entry)

The Tcl code in gdbtk-varobj.c used to cache the varobj handles.  But with the addition of the code to handle the
USE_SELECTED_FRAME type of variables, the handles can change between invocations.  The only thing that remain valid
at all times is the token that identifies a varobj.  It can be used to retrieve the handle in a very efficient way
(hash table), so we can just get the new handle every time.

This simple patch gets rid of this problem.  I have checked it in.

2001-03-29  Fernando Nasser  <fnasser@redhat.com>

	* gdbtk-varobj.c (variable_obj_command): Do not cache varobj handles as
	they may change -- use varobj_get_handle() instead.


Index: generic/gdbtk-varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-varobj.c,v
retrieving revision 1.5
diff -c -p -r1.5 gdbtk-varobj.c
*** gdbtk-varobj.c      2000/09/16 00:50:25     1.5
--- gdbtk-varobj.c      2001/03/29 21:54:34
*************** variable_obj_command (clientData, interp
*** 201,208 ****
      "update",
      NULL
    };
!   struct varobj *var = (struct varobj *) clientData;
    int index, result;
  
    if (objc < 2)
      {
--- 201,216 ----
      "update",
      NULL
    };
!   struct varobj *var;
!   char *varobj_name;
    int index, result;
+   
+   /* Get the current handle for this variable token (name). */
+   varobj_name = Tcl_GetStringFromObj (objv[0], NULL);
+   if (varobj_name == NULL)
+     return TCL_ERROR;
+   var = varobj_get_handle (varobj_name);
+   
  
    if (objc < 2)
      {
                                                                               





-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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