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]
Other format: [Raw text]

Re: Heads Up: selected_frame_level and selected_frame removal


On Sun, 14 Apr 2002, Andrew Cagney wrote:

> I've attached a rather brutal ``fix''.  I've no idea if it is correct -
> it does compile though.

 static void
 gdbtk_selected_frame_changed (int level)
 {
+  gdbtk_selected_frame_level = level;
   Tcl_UpdateLinkedVar (gdbtk_interp, "gdb_selected_frame_level");
 }

I would just whack all of this and set a global variable. Currently, we
"link" the C variable selected_frame_level with the interpreter global
variable "gdb_selected_frame_level". What this really means is that if we
change either the tcl variable, gdb_selected_frame_level, Tcl will change
gdb's global "selected_frame_level", too. I don't think this is really
what we do. This variable is really only read only, and it is certainly
not possible (or desirable) to change gdb's variable thiw way.

So I would just whack all the selected_frame_level stuff altogether and
simply set a global variable in gdbtk_selected_frame_changed:

#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 1
   char *a;
   xasprintf (&a, "%d", level)
   Tcl_SetVar (gdbtk_interp, "gdb_selected_frame_level", a,
               TCL_GLOBAL_ONLY);
   xfree (a);
#else
   Tcl_SetVar2Ex (gdbtk_interp, "gdb_selected_frame_level",
                   NULL, Tcl_NewIntObj (level), TCL_GLOBAL_ONLY);
#endif


Let me know when this needs to be done, and I'll do it for you.

Keith



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