This is the mail archive of the insight@sources.redhat.com 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]

[PATCH] Using separate preferences for native and cross debugger


Hello,

I am trying to get insight going for the m68k-palmos target in
a cygwin environment (Win 98SE). One of the problems I ran into
is that the native cygwin insight/gdb and my cross gdb/insight
use the same preferences (gdbtk.ini).
I believe they should be separate. Using the same GDBTK_LIBRARY
for both the native and cross insight is a 'good' thing (reduce
total number of files).
So here is a patch which prepends the target_name to the prefs
filename in case of a cross debugger. It is against the prefs.tcl
found in the cygwin gdb sources (gdb-20010428-1). Checking in cvs
this patch should apply without problems against the current
cvs source (rev 1.9).
Is this the right thing to do or should I approach the coexistence
of native and cross insight/gdb differently ?
Anyway here is the patch:
----------------------------------------------------------------------------
-----------
--- prefs.tcl.orig      Wed Apr 18 22:27:16 2001
+++ prefs.tcl   Mon Jun  4 23:26:02 2001
@@ -44,10 +44,21 @@
     set home ""
   }
 
-  if {$tcl_platform(platform) == "windows"} {
-    set prefs_init_filename "gdbtk.ini"
+  if {$GDBStartup(host_name) == $GDBStartup(target_name)} {
+    if {$tcl_platform(platform) == "windows"} {
+      set prefs_init_filename "gdbtk.ini"
+    } else {
+      set prefs_init_filename ".gdbtkinit"
+    }
   } else {
-    set prefs_init_filename ".gdbtkinit"
+    if {$tcl_platform(platform) == "windows"} {
+      set prefs_init_filename $GDBStartup(target_name)
+      set prefs_init_filename [append prefs_init_filename "-gdbtk.ini"]
+      dbug I "prefs_init_filename = $prefs_init_filename"
+    } else {
+      set prefs_init_filename "."
+      set prefs_init_filename [append prefs_init_filename
$GDBStartup(target_name) "-gdbtkinit"]
+    }
   }
 
   if {!$GDBStartup(inhibit_prefs)} {
----------------------------------------------------------------------------
------------

Regards,

Ton van Overbeek


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