This is the mail archive of the insight@sourceware.org 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]

[PATCH] INSIGHT_FORCE_READ_PREFERENCES


Keith Seitz wrote:
There are three options that come to me immediately. First is what you've proposed (new startup option to gdb), which probably isn't going to get accepted.

Next is a new environment variable (GDBTK_FORCE_READ_PREFERENCES or something or other). Add a check to prefs_read in prefs.tcl.

Finally, just disable the check for ignoring preferences in the same procedure (prefs_read in prefs.tcl).

1 and 3 do not seem possible. The GDB maintainers are not happy with a new option for this and some people do use -nx to disable .gdbtkinit.


Therefore, here is a patch for option 2.

I have used the variable name INSIGHT_FORCE_READ_PREFERENCES. I prefer INSIGHT to GDBTK because users will know what that means.

If the patch is OK, will I be permitted to check it in myself? I have 'write after approval' permission for GDB, but I know that doesn't extend to other projects (GCC, Binutils etc.) but I'm not sure about Insight. If not, it would be easier for somebody else to commit this one little patch for me.

Thanks

Andrew Stubbs
2005-11-24  Andrew Stubbs  <andrew.stubbs@st.com>

	* library/prefs.tcl (pref_read): Read preferences file if environment
	variable INSIGHT_FORCE_READ_PREFERENCES is set (regardless of -nx).

Index: src/gdb/gdbtk/library/prefs.tcl
===================================================================
--- src.orig/gdb/gdbtk/library/prefs.tcl	2005-11-24 17:56:46.000000000 +0000
+++ src/gdb/gdbtk/library/prefs.tcl	2005-11-24 18:43:48.000000000 +0000
@@ -50,7 +50,8 @@ proc pref_read {} {
     set prefs_init_filename ".gdbtkinit"
   }
 
-  if {!$GDBStartup(inhibit_prefs)} {
+  if {!$GDBStartup(inhibit_prefs) \
+      || [info exists env(INSIGHT_FORCE_READ_PREFERENCES)]} {
     set file_opened 0
     if {[file exists $prefs_init_filename]} {
       if {[catch {open $prefs_init_filename r} fd]} {

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