This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: RFC: Wrong calls to an undefined update in srcwin.itb
- To: Insight List <insight at sources dot redhat dot com>
- Subject: Re: RFC: Wrong calls to an undefined update in srcwin.itb
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Tue, 02 Jan 2001 23:26:51 -0500
- Organization: Red Hat Canada
- References: <3A4D99A3.593869F4@redhat.com>
Fernando Nasser wrote:
>
> When I started a second Source Window I noticed an error message in the
> debug window caused by an attempt to execute an undefined "update"
> method.
>
That happens to be a bug, and it is at least one year old.
Tom uncovered it when he reactivated the multiple source windows code.
If GDB is already running the program, an additional window will come
up empty (if GDB is not running it is filled with main() so this problem
does not occur).
This "update" is not supposed to be "::update" but "_update".
It was a little more than adding an underscore but everything seems to
be
working really smooth now. I am checking it in.
> There is a second condition of this that happens if one interrupts a
> download
> (or it fails).
>
This one seem to be a "::update" indeed.
Revised patch:
ChangeLog
* library/srcwin.itb (_build_win): If gdb is running a program, load
the
window with source for that location (if available).
(download_progress): Calls to "update" must refer to the global
namespace.
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
Index: srcwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcwin.itb,v
retrieving revision 1.6
diff -c -p -r1.6 srcwin.itb
*** srcwin.itb 2000/12/07 20:14:02 1.6
--- srcwin.itb 2001/01/03 04:16:29
*************** body SrcWin::_build_win {} {
*** 150,156 ****
# If this is a new widget and the program is
# not yet being debugged, load the file with "main" in it.
if {$gdb_running} {
! update
} else {
if {[set linespec [gdbtk_locate_main]] != ""} {
location BROWSE_TAG $linespec
--- 150,160 ----
# If this is a new widget and the program is
# not yet being debugged, load the file with "main" in it.
if {$gdb_running} {
! if {[catch {gdb_loc} loc]} {
! # Nothing we can do but leave the window empty.
! } else {
! _update $loc
! }
} else {
if {[set linespec [gdbtk_locate_main]] != ""} {
location BROWSE_TAG $linespec
*************** body SrcWin::download_progress { section
*** 229,235 ****
if {$last_done == $tot || $section == "CANCEL"} {
$_toolbar configure -runstop normal
if {!$gdb_loaded} {
! update
# errored or canceled
if {$msg != ""} {
set_status "DOWNLOAD FAILED: $msg"
--- 233,239 ----
if {$last_done == $tot || $section == "CANCEL"} {
$_toolbar configure -runstop normal
if {!$gdb_loaded} {
! ::update
# errored or canceled
if {$msg != ""} {
set_status "DOWNLOAD FAILED: $msg"