This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [RFC] patch to fix finding sources
I have added a few bits to Martin's patch, but I don't have how to test it at the moment. I would need Martin's help as he probably has the situation repeatable right now (which caused him to send the patch).
I have attached the patch.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
Index: gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.19
diff -c -p -r1.19 gdbtk-cmds.c
*** gdbtk-cmds.c 2001/01/27 00:50:29 1.19
--- gdbtk-cmds.c 2001/02/06 18:10:50
*************** gdb_get_function_command (clientData, in
*** 1319,1326 ****
* Tcl Arguments:
* filename: the file name to search for.
* Tcl Result:
! * The full path to the file, or an empty string if the file is not
! * found.
*/
static int
--- 1319,1326 ----
* Tcl Arguments:
* filename: the file name to search for.
* Tcl Result:
! * The full path to the file, or an error message if the file is
! * not found in the symtab.
*/
static int
*************** gdb_find_file_command (clientData, inter
*** 1330,1337 ****
int objc;
Tcl_Obj *CONST objv[];
{
- char *filename = NULL;
struct symtab *st;
if (objc != 2)
{
--- 1330,1337 ----
int objc;
Tcl_Obj *CONST objv[];
{
struct symtab *st;
+ char *filename;
if (objc != 2)
{
*************** gdb_find_file_command (clientData, inter
*** 1339,1355 ****
return TCL_ERROR;
}
! st = full_lookup_symtab (Tcl_GetStringFromObj (objv[1], NULL));
if (st)
! filename = st->fullname;
!
! if (filename == NULL)
{
! Tcl_SetStringObj ( result_ptr->obj_ptr, "File not found in symtab (2)", -1);
return TCL_ERROR;
}
- else
- Tcl_SetStringObj (result_ptr->obj_ptr, filename, -1);
return TCL_OK;
}
--- 1339,1354 ----
return TCL_ERROR;
}
! filename = Tcl_GetStringFromObj (objv[1], NULL);
! st = full_lookup_symtab (filename);
if (st)
! Tcl_SetStringObj (result_ptr->obj_ptr, st->fullname, -1);
! else
{
! Tcl_SetStringObj ( result_ptr->obj_ptr,
! "File not found in symtab (2)", -1);
return TCL_ERROR;
}
return TCL_OK;
}
Index: srcwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srcwin.itb,v
retrieving revision 1.11
diff -c -p -r1.11 srcwin.itb
*** srcwin.itb 2001/01/25 17:49:22 1.11
--- srcwin.itb 2001/02/06 18:29:35
***************
*** 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,303 ****
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,303 ----
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\": $errtxt"
$_statbar.name entryset [lindex [file split $current(filename)] end]
return
}
Index: srctextwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srctextwin.itb,v
retrieving revision 1.20
diff -c -p -r1.20 srctextwin.itb
*** srctextwin.itb 2001/01/19 16:09:10 1.20
--- srctextwin.itb 2001/02/06 18:29:36
***************
*** 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,897 ----
body SrcTextWin::_mtime_changed {filename} {
global tcl_platform
! set f [catch {gdb_find_file $filename} errtxt]
! if {$f} {
! dbug W $errtxt
set r 1
} else {
if {[string compare $tcl_platform(platform) "windows"] == 0} {