public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [RFC] patch to fix finding sources
@ 2001-02-06  8:50 Martin M. Hunt
  2001-02-06  9:23 ` Fernando Nasser
  2001-02-06 17:05 ` Fernando Nasser
  0 siblings, 2 replies; 9+ messages in thread
From: Martin M. Hunt @ 2001-02-06  8:50 UTC (permalink / raw)
  To: insight

A couple weeks ago, gdb_find_file was changed to return TCL_ERROR with an
error message "File not found in symtab (2)"  when no file was found.  I
disagree with this.  I thought catch was for handling exceptions.  Also,
the error message is not used and is confusing.

Regardless, the functions which use gdb_find_file were not changed, which
causes some nasty bugs in Insight.  Attached is a patch to get things
working again.

Index: srctextwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srctextwin.itb,v
retrieving revision 1.20
diff -p -r1.20 srctextwin.itb
*** srctextwin.itb	2001/01/19 16:09:10	1.20
--- srctextwin.itb	2001/02/06 16:15:49
***************
*** 1,5 ****
!  # Paned text widget for source code, for GDBtk.
! # Copyright 1997, 1998, 1999 Cygnus Solutions
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
--- 1,5 ----
! # Paned text widget for source code, for Insight
! # Copyright 1997, 1998, 1999, 2001 Red Hat
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
*************** body SrcTextWin::ClearTags {} {
*** 888,896 ****
  body SrcTextWin::_mtime_changed {filename} {
    global tcl_platform

!   set f [gdb_find_file $filename]

!   if {$f == ""} {
      set r 1
    } else {
      if {[string compare $tcl_platform(platform) "windows"] == 0} {
--- 888,896 ----
  body SrcTextWin::_mtime_changed {filename} {
    global tcl_platform

!   set f [catch {gdb_find_file $filename} errtxt]

!   if {$f} {
      set r 1
    } else {
      if {[string compare $tcl_platform(platform) "windows"] == 0} {
Index: srcwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcwin.itb,v
retrieving revision 1.11
diff -p -r1.11 srcwin.itb
*** srcwin.itb	2001/01/25 17:49:22	1.11
--- srcwin.itb	2001/02/06 16:15:52
***************
*** 1,5 ****
! # Source window for GDBtk.
! # Copyright 1997, 1998, 1999 Cygnus Solutions
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
--- 1,5 ----
! # Source window for Insight.
! # Copyright 1997, 1998, 1999, 2001 Red Hat
  #
  # This program is free software; you can redistribute it and/or modify it
  # under the terms of the GNU General Public License (GPL) as published by
*************** body SrcWin::_name {w {val ""}} {
*** 295,302 ****
    if {$val != ""} {
      if {![info exists _files(short,$val)]} {
        if {![info exists _files(full,$val)]} {
! 	set full [gdb_find_file $val]
! 	if {$full == ""} {
  	  set_status "Cannot find source file \"$val\""
  	  $_statbar.name entryset [lindex [file split $current(filename)] end]
  	  return
--- 295,302 ----
    if {$val != ""} {
      if {![info exists _files(short,$val)]} {
        if {![info exists _files(full,$val)]} {
! 	set full [catch {gdb_find_file $val} errtxt ]
! 	if {$full} {
  	  set_status "Cannot find source file \"$val\""
  	  $_statbar.name entryset [lindex [file split $current(filename)] end]
  	  return

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-02-06 17:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-06  8:50 [RFC] patch to fix finding sources Martin M. Hunt
2001-02-06  9:23 ` Fernando Nasser
2001-02-06 10:58   ` Fernando Nasser
2001-02-06 13:30     ` Martin M. Hunt
2001-02-06 14:57       ` Fernando Nasser
2001-02-06 15:05       ` Fernando Nasser
2001-02-06 15:22     ` Fernando Nasser
2001-02-06 16:10       ` Fernando Nasser
2001-02-06 17:05 ` Fernando Nasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).