This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
[PATCH] insight/293
- From: Keith Seitz <keiths at redhat dot com>
- To: insight <insight at sourceware dot org>
- Date: Thu, 30 Nov 2006 19:34:16 -0800
- Subject: [PATCH] insight/293
Hi,
Well, this is embarrassing. The variable windows have been very broken
for a very long time. They were keeping varobj references around long
after they disappeared. This would cause file changes and restarts to crash.
Keith
ChangeLog
2006-11-30 Keith Seitz <keiths@redhat.com>
insight/293:
* library/watch.tcl (no_inferior): Remove all varobjs and
clear the display.
(clear_file): Call no_inferior. Update comments.
* library/locals.tcl: Remove unused variables "Running"
and "Variables". Changed throughout.
(no_inferior): Delete the current frame and clear the display.
(clear_file): Call no_inferior. Update comments.
(context_switch): To delete an Itcl object, one uses
"delete object" not "destroy".
Index: library/locals.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/locals.tcl,v
retrieving revision 1.9
diff -u -p -r1.9 locals.tcl
--- library/locals.tcl 23 Dec 2005 18:26:50 -0000 1.9
+++ library/locals.tcl 1 Dec 2006 03:31:26 -0000
@@ -1,5 +1,5 @@
# Local Variable Window for Insight.
-# Copyright (C) 2002, 2003 Red Hat
+# Copyright (C) 2002, 2003, 2006 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
@@ -42,14 +42,12 @@ itcl::class LocalsWin {
# ------------------------------------------------------------------
method busy {event} {
debug
- set Running 1
cursor watch
}
# Re-enable the UI
method idle {event} {
debug
- set Running 0
cursor {}
}
@@ -60,8 +58,9 @@ itcl::class LocalsWin {
method no_inferior {} {
debug
cursor {}
- set Running 0
+ catch {delete object $_frame}
set _frame {}
+ $tree remove all
}
# ------------------------------------------------------------------
@@ -90,12 +89,11 @@ itcl::class LocalsWin {
# ------------------------------------------------------------------
# METHOD: clear_file - Clear out state so that a new executable
- # can be loaded. For LocalWins, this means deleting
- # the Variables list.
+ # can be loaded. For LocalWins, this means doing
+ # everything that no_inferior does.
# ------------------------------------------------------------------
method clear_file {} {
- debug
- set Variables {}
+ no_inferior
}
# ------------------------------------------------------------------
@@ -109,10 +107,6 @@ itcl::class LocalsWin {
remove_hook gdb_no_inferior_hook "$this no_inferior"
remove_hook gdb_clear_file_hook [code $this clear_file]
remove_hook file_changed_hook [code $this clear_file]
-
- foreach var $Variables {
- $var delete
- }
}
method context_switch {} {
@@ -124,7 +118,7 @@ itcl::class LocalsWin {
if {$err && $_frame != ""} {
# No current frame
debug "no current frame"
- catch {destroy $_frame}
+ catch {delete object $_frame}
set _frame {}
return 1
} elseif {$current_frame == "" && $_frame == ""} {
@@ -158,7 +152,6 @@ itcl::class LocalsWin {
# delete variables in tree
$tree remove all
- set Variables {}
if {$_frame != ""} {
$tree add [$_frame variables]
@@ -172,8 +165,6 @@ itcl::class LocalsWin {
}
protected variable Entry
- protected variable Variables {}
protected variable tree
- protected variable Running
protected variable _frame {}
}
Index: library/watch.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/watch.tcl,v
retrieving revision 1.10
diff -u -p -r1.10 watch.tcl
--- library/watch.tcl 23 Dec 2005 18:26:50 -0000 1.10
+++ library/watch.tcl 1 Dec 2006 03:31:26 -0000
@@ -1,5 +1,5 @@
# Watch window for Insight.
-# Copyright (C) 2002, 2003 Red Hat
+# Copyright (C) 2002, 2003, 2006 Red Hat
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
@@ -59,6 +59,10 @@ itcl::class WatchWin {
debug
cursor {}
set Running 0
+ foreach var $Watched {
+ $var delete
+ }
+ $tree remove all
}
# ------------------------------------------------------------------
@@ -114,12 +118,12 @@ itcl::class WatchWin {
# ------------------------------------------------------------------
# METHOD: clear_file - Clear out state so that a new executable
- # can be loaded. For WatchWins, this means deleting
- # the Watched list.
+ # can be loaded. For WatchWins, this means doing
+ # everything that no_inferior does.
# ------------------------------------------------------------------
method clear_file {} {
debug
- set Watched {}
+ no_inferior
}
# ------------------------------------------------------------------