This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[PATCH] Using separate preferences for native and cross debugger
- To: insight at sources dot redhat dot com
- Subject: [PATCH] Using separate preferences for native and cross debugger
- From: Ton van Overbeek <tvoverbe at cistron dot nl>
- Date: Tue, 05 Jun 2001 22:41:48 +0200
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