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.
============
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
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.]
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:
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
===========
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
fi
-
ac_aux_dir=
for ac_dir in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/..; do
if test -f $ac_dir/install-sh; then
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
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
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
# 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
# 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
# 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
# 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
# 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
# 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
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>
#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*
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
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
:
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')
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
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*
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>
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() {
; 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
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. */
; 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
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
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
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
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
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() {
; 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
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
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 1745 "configure"
+#line 1744 "configure"
#include "confdefs.h"
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
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
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
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 1821 "configure"
+#line 1820 "configure"
#include "confdefs.h"
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
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*
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. */
; 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
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
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.
}
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
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>
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
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>
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
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>
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
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
;;
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
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
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
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
*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 ;;
*)
# Default is on for everything but go32 and cygwin32
case "$host" in
- *go32* | *cygwin32* | *windows*)
+ *go32* | *windows*)
;;
*)
enable_gdbtk=yes ;;
fi
+case "${target}" in
+*-cygwin32)
+ configdir="win"
+ ;;
+*)
+ configdir="unix"
+ ;;
+esac
+
if test "${enable_gdbtk}" = "yes"; 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
`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
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
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
`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
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
# 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"
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*
#
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"
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*
/* 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.
#include "target.h"
#include <tcl.h>
#include <tk.h>
+/* #include <itcl.h> */
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#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... */
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 *[]));
static int disassemble_from_exec = -1;
+static char *Gdbtk_Library;
+
/* Supply malloc calls for tcl/tk. */
char *
}
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;
Tcl_Interp *interp;
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;
}
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};
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);
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,
action.sa_mask = nullsigmask;
action.sa_flags = 0;
action.sa_handler = SIG_IGN;
+#ifndef WINNT
sigaction(SIGIO, &action, NULL);
+#endif
#ifdef FIOASYNC
i = 1;
#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,
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);