This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
[PATCH] INSIGHT_FORCE_READ_PREFERENCES
- From: Andrew STUBBS <andrew dot stubbs at st dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: insight at sources dot redhat dot com
- Date: Thu, 24 Nov 2005 18:51:11 +0000
- Subject: [PATCH] INSIGHT_FORCE_READ_PREFERENCES
- References: <437DC631.1060609@st.com> <437E5954.60104@redhat.com>
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]} {