summaryrefslogtreecommitdiff
path: root/gdb/gdbtk
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2002-08-14 18:10:49 +0000
committerKeith Seitz <keiths@redhat.com>2002-08-14 18:10:49 +0000
commit994d45b6a17f30653d6e2d3e7c693ac1f45d7cda (patch)
treeb355007c681f904b28c3fdd6014a06d891535ba8 /gdb/gdbtk
parent14f8eb1e6259fdd414309c42f5faf039006d24e7 (diff)
downloadgdb-994d45b6a17f30653d6e2d3e7c693ac1f45d7cda.tar.gz
* library/srcbar.itcl (create_plugin_menu): Deal with
multi plugin directories. Catch any errors that might occur reading plugin.tcl. * library/main.tcl: Add plugins from new default directory. (INSIGHT_PLUGINS): New environment variable to point to other plugin directories.
Diffstat (limited to 'gdb/gdbtk')
-rw-r--r--gdb/gdbtk/ChangeLog9
-rw-r--r--gdb/gdbtk/library/main.tcl18
-rw-r--r--gdb/gdbtk/library/srcbar.itcl21
3 files changed, 34 insertions, 14 deletions
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog
index c628f83dbf1..8521b1f9703 100644
--- a/gdb/gdbtk/ChangeLog
+++ b/gdb/gdbtk/ChangeLog
@@ -1,5 +1,14 @@
2002-08-14 Keith Seitz <keiths@redhat.com>
+ * library/srcbar.itcl (create_plugin_menu): Deal with
+ multi plugin directories.
+ Catch any errors that might occur reading plugin.tcl.
+ * library/main.tcl: Add plugins from new default directory.
+ (INSIGHT_PLUGINS): New environment variable to point to other
+ plugin directories.
+
+2002-08-14 Keith Seitz <keiths@redhat.com>
+
* library/plugins: Removed.
* plugins/: New folder to hold plugins.
* Makefile.am, Makefile.in, aclocal.m4, configure,
diff --git a/gdb/gdbtk/library/main.tcl b/gdb/gdbtk/library/main.tcl
index 4ba7f713834..dc778284d3f 100644
--- a/gdb/gdbtk/library/main.tcl
+++ b/gdb/gdbtk/library/main.tcl
@@ -33,15 +33,23 @@
# Note: GDBTK_LIBRARY will be set in tcl_findLibrary before main.tcl is called.
set gdb_plugins ""
-
if {[info exists auto_path]} {
if {[lsearch -exact $auto_path $GDBTK_LIBRARY] < 0} {
lappend auto_path $GDBTK_LIBRARY
}
- # In any case, add the plugins directory if it exists
- if {[file exists [file join $GDBTK_LIBRARY plugins]]} {
- set gdb_plugins [file join $GDBTK_LIBRARY plugins]
- lappend auto_path $gdb_plugins
+
+ # Add default plugins directory, which will be [name of exe]/../../lib/insight1.0
+ set exename [info nameofexecutable]
+ set dir [file join [file dirname [file dirname $exename]] lib insight1.0]
+ if {[file exists $dir]} {
+ lappend gdb_plugins $dir
+ lappend auto_path $dir
+ }
+ # Add any user-specified plugins directories
+ if {[info exists env(INSIGHT_PLUGINS)]} {
+ set dirs [split $env(INSIGHT_PLUGINS) :]
+ lappend gdb_plugins $dirs
+ lappend auto_path $dirs
}
}
diff --git a/gdb/gdbtk/library/srcbar.itcl b/gdb/gdbtk/library/srcbar.itcl
index dbfb821c7e9..8bb0e0a6d6f 100644
--- a/gdb/gdbtk/library/srcbar.itcl
+++ b/gdb/gdbtk/library/srcbar.itcl
@@ -428,17 +428,20 @@ class SrcBar {
private method create_plugin_menu {} {
global gdb_plugins
- if {$gdb_plugins != ""} {
- $Menu add menubutton plugin "PlugIn" 4
- set plugins_available 0
- source [file join $gdb_plugins plugins.tcl]
- if {! $plugins_available} {
- # No plugins are available for this configuration,
- # so remove the menu
- debug "No plugins configured, go remove the PlugIn menu..."
- $Menu delete plugin
+ $Menu add menubutton plugin "PlugIn" 4
+ set plugins_available 0
+ foreach plugin_dir $gdb_plugins {
+ if {[catch {source [file join $plugin_dir plugins.tcl]} txt]} {
+ dbug E $txt
}
}
+
+ if {! $plugins_available} {
+ # No plugins are available for this configuration,
+ # so remove the menu
+ debug "No plugins configured, go remove the PlugIn menu..."
+ $Menu delete plugin
+ }
}
# ------------------------------------------------------------------