summaryrefslogtreecommitdiff
path: root/gdb/gdbtk/library
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2000-03-28 01:59:40 +0000
committerJim Ingham <jingham@apple.com>2000-03-28 01:59:40 +0000
commita7046152a9ebf199b3e5710cd5c75773e8d48a1f (patch)
treef999172302d269b5b53d2195fb7fedb3f759b15b /gdb/gdbtk/library
parent7011ddd55b6a61b042d05cea46fb1deb97266561 (diff)
downloadgdb-a7046152a9ebf199b3e5710cd5c75773e8d48a1f.tar.gz
Reintroduce the code that saves away window state, and restores it
when you restart gdbtk. 2000-03-27 James Ingham <jingham@leda.cygnus.com> * interface.tcl (gdbtk_quit): Let the window manager store away the list of active windows before quitting. (gdbtk_tcl_preloop): Open all the windows that were active in the former session. * prefs.tcl (pref_set_defaults): Set the default value of the "gdb/window/active" pref. Stores the list of active windows. * managedwin.itb (ManagedWin::pickle): New method - store away instructions to recreate this window. (ManagedWin::shutdown): New Method - run through the active windows pickling them all. (ManagedWin::startup): Restore all the saved active windows. * managedwin.ith: Declare pickle, shutdown & startup. * tclIndex: regenerate.
Diffstat (limited to 'gdb/gdbtk/library')
-rw-r--r--gdb/gdbtk/library/ChangeLog16
-rw-r--r--gdb/gdbtk/library/interface.tcl8
-rw-r--r--gdb/gdbtk/library/managedwin.itb36
-rw-r--r--gdb/gdbtk/library/managedwin.ith3
-rw-r--r--gdb/gdbtk/library/prefs.tcl11
-rw-r--r--gdb/gdbtk/library/tclIndex7
6 files changed, 77 insertions, 4 deletions
diff --git a/gdb/gdbtk/library/ChangeLog b/gdb/gdbtk/library/ChangeLog
index 9c8e629d93b..c1e61d0fb02 100644
--- a/gdb/gdbtk/library/ChangeLog
+++ b/gdb/gdbtk/library/ChangeLog
@@ -1,3 +1,19 @@
+2000-03-27 James Ingham <jingham@leda.cygnus.com>
+
+ * interface.tcl (gdbtk_quit): Let the window manager store away
+ the list of active windows before quitting.
+ (gdbtk_tcl_preloop): Open all the windows that were active in the
+ former session.
+ * prefs.tcl (pref_set_defaults): Set the default value of the
+ "gdb/window/active" pref. Stores the list of active windows.
+ * managedwin.itb (ManagedWin::pickle): New method - store away
+ instructions to recreate this window.
+ (ManagedWin::shutdown): New Method - run through the active windows
+ pickling them all.
+ (ManagedWin::startup): Restore all the saved active windows.
+ * managedwin.ith: Declare pickle, shutdown & startup.
+ * tclIndex: regenerate.
+
2000-03-10 James Ingham <jingham@leda.cygnus.com>
* targetselection.ith (get_target_list): Should be a proc, since
diff --git a/gdb/gdbtk/library/interface.tcl b/gdb/gdbtk/library/interface.tcl
index b7b9ddf858f..248d1fec535 100644
--- a/gdb/gdbtk/library/interface.tcl
+++ b/gdb/gdbtk/library/interface.tcl
@@ -93,8 +93,8 @@ proc gdbtk_tcl_preloop { } {
# then we will have called pre_add_symbol, which would set us to busy,
# but not the corresponding post_add_symbol. Do this here just in case...
after idle gdbtk_idle
- set src [ManagedWin::open SrcWin]
- debug "In preloop, with src: \"$src\" & error: \"$::errorInfo\""
+ ManagedWin::startup
+
SrcWin::point_to_main
set msg ""
catch {gdb_cmd "info files"} msg
@@ -102,6 +102,8 @@ proc gdbtk_tcl_preloop { } {
if {[regexp {Symbols from "(.*)"\.} $line1 dummy name]} {
set gdb_exe_name $name
}
+
+
gdbtk_update
}
@@ -211,6 +213,7 @@ proc gdbtk_quit_check {} {
# ------------------------------------------------------------------
proc gdbtk_quit {} {
if {[gdbtk_quit_check]} {
+ ManagedWin::shutdown
pref_save
gdb_force_quit
}
@@ -1053,6 +1056,7 @@ proc run_executable { {auto_start 1} } {
}
}
+ #
# Run
if {$auto_start} {
diff --git a/gdb/gdbtk/library/managedwin.itb b/gdb/gdbtk/library/managedwin.itb
index bdecd1020f7..e082f090fa2 100644
--- a/gdb/gdbtk/library/managedwin.itb
+++ b/gdb/gdbtk/library/managedwin.itb
@@ -25,6 +25,13 @@ body ManagedWin::window_name {wname {iname ""}} {
}
}
+# ------------------------------------------------------------
+# pickle - This is the base class pickle method. It returns a
+# a command that can be used to recreate this particular window.
+# ------------------------------------------------------------
+body ManagedWin::pickle {} {
+ return [list ManagedWin::open [namespace tail [info class]]]
+}
body ManagedWin::reveal {} {
# Do this update to flush all changes before deiconifying the window.
@@ -53,6 +60,35 @@ body ManagedWin::restart {} {
}
}
+# ------------------------------------------------------------------
+# shutdown - This writes all the active windows to the preferences file,
+# so they can be restored at startup.
+# FIXME: Currently assumes only ONE window per type...
+# ------------------------------------------------------------------
+
+body ManagedWin::shutdown {} {
+ set activeWins {}
+ foreach win $manage_active {
+ if {[$win isa ManagedWin]} {
+ lappend activeWins [$win pickle]
+ }
+ }
+ pref set gdb/window/active $activeWins
+}
+
+# ------------------------------------------------------------------
+# startup - This restores all the windows that were opened at shutdown.
+# FIXME: Currently assumes only ONE window per type...
+# ------------------------------------------------------------------
+
+body ManagedWin::startup {} {
+ debug "Got active list [pref get gdb/window/active]"
+
+ foreach cmd [pref get gdb/window/active] {
+ eval $cmd
+ }
+}
+
body ManagedWin::open_dlg {class args} {
set newwin [eval _open $class $args]
diff --git a/gdb/gdbtk/library/managedwin.ith b/gdb/gdbtk/library/managedwin.ith
index a25cee41e9a..521320ee1c7 100644
--- a/gdb/gdbtk/library/managedwin.ith
+++ b/gdb/gdbtk/library/managedwin.ith
@@ -20,6 +20,7 @@ class ManagedWin {
method destroy_toplevel {}
method quit_if_last {} {return 1}
method enable {on}
+ method pickle {}
method reveal {}
method window_name {wname {iname ""}}
@@ -30,6 +31,8 @@ class ManagedWin {
proc open_dlg {class args}
proc init {}
proc restart {}
+ proc startup {}
+ proc shutdown {}
}
protected {
diff --git a/gdb/gdbtk/library/prefs.tcl b/gdb/gdbtk/library/prefs.tcl
index bc69b131f53..668fbddec50 100644
--- a/gdb/gdbtk/library/prefs.tcl
+++ b/gdb/gdbtk/library/prefs.tcl
@@ -171,7 +171,8 @@ proc pref_save {{win {}}} {
}
#now loop through all sections writing out values
- lappend secs load console src reg stack locals watch bp search process geometry help browser kod
+ lappend secs load console src reg stack locals watch bp search \
+ process geometry help browser kod window
foreach section $secs {
puts $fd "\[$section\]"
@@ -251,6 +252,9 @@ proc pref_set_defaults {} {
pref define gdb/load/port "/dev/ttyS0"
}
+ # The list of active windows:
+ pref define gdb/window/active {}
+
# Console defaults
pref define gdb/console/prompt "(gdb) "
pref define gdb/console/deleteLeft 1
@@ -263,7 +267,6 @@ proc pref_set_defaults {} {
pref define gdb/src/PC_TAG green
pref define gdb/src/STACK_TAG gold
pref define gdb/src/BROWSE_TAG \#9595e2
- pref define gdb/src/active 1
pref define gdb/src/handlebg red
pref define gdb/src/bp_fg red
pref define gdb/src/temp_bp_fg orange
@@ -334,6 +337,10 @@ proc pref_set_defaults {} {
# Various possible "main" functions. What's for Java?
pref define gdb/main_names [list MAIN___ MAIN__ main]
+
+ # These are the classes of warning dialogs, and whether the user plans
+ # to ignore them.
+ pref define gdb/warnings/signal 0
}
# This traces the global/fixed font and forces src-font to
diff --git a/gdb/gdbtk/library/tclIndex b/gdb/gdbtk/library/tclIndex
index 35d05d6485d..c44b0d9e7c9 100644
--- a/gdb/gdbtk/library/tclIndex
+++ b/gdb/gdbtk/library/tclIndex
@@ -8,6 +8,9 @@
set auto_index(About) [list source [file join $dir about.tcl]]
set auto_index(ActionDlg) [list source [file join $dir actiondlg.tcl]]
+set auto_index(::tty::_xterm_rgb) [list source [file join $dir inferior_term.tcl]]
+set auto_index(::tty::create) [list source [file join $dir inferior_term.tcl]]
+set auto_index(::tty::destroy) [list source [file join $dir inferior_term.tcl]]
set auto_index(gdbtk_tcl_preloop) [list source [file join $dir interface.tcl]]
set auto_index(gdbtk_busy) [list source [file join $dir interface.tcl]]
set auto_index(gdbtk_update) [list source [file join $dir interface.tcl]]
@@ -107,6 +110,7 @@ set auto_index(list_element_strcmp) [list source [file join $dir util.tcl]]
set auto_index(VariableWin) [list source [file join $dir variables.tcl]]
set auto_index(::VariableWin::getLocals) [list source [file join $dir variables.tcl]]
set auto_index(WarningDlg) [list source [file join $dir warning.tcl]]
+set auto_index(::WarningDlg::destructor) [list source [file join $dir warning.tcl]]
set auto_index(::WarningDlg::constructor) [list source [file join $dir warning.tcl]]
set auto_index(WatchWin) [list source [file join $dir watch.tcl]]
set auto_index(AttachDlg) [list source [file join $dir attachdlg.ith]]
@@ -310,6 +314,8 @@ set auto_index(::ManagedWin::reconfig) [list source [file join $dir managedwin.i
set auto_index(::ManagedWin::window_name) [list source [file join $dir managedwin.itb]]
set auto_index(::ManagedWin::reveal) [list source [file join $dir managedwin.itb]]
set auto_index(::ManagedWin::restart) [list source [file join $dir managedwin.itb]]
+set auto_index(::ManagedWin::shutdown) [list source [file join $dir managedwin.itb]]
+set auto_index(::ManagedWin::startup) [list source [file join $dir managedwin.itb]]
set auto_index(::ManagedWin::open_dlg) [list source [file join $dir managedwin.itb]]
set auto_index(::ManagedWin::open) [list source [file join $dir managedwin.itb]]
set auto_index(::ManagedWin::_open) [list source [file join $dir managedwin.itb]]
@@ -424,6 +430,7 @@ set auto_index(::SrcTextWin::_mtime_changed) [list source [file join $dir srctex
set auto_index(::SrcTextWin::FillSource) [list source [file join $dir srctextwin.itb]]
set auto_index(::SrcTextWin::FillAssembly) [list source [file join $dir srctextwin.itb]]
set auto_index(::SrcTextWin::FillMixed) [list source [file join $dir srctextwin.itb]]
+set auto_index(::SrcTextWin::_highlightAsmLine) [list source [file join $dir srctextwin.itb]]
set auto_index(::SrcTextWin::location) [list source [file join $dir srctextwin.itb]]
set auto_index(::SrcTextWin::LoadFile) [list source [file join $dir srctextwin.itb]]
set auto_index(::SrcTextWin::display_line) [list source [file join $dir srctextwin.itb]]