This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: PATCH: Fix file name handling when running on Cygwin (REPOST)
- To: insight at sourceware dot cygnus dot com, David Taylor <taylor at cygnus dot com>, grante at visi dot com, Taruna Gandhi <taruna at cygnus dot com>
- Subject: Re: PATCH: Fix file name handling when running on Cygwin (REPOST)
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Wed, 04 Oct 2000 17:19:05 -0400
- Organization: Red Hat , Inc. - Toronto
- References: <39DB8058.85DE293F@cygnus.com>
And I made the same mistake on the first patch as well. Here is the correct patch.
Sorry for any inconvenience caused.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
*** srctextwin.itb Wed Oct 4 17:12:43 2000
--- srctextwin.itb Wed Oct 4 16:32:00 2000
***************
*** 865,876 ****
# has changed.
# ------------------------------------------------------------------
body SrcTextWin::_mtime_changed {filename} {
set f [gdb_find_file $filename]
if {$f == ""} {
set r 1
} else {
! set mtime [file mtime $f]
if {![info exists Stwc($filename:mtime)]} {
debug "no mtime. resetting to zero"
set Stwc($filename:mtime) 0
--- 865,885 ----
# has changed.
# ------------------------------------------------------------------
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} {
! set f [ide_cygwin_path to_win32 $f]
! }
! if {[catch {file mtime $f} mtime]} {
! debug "Could not stat file \"$f\" - \"$mtime\""
! # The return code is not of much significance in this case
! return 1
! }
if {![info exists Stwc($filename:mtime)]} {
debug "no mtime. resetting to zero"
set Stwc($filename:mtime) 0
***************
*** 953,959 ****
return
}
# no source; switch to assembly
! # debug "no source file; switch to assembly"
# We have to update this data here (it is also done by the caller)
# because we want to call mode, which calls mode_set, which calls
--- 962,968 ----
return
}
# no source; switch to assembly
! dbug W "no source file; switch to assembly"
# We have to update this data here (it is also done by the caller)
# because we want to call mode, which calls mode_set, which calls
***************
*** 1206,1212 ****
return 0
} elseif {$result == 1 || $mtime_changed} {
$win delete 0.0 end
! # debug "READING $name"
if {[catch {gdb_loadfile $win $name $Linenums} msg]} {
dbug W "Error opening $name: $msg"
#if {$msg != ""} {
--- 1215,1221 ----
return 0
} elseif {$result == 1 || $mtime_changed} {
$win delete 0.0 end
! debug "READING $name"
if {[catch {gdb_loadfile $win $name $Linenums} msg]} {
dbug W "Error opening $name: $msg"
#if {$msg != ""} {
***************
*** 2068,2074 ****
# METHOD: mode_set - change the source mode
# ------------------------------------------------------------------
body SrcTextWin::mode_set {new_mode {go 1}} {
! # debug "$new_mode"
if {$new_mode != $current(mode)} {
--- 2077,2083 ----
# METHOD: mode_set - change the source mode
# ------------------------------------------------------------------
body SrcTextWin::mode_set {new_mode {go 1}} {
! debug "$new_mode"
if {$new_mode != $current(mode)} {
***************
*** 2510,2517 ****
--- 2519,2528 ----
# NOTES: If you call this and a new widget is created which cannot be
# filled in later due to errors, call UnLoadFromCache.
# -----------------------------------------------------------------------------
+
body SrcTextWin::LoadFromCache {w name asm lib} {
debug "LoadFromCache $w $name $asm"
+ global tcl_platform
upvar ${w}win win
upvar _${w}pane pane
***************
*** 2525,2531 ****
set oldpane $pane
if {[info exists Stwc($full_name:pane)]} {
! #debug "READING CACHE $full_name->$Stwc($full_name:pane)"
set pane $Stwc($full_name:pane)
if {$oldpane != ""} {
$itk_interior.p replace $oldpane $pane
--- 2536,2542 ----
set oldpane $pane
if {[info exists Stwc($full_name:pane)]} {
! debug "READING CACHE $full_name->$Stwc($full_name:pane)"
set pane $Stwc($full_name:pane)
if {$oldpane != ""} {
$itk_interior.p replace $oldpane $pane
***************
*** 2557,2564 ****
# out.
if {$loadingSource} {
! if {[catch {file mtime $name} file_time]} {
! debug "Could not stat file \"$name\" - \"$file_time\""
return -1
} else {
set Stwc($full_name:pane) pane$filenum
--- 2568,2580 ----
# out.
if {$loadingSource} {
! if {[string compare $tcl_platform(platform) "windows"] == 0} {
! set f [ide_cygwin_path to_win32 $name]
! } else {
! set f $name
! }
! if {[catch {file mtime $f} file_time]} {
! debug "Could not stat file \"$f\" - \"$file_time\""
return -1
} else {
set Stwc($full_name:pane) pane$filenum