Wed Mar 19 15:16:17 1997 Martin M. Hunt <hunt@onions.cygnus.com>
authorMartin Hunt <hunt@redhat.com>
Wed, 19 Mar 1997 23:39:20 +0000 (23:39 +0000)
committerMartin Hunt <hunt@redhat.com>
Wed, 19 Mar 1997 23:39:20 +0000 (23:39 +0000)
* Makefile.in:  Install gdbtcl dir instead of gdbtk.tcl.

* gdbtk.c: Added some ifdefs for Windows.  Changed GDBTK_FILENAME
to GDBTK_LIBRARY, which is now a path to search.
(gdb_path_conv): New function.  Convert Cygwin32 pathname to
DOS-style pathname.

* aclocal.m4, configure.in: Changes for Windows builds.

* configure: Rebuilt.

gdb/.Sanitize
gdb/ChangeLog
gdb/README.GDBTK
gdb/aclocal.m4
gdb/configure
gdb/configure.in
gdb/gdbtk.c

index ff29580d4ef6d8fa132e24d685955489851311f1..ee363d5cc4cb1b3e498be0b88921d84f6cdf56ff 100644 (file)
@@ -29,7 +29,7 @@ else
        fi
 fi
 
-gdbtk_files="README.GDBTK gdbtk.c gdbtk.tcl"
+gdbtk_files="README.GDBTK gdbtk.c gdbtcl"
 
 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
        lose_these_too="${gdbtk_files} ${lose_these_too}"
index 87899a0fcb79017fc69ac5eae21893b24c608024..77f28c3fa18c180614ccf5f4b529ef0fbf1d2106 100644 (file)
@@ -1,3 +1,18 @@
+start-sanitize-gdbtk
+       Wed Mar 19 15:16:17 1997  Martin M. Hunt  <hunt@onions.cygnus.com>
+
+       * Makefile.in:  Install gdbtcl dir instead of gdbtk.tcl.
+       
+       * gdbtk.c: Added some ifdefs for Windows.  Changed GDBTK_FILENAME
+       to GDBTK_LIBRARY, which is now a path to search.
+       (gdb_path_conv): New function.  Convert Cygwin32 pathname to
+       DOS-style pathname.
+
+       * aclocal.m4, configure.in: Changes for Windows builds.
+
+       * configure: Rebuilt.
+
+end-sanitize-gdbtk     
 Mon Mar 17 17:52:00 1997  J.T. Conklin  <jtc@cygnus.com>
 
        * dsrec.c (load_srec): Print leading zeroes when printing section
index d2aecdd1d0f98a26a805ec9134db8216e6cba177..3d9f1550448ba05721e94ed883e7f3e78ac321d3 100644 (file)
@@ -1,6 +1,7 @@
                                 README.GDBTK
                           Written by Stu Grossman
              Updated 9/26/95 by Fred Fish for gdb 4.15 release
+              Updated 4/18/97 by Martin Hunt
 
 This file describes how to build, install, use and hack on GDBtk, a TK based
 GUI for GDB, the GNU debugger.
@@ -9,8 +10,8 @@ Introduction
 ============
 
 GDBtk is a version of GDB that uses Tcl/Tk to implement a graphical
-user inter- face.  It is a fully integrated GUI, not a separate
-front-end program.  The interface consists of several seperate X
+user inter-face.  It is a fully integrated GUI, not a separate
+front-end program.  The interface consists of several seperate
 windows, which use standard elements like buttons, scrollbars, entry
 boxes and such to create a fairly easy to use interface.  Each window
 has a distinct content and purpose, and can be enabled or disabled
@@ -23,10 +24,16 @@ Building and installing
 
 Building GDBtk is very straightforward.  The main difference is that you will
 need to use the `--enable-gdbtk' option when you run configure in the top level
-directory.  You will also need to install Tcl version 7.5a2, and Tk 4.1a2.
+directory.  You will also need to install Tcl version 7.6 and Tk version 4.2.
 
-You will also need to have X11 (R4/R5/R6) installed (this is a prerequisite to
-installing Tk).
+On Unix machines, you will also need to have X11 (R4/R5/R6) installed 
+(this is a prerequisite to installing Tk).  
+
+For Windows, you can obtain Tcl/Tk from ftp://ftp.smli.com:/pub/tcl/win76p2.exe.
+There is a bug in this version of Tcl/tk that requires you to set the
+environmental variable TK_LIBRARY to where the tk library directory is installed.
+There is also a problem with the colors in images on 16-bit displays under
+Windows, so some icons may look strange.  
 
 [See the GDB README file for more details on configure options and such.]
 
@@ -79,7 +86,7 @@ Source window:
        This contains the current source file.  The margin displays line
        numbers, and has an indicator for lines that actually contain code (and
        therefore can have breakpoints as well).  When a breakpoint is set at
-       that line, the indicator is replaced with a `B'.
+       that line, the indicator is replaced with a stop sign icon.
 
        The buttons are:
 
@@ -134,15 +141,16 @@ Expressions:
 Customizing GDBtk
 =================
 
-There are three primary ways to customize GDBtk.  One is to modifiy the appropriate
-X resources.  The other is to hack a ~/.gdbtkinit file.  The last is to change
-gdbtk.tcl, which defines the most basic interface elements.
+There are three primary ways to customize GDBtk.  One is to modifiy the 
+appropriate X resources.  The other is to hack a ~/.gdbtkinit file.  The last 
+is to change the files in gdbtcl, which defines the most basic interface 
+elements.
 
 X resources give you control over things like the choice of fonts, color
 schemes and some geometry info.
 
-For more serious customizations, you will probably need to hack your ~/.gdbtkinit
-or gdbtk.tcl files.
+For more serious customizations, you will probably need to hack your 
+~/.gdbtkinit or gdbtcl files.
 
 X Resources
 ===========
@@ -191,24 +199,29 @@ Note that some things may be explicitly overridden by gdbtk.tcl.  In
 particular, the `tk colormodel . monochrome' command should probably be
 disabled if you want to use color.
 
-Hacking ~/.gdbtkinit and gdbtk.tcl
+Hacking ~/.gdbtkinit and gdbtcl
 ==================================
 ~/.gdbtkinit is sourced at the end of gdbtk.tcl.  Currently there is no good
-doc on this.  See gdbtk.tcl for see what you can change.
+doc on this.  See gdbtcl/main.tcl for see what you can change.
 
-The GUI is primarily implemented by Tcl/Tk code which lives in gdbtk.tcl and a
+The GUI is primarily implemented by Tcl/Tk code which lives in gdbtcl and a
 C file called gdbtk.c.  The Tcl/Tk code determines the look and feel, the
 layout, and the functions associated with all of the interface elements.  The C
 code is mostly just glue between GDB internals and Tclland.  In essence, all of
 the policy is implemented in Tcl/Tk, and is easily changed without recompiling.
 
 To make more serious changes to the interface, such as adding a new window or
-changing the framework, you will have to hack gdbtk.tcl.  This file is
+changing the framework, you will have to hack the tcl code.  This directory is
 installed in $(libdir) (probably /usr/local/lib/).  But, you will probably want
 to hack on your own private copy before putting it up for the rest of the
-users.  GDB actually searches three places for gdbtk.tcl.  First, it looks in
-the GDBTK_FILENAME environment variable.  Second, it looks for ./gdbtk.tcl.
-And third, it looks for $(libdir)/gdbtk.tcl.
+users.  To find the GDB tcl code, GDB first checks for the environment variable
+GDBTK_LIBRARY.  This can be a directory name or a list of directories seperated
+by colons (semicolons on Windows). GDB will check each directory in order until
+it finds "main.tcl".  If GDBTK_LIBRARY is not set, GDB will look for 
+"gdbtcl/main.tcl" in the current directory, and finally, it will try to find 
+the tcl directory in the sources.
+
+Note that the old GDBTK_FILENAME environment variable is no longer used. 
 
 Internally, GDBtk is basically GDB, linked with Tcl/Tk, and some glue code that
 interfaces GDB internals to Tclland.  This means that GDBtk operates as a
index 770d1488524adeede5a9e5ea24b859aeae956122..2c134ccdf69248ea4952933b6d39006cf3f213b8 100644 (file)
@@ -74,8 +74,9 @@ AC_DEFUN(CY_AC_PATH_TCLH, [
 # be careful that we don't match stuff like tclX by accident.
 # the alternative search directory is involked by --with-tclinclude
 #
+
 no_tcl=true
-AC_MSG_CHECKING(for Tcl private headers)
+AC_MSG_CHECKING(for Tcl private headers. dir=${configdir})
 AC_ARG_WITH(tclinclude, [  --with-tclinclude       directory where tcl private headers are], with_tclinclude=${withval})
 AC_CACHE_VAL(ac_cv_c_tclh,[
 # first check to see if --with-tclinclude was specified
@@ -187,8 +188,8 @@ if test x"${no_tcl}" = x ; then
                `ls -dr ../../tcl[[7-9]]* 2>/dev/null` \
                ../../../tcl \
                `ls -dr ../../../tcl[[7-9]]* 2>/dev/null` ; do
-      if test -f "$i/unix/tclConfig.sh" ; then
-        ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tclConfig.sh" ; then
+        ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
@@ -207,8 +208,8 @@ if test x"${no_tcl}" = x ; then
     for i in \
                ${srcdir}/../tcl \
                `ls -dr ${srcdir}/../tcl[[7-9]]* 2>/dev/null` ; do
-      if test -f "$i/unix/tclConfig.sh" ; then
-        ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tclConfig.sh" ; then
+        ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
@@ -409,8 +410,8 @@ if test x"${no_tk}" = x ; then
                `ls -dr ../../tk[[4-9]]* 2>/dev/null` \
                ../../../tk \
                `ls -dr ../../../tk[[4-9]]* 2>/dev/null` ; do
-      if test -f "$i/unix/tkConfig.sh" ; then
-        ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tkConfig.sh" ; then
+        ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
@@ -429,8 +430,8 @@ if test x"${no_tk}" = x ; then
     for i in \
                ${srcdir}/../tk \
                `ls -dr ${srcdir}/../tk[[4-9]]* 2>/dev/null` ; do
-      if test -f "$i/unix/tkConfig.sh" ; then
-        ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tkConfig.sh" ; then
+        ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
index a3e5b3212c3dfd871f2630ff5499a74d5752400a..d3cc1952843f0dff7419483340e6644d2632cdc5 100755 (executable)
@@ -864,7 +864,6 @@ else
 fi
 
 
-
 ac_aux_dir=
 for ac_dir in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/..; do
   if test -f $ac_dir/install-sh; then
@@ -912,7 +911,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:916: checking host system type" >&5
+echo "configure:915: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -933,7 +932,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:937: checking target system type" >&5
+echo "configure:936: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -951,7 +950,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:955: checking build system type" >&5
+echo "configure:954: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -996,7 +995,7 @@ configdirs="doc testsuite"
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1000: checking for a BSD compatible install" >&5
+echo "configure:999: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1054,7 +1053,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1058: checking for $ac_word" >&5
+echo "configure:1057: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1085,7 +1084,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1089: checking for $ac_word" >&5
+echo "configure:1088: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1116,7 +1115,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1120: checking for $ac_word" >&5
+echo "configure:1119: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1152,7 +1151,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1156: checking for $ac_word" >&5
+echo "configure:1155: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1186,7 +1185,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1190: checking for $ac_word" >&5
+echo "configure:1189: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1236,12 +1235,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1240: checking for ANSI C header files" >&5
+echo "configure:1239: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1245 "configure"
+#line 1244 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1249,7 +1248,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1266,7 +1265,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1270 "configure"
+#line 1269 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1284,7 +1283,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1288 "configure"
+#line 1287 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1305,7 +1304,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1309 "configure"
+#line 1308 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1316,7 +1315,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1343,17 +1342,17 @@ for ac_hdr in limits.h memory.h string.h strings.h unistd.h termios.h termio.h s
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1347: checking for $ac_hdr" >&5
+echo "configure:1346: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1352 "configure"
+#line 1351 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1380,12 +1379,12 @@ fi
 done
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:1384: checking whether stat file-mode macros are broken" >&5
+echo "configure:1383: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1389 "configure"
+#line 1388 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1437,12 +1436,12 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1441: checking for working const" >&5
+echo "configure:1440: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1446 "configure"
+#line 1445 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1491,7 +1490,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1515,12 +1514,12 @@ fi
 for ac_func in setpgid sbrk select poll
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1519: checking for $ac_func" >&5
+echo "configure:1518: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1524 "configure"
+#line 1523 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1543,7 +1542,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1585,19 +1584,19 @@ EOF
 fi
 
 echo $ac_n "checking for gregset_t type""... $ac_c" 1>&6
-echo "configure:1589: checking for gregset_t type" >&5
+echo "configure:1588: checking for gregset_t type" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_gregset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1594 "configure"
+#line 1593 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 gregset_t *gregsetp = 0
 ; return 0; }
 EOF
-if { (eval echo configure:1601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   gdb_cv_have_gregset_t=yes
 else
@@ -1618,19 +1617,19 @@ EOF
 fi
 
 echo $ac_n "checking for fpregset_t type""... $ac_c" 1>&6
-echo "configure:1622: checking for fpregset_t type" >&5
+echo "configure:1621: checking for fpregset_t type" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_fpregset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1627 "configure"
+#line 1626 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
 int main() {
 fpregset_t *fpregsetp = 0
 ; return 0; }
 EOF
-if { (eval echo configure:1634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   gdb_cv_have_fpregset_t=yes
 else
@@ -1651,7 +1650,7 @@ EOF
 fi
 
 echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:1655: checking for main in -lm" >&5
+echo "configure:1654: checking for main in -lm" >&5
 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1659,14 +1658,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1663 "configure"
+#line 1662 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1696,12 +1695,12 @@ fi
 
 
 echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:1700: checking for long long support in compiler" >&5
+echo "configure:1699: checking for long long support in compiler" >&5
 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1705 "configure"
+#line 1704 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1711,7 +1710,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_c_long_long=yes
 else
@@ -1733,7 +1732,7 @@ fi
 
 
 echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:1737: checking for long long support in printf" >&5
+echo "configure:1736: checking for long long support in printf" >&5
 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1741,7 +1740,7 @@ else
   gdb_cv_printf_has_long_long=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1745 "configure"
+#line 1744 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -1751,7 +1750,7 @@ int main () {
   return (strcmp ("12345", buf));
 }
 EOF
-if { (eval echo configure:1755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   gdb_cv_printf_has_long_long=yes
 else
@@ -1775,19 +1774,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
 
 
 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:1779: checking for long double support in compiler" >&5
+echo "configure:1778: checking for long double support in compiler" >&5
 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1784 "configure"
+#line 1783 "configure"
 #include "confdefs.h"
 
 int main() {
 long double foo;
 ; return 0; }
 EOF
-if { (eval echo configure:1791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_long_double=yes
 else
@@ -1809,7 +1808,7 @@ fi
 
 
 echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:1813: checking for long double support in printf" >&5
+echo "configure:1812: checking for long double support in printf" >&5
 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1817,7 +1816,7 @@ else
   gdb_cv_printf_has_long_double=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1821 "configure"
+#line 1820 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -1827,7 +1826,7 @@ int main () {
   return (strncmp ("3.14159", buf, 7));
 }
 EOF
-if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   gdb_cv_printf_has_long_double=yes
 else
@@ -1853,17 +1852,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1857: checking for $ac_hdr" >&5
+echo "configure:1856: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1862 "configure"
+#line 1861 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1892,12 +1891,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1896: checking for $ac_func" >&5
+echo "configure:1895: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1901 "configure"
+#line 1900 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1920,7 +1919,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1945,7 +1944,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1949: checking for working mmap" >&5
+echo "configure:1948: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1953,7 +1952,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1957 "configure"
+#line 1956 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2093,7 +2092,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:2097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -2117,12 +2116,12 @@ fi
 
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:2121: checking whether malloc must be declared" >&5
+echo "configure:2120: checking whether malloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2126 "configure"
+#line 2125 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2143,7 +2142,7 @@ int main() {
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:2147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -2165,12 +2164,12 @@ EOF
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:2169: checking whether realloc must be declared" >&5
+echo "configure:2168: checking whether realloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2174 "configure"
+#line 2173 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2191,7 +2190,7 @@ int main() {
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:2195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -2213,12 +2212,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:2217: checking whether free must be declared" >&5
+echo "configure:2216: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2222 "configure"
+#line 2221 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -2239,7 +2238,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:2243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -2267,7 +2266,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
        case ${host_os} in
        hpux*)
                echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:2271: checking for HPUX/OSF thread support" >&5
+echo "configure:2270: checking for HPUX/OSF thread support" >&5
                if test -f /usr/include/dce/cma_config.h ; then
                        if test "$GCC" = "yes" ; then
                                echo "$ac_t""yes" 1>&6
@@ -2285,7 +2284,7 @@ EOF
                ;;
        solaris*)
                echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:2289: checking for Solaris thread debugging library" >&5
+echo "configure:2288: checking for Solaris thread debugging library" >&5
                if test -f /usr/lib/libthread_db.so.1 ; then
                        echo "$ac_t""yes" 1>&6
                        cat >> confdefs.h <<\EOF
@@ -2294,7 +2293,7 @@ EOF
 
                        CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
                        echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2298: checking for dlopen in -ldl" >&5
+echo "configure:2297: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2302,7 +2301,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2306 "configure"
+#line 2305 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2313,7 +2312,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2411,7 +2410,7 @@ if test "${enable_gdbtk+set}" = set; then
        *go32*)
            echo "configure: warning: GDB does not support GDBtk on host ${host}.  GDBtk will be disabled." 1>&2
            enable_gdbtk=no ;;
-       *cygwin32* | *windows*)
+       *windows*)
            echo "configure: warning: GDB does not support GDBtk on host ${host}.  GDBtk will be disabled." 1>&2
            enable_gdbtk=no ;;
        *)
@@ -2426,7 +2425,7 @@ else
   
 # Default is on for everything but go32 and cygwin32
 case "$host" in
-    *go32* | *cygwin32* | *windows*)
+    *go32* | *windows*)
        ;;
     *)
        enable_gdbtk=yes ;;
@@ -2435,6 +2434,15 @@ case "$host" in
 fi
 
 
+case "${target}" in
+*-cygwin32)
+       configdir="win"
+       ;;
+*)
+       configdir="unix"
+       ;;
+esac
+
 if test "${enable_gdbtk}" = "yes"; then
 
     
@@ -2454,7 +2462,7 @@ if test "${with_tclconfig+set}" = set; then
 fi
 
   echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:2458: checking for Tcl configuration" >&5
+echo "configure:2466: checking for Tcl configuration" >&5
   if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2478,8 +2486,8 @@ else
                `ls -dr ../../tcl[7-9]* 2>/dev/null` \
                ../../../tcl \
                `ls -dr ../../../tcl[7-9]* 2>/dev/null` ; do
-      if test -f "$i/unix/tclConfig.sh" ; then
-        ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tclConfig.sh" ; then
+        ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
@@ -2498,8 +2506,8 @@ else
     for i in \
                ${srcdir}/../tcl \
                `ls -dr ${srcdir}/../tcl[7-9]* 2>/dev/null` ; do
-      if test -f "$i/unix/tclConfig.sh" ; then
-        ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tclConfig.sh" ; then
+        ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
@@ -2562,7 +2570,7 @@ if test "${with_tkconfig+set}" = set; then
 fi
 
   echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:2566: checking for Tk configuration" >&5
+echo "configure:2574: checking for Tk configuration" >&5
   if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2586,8 +2594,8 @@ else
                `ls -dr ../../tk[4-9]* 2>/dev/null` \
                ../../../tk \
                `ls -dr ../../../tk[4-9]* 2>/dev/null` ; do
-      if test -f "$i/unix/tkConfig.sh" ; then
-        ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tkConfig.sh" ; then
+        ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
@@ -2606,8 +2614,8 @@ else
     for i in \
                ${srcdir}/../tk \
                `ls -dr ${srcdir}/../tk[4-9]* 2>/dev/null` ; do
-      if test -f "$i/unix/tkConfig.sh" ; then
-        ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
+      if test -f "$i/${configdir}/tkConfig.sh" ; then
+        ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
        break
       fi
     done
@@ -2654,9 +2662,10 @@ fi
 # be careful that we don't match stuff like tclX by accident.
 # the alternative search directory is involked by --with-tclinclude
 #
+
 no_tcl=true
-echo $ac_n "checking for Tcl private headers""... $ac_c" 1>&6
-echo "configure:2660: checking for Tcl private headers" >&5
+echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
+echo "configure:2669: checking for Tcl private headers. dir=${configdir}" >&5
 # Check whether --with-tclinclude or --without-tclinclude was given.
 if test "${with_tclinclude+set}" = set; then
   withval="$with_tclinclude"
@@ -2722,17 +2731,17 @@ fi
 if test x"${ac_cv_c_tclh}" = x ; then
    ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:2726: checking for tclInt.h" >&5
+echo "configure:2735: checking for tclInt.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2731 "configure"
+#line 2740 "configure"
 #include "confdefs.h"
 #include <tclInt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2792,7 +2801,7 @@ fi
 #
 no_tk=true
 echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:2796: checking for Tk private headers" >&5
+echo "configure:2805: checking for Tk private headers" >&5
 # Check whether --with-tkinclude or --without-tkinclude was given.
 if test "${with_tkinclude+set}" = set; then
   withval="$with_tkinclude"
@@ -2858,17 +2867,17 @@ fi
 if test x"${ac_cv_c_tkh}" = x ; then
    ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:2862: checking for tk.h" >&5
+echo "configure:2871: checking for tk.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2867 "configure"
+#line 2876 "configure"
 #include "confdefs.h"
 #include <tk.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2872: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
index 2498c1e2e815bf6fc20ae8df0b0c266593f6e171..be3a7bab2c9f04b36a43e9c0e613d0406c93ffe7 100644 (file)
@@ -255,7 +255,7 @@ AC_ARG_ENABLE(gdbtk,
        *go32*)
            AC_MSG_WARN([GDB does not support GDBtk on host ${host}.  GDBtk will be disabled.])
            enable_gdbtk=no ;;
-       *cygwin32* | *windows*)
+       *windows*)
            AC_MSG_WARN([GDB does not support GDBtk on host ${host}.  GDBtk will be disabled.])
            enable_gdbtk=no ;;
        *)
@@ -269,13 +269,22 @@ esac],
 [
 # Default is on for everything but go32 and cygwin32
 case "$host" in
-    *go32* | *cygwin32* | *windows*)
+    *go32* | *windows*)
        ;;
     *)
        enable_gdbtk=yes ;;
     esac
 ])
 
+case "${target}" in
+*-cygwin32)
+       configdir="win"
+       ;;
+*)
+       configdir="unix"
+       ;;
+esac
+
 if test "${enable_gdbtk}" = "yes"; then
 
     CY_AC_PATH_TCLCONFIG
index 2188d483a5e84df955621f396f548aee78be86b5..7fab1fd8427394418d7d1b99253f083d6dc7f5ba 100644 (file)
@@ -1,5 +1,5 @@
 /* Tcl/Tk interface routines.
-   Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 
    Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
 
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "target.h"
 #include <tcl.h>
 #include <tk.h>
+/* #include <itcl.h> */
 #ifdef ANSI_PROTOTYPES
 #include <stdarg.h>
 #else
@@ -45,9 +46,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <stdio.h>
 #include "gdbcmd.h"
 
+#ifndef WINNT
 #ifndef FIOASYNC
 #include <sys/stropts.h>
 #endif
+#endif
+
+#ifdef WINNT
+#define GDBTK_PATH_SEP ";"
+#else
+#define GDBTK_PATH_SEP ":"
+#endif
 
 /* Some versions (1.3.79, 1.3.81) of Linux don't support SIOCSPGRP the way
    gdbtk wants to use it... */
@@ -71,6 +80,7 @@ static void tk_command PARAMS ((char *, int));
 static int gdb_disassemble PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
 static int compare_lines PARAMS ((const PTR, const PTR));
 static int gdbtk_dis_asm_read_memory PARAMS ((bfd_vma, bfd_byte *, int, disassemble_info *));
+static int gdb_path_conv PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
 static int gdb_stop PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
 static int gdb_listfiles PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
 static int call_wrapper PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
@@ -117,6 +127,8 @@ static int running_now;
 
 static int disassemble_from_exec = -1;
 
+static char *Gdbtk_Library;
+
 /* Supply malloc calls for tcl/tk.  */
 
 char *
@@ -306,6 +318,30 @@ dsprintf_append_element (va_alist)
   Tcl_DStringAppendElement (dsp, buf);
 }
 
+static int
+gdb_path_conv (clientData, interp, argc, argv)
+     ClientData clientData;
+     Tcl_Interp *interp;
+     int argc;
+     char *argv[];
+{
+#ifdef WINNT
+  char pathname[256], *ptr;
+  if (argc != 2)
+    error ("wrong # args");
+  cygwin32_conv_to_full_win32_path (argv[1], pathname);
+  for (ptr = pathname; *ptr; ptr++)
+    {
+      if (*ptr == '\\')
+       *ptr = '/';
+    }
+#else
+  char *pathname = argv[1];
+#endif
+  Tcl_DStringAppend (result_ptr, pathname, strlen(pathname));
+  return TCL_OK;
+}
+
 static int
 gdb_get_breakpoint_list (clientData, interp, argc, argv)
      ClientData clientData;
@@ -1186,12 +1222,16 @@ gdbtk_wait (pid, ourstatus)
   action.sa_handler = x_event;
   action.sa_mask = nullsigmask;
   action.sa_flags = SA_RESTART;
+#ifndef WINNT
   sigaction(SIGIO, &action, NULL);
+#endif
 
   pid = target_wait (pid, ourstatus);
 
   action.sa_handler = SIG_IGN;
-  sigaction(SIGIO, &action, NULL);
+#ifndef WINNT
+  sigaction(SIGIO, &action, NULL); 
+#endif
 
   return pid;
 }
@@ -1239,8 +1279,8 @@ static void
 gdbtk_init ()
 {
   struct cleanup *old_chain;
-  char *gdbtk_filename;
-  int i;
+  char *lib, *gdbtk_lib, gdbtk_lib_tmp[1024],gdbtk_file[128];
+  int i, found_main;
   struct sigaction action;
   static sigset_t nullsigmask = {0};
 
@@ -1248,8 +1288,10 @@ gdbtk_init ()
      causing gdb to abort.  If instead we simply return here, gdb will
      gracefully degrade to using the command line interface. */
 
+#ifndef WINNT
   if (getenv ("DISPLAY") == NULL)
     return;
+#endif
 
   old_chain = make_cleanup (cleanup_init, 0);
 
@@ -1263,11 +1305,17 @@ gdbtk_init ()
   if (Tcl_Init(interp) != TCL_OK)
     error ("Tcl_Init failed: %s", interp->result);
 
+  /*
+    if (Itcl_Init(interp) == TCL_ERROR) 
+  error ("Itcl_Init failed: %s", interp->result);
+    */
+  
   if (Tk_Init(interp) != TCL_OK)
     error ("Tk_Init failed: %s", interp->result);
 
   Tcl_CreateCommand (interp, "gdb_cmd", call_wrapper, gdb_cmd, NULL);
   Tcl_CreateCommand (interp, "gdb_loc", call_wrapper, gdb_loc, NULL);
+  Tcl_CreateCommand (interp, "gdb_path_conv", call_wrapper, gdb_path_conv, NULL);
   Tcl_CreateCommand (interp, "gdb_sourcelines", call_wrapper, gdb_sourcelines,
                     NULL);
   Tcl_CreateCommand (interp, "gdb_listfiles", call_wrapper, gdb_listfiles,
@@ -1310,7 +1358,9 @@ gdbtk_init ()
   action.sa_mask = nullsigmask;
   action.sa_flags = 0;
   action.sa_handler = SIG_IGN;
+#ifndef WINNT
   sigaction(SIGIO, &action, NULL);
+#endif
 
 #ifdef FIOASYNC
   i = 1;
@@ -1330,8 +1380,11 @@ gdbtk_init ()
 #endif /* F_SETOWN */
 #endif /* !SIOCSPGRP */
 #else
+#ifndef WINNT
   if (ioctl (x_fd,  I_SETSIG, S_INPUT|S_RDNORM) < 0)
     perror_with_name ("gdbtk_init: ioctl I_SETSIG failed");
+#endif
+
 #endif /* ifndef FIOASYNC */
 
   add_com ("tk", class_obscure, tk_command,
@@ -1340,25 +1393,66 @@ gdbtk_init ()
   Tcl_LinkVar (interp, "disassemble-from-exec", (char *)&disassemble_from_exec,
               TCL_LINK_INT);
 
-  /* Load up gdbtk.tcl after all the environment stuff has been setup.  */
+  /* find the gdb tcl library and source main.tcl */
 
-  gdbtk_filename = getenv ("GDBTK_FILENAME");
-  if (!gdbtk_filename)
-    if (access ("gdbtk.tcl", R_OK) == 0)
-      gdbtk_filename = "gdbtk.tcl";
+  gdbtk_lib = getenv ("GDBTK_LIBRARY");
+  if (!gdbtk_lib)
+    if (access ("gdbtcl/main.tcl", R_OK) == 0)
+      gdbtk_lib = "gdbtcl";
     else
-      gdbtk_filename = GDBTK_FILENAME;
+      gdbtk_lib = GDBTK_LIBRARY;
+
+  strcpy (gdbtk_lib_tmp, gdbtk_lib);
+  found_main = 0;
+  /* see if GDBTK_LIBRARY is a path list */
+  lib = strtok (gdbtk_lib_tmp, GDBTK_PATH_SEP);
+  do
+    {
+      if (Tcl_VarEval (interp, "lappend auto_path ", lib, NULL) != TCL_OK)
+       {
+         fputs_unfiltered (Tcl_GetVar (interp, "errorInfo", 0), gdb_stderr);
+         error ("");
+       }
+      if (!found_main)
+       {
+         strcpy (gdbtk_file, lib);
+         strcat (gdbtk_file, "/main.tcl");
+         if (access (gdbtk_file, R_OK) == 0)
+           {
+             found_main++;
+             Tcl_SetVar (interp, "GDBTK_LIBRARY", lib, 0);
+           }
+       }
+     } 
+  while (lib = strtok (NULL, ":"));
+  
+  if (!found_main)
+    {
+      fputs_unfiltered_hook = NULL; /* Force errors to stdout/stderr */
+      if (getenv("GDBTK_LIBRARY"))
+       {
+         fprintf_unfiltered (stderr, "Unable to find main.tcl in %s\n",getenv("GDBTK_LIBRARY"));
+         fprintf_unfiltered (stderr, 
+                             "Please set GDBTK_LIBRARY to a path that includes the GDB tcl files.\n");
+       }
+      else
+       {
+         fprintf_unfiltered (stderr, "Unable to find main.tcl in %s\n", GDBTK_LIBRARY);
+         fprintf_unfiltered (stderr, "You might want to set GDBTK_LIBRARY\n");   
+       }
+      error("");
+    }
 
 /* Defer setup of fputs_unfiltered_hook to near the end so that error messages
    prior to this point go to stdout/stderr.  */
 
   fputs_unfiltered_hook = gdbtk_fputs;
 
-  if (Tcl_EvalFile (interp, gdbtk_filename) != TCL_OK)
+  if (Tcl_EvalFile (interp, gdbtk_file) != TCL_OK)
     {
       fputs_unfiltered_hook = NULL; /* Force errors to stdout/stderr */
 
-      fprintf_unfiltered (stderr, "%s:%d: %s\n", gdbtk_filename,
+      fprintf_unfiltered (stderr, "%s:%d: %s\n", gdbtk_file,
                          interp->errorLine, interp->result);
 
       fputs_unfiltered ("Stack trace:\n", gdb_stderr);
This page took 0.049143 seconds and 4 git commands to generate.