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]

Re: RFC: Wrong calls to an undefined update in srcwin.itb


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"

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