This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[Patch] Prefs error...
- From: Ian Roxborough <irox at redhat dot com>
- To: insight at sources dot redhat dot com
- Date: Tue, 11 Dec 2001 00:46:11 -0800
- Subject: [Patch] Prefs error...
- Organization: Red Hat Inc.
Hi,
I came across this problem with the prefs.
Keith has approved this fix offline.
How to reproduce:
The problem occurs when running Insight for the
second time when connecting to a remote board via
a serial line.
Steps:
1- Delete your ~/.gdbtk file.
2- Launch Insight.
3- Load the program to debug (file menu -> "Open...")
4- Click on the "blue man" and the target selection
dialog should appear.
5- Set your target selection settings (serial port, etc.)
and click on the OK button.
6- Everything should work fine.
7- Exit Insight.
8- Launch Insight again.
9- Load the program again.
10- Click on the blue man and you should see the error
dialog.
The "default-hostname" preference is PREF_defined in the
target settings dialog's initialization code. If this code
isn't called then when these preference are accessed they
will cause an error.
The patch fixes the problem by using "pref getd" which
will define non-existant preference rather than popup
an error dialog.
Ian.
ChangeLog:
2001-12-10 Ian Roxborough <irox@redhat.com>
* library/interface.tcl (set_target_name): Call "pref getd"
instead of "pref get" to avoid undefined preference error
message for default-hostname.
Index: library/interface.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
retrieving revision 1.34
diff -r1.34 interface.tcl
1042c1042
< set hostname [pref get gdb/load/default-hostname]
---
> set hostname [pref getd gdb/load/default-hostname]