This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
REPOST [patch] Fix to "Assertion failed: Could not find variable object..."
- To: insight at sources dot redhat dot com, Jim Ingham <jingham at apple dot com>
- Subject: REPOST [patch] Fix to "Assertion failed: Could not find variable object..."
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Thu, 29 Mar 2001 17:20:23 -0500
- Organization: Red Hat , Inc. - Toronto
(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