This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

[patch] Fix use of stale handle in mi-cmd-var.c


I forgot this bit in a patch I've committed ages ago.
Now it is checked in.

	* mi-cmd-var.c (varobj_update_one): Get a new handle if type changed.


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9
Index: mi-cmd-var.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-var.c,v
retrieving revision 1.8
diff -c -p -r1.8 mi-cmd-var.c
*** mi-cmd-var.c	2001/03/06 08:21:45	1.8
--- mi-cmd-var.c	2001/05/11 07:04:48
*************** varobj_update_one (struct varobj *var)
*** 460,465 ****
--- 460,466 ----
    struct varobj **changelist;
    struct varobj **cc;
    int nc;
+   char *varname = varobj_get_objname(var);
  
    nc = varobj_update (var, &changelist);
  
*************** varobj_update_one (struct varobj *var)
*** 477,482 ****
--- 478,484 ----
      }
    else if (nc == -2)
      {
+       var = varobj_get_handle (varname);
        ui_out_field_string (uiout, "name", varobj_get_objname (var));
        ui_out_field_string (uiout, "in_scope", "true");
        ui_out_field_string (uiout, "new_type", varobj_get_type(var));

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