From: hjl Date: Tue, 4 Apr 2000 02:08:51 +0000 (+0000) Subject: 2000-04-03 H.J. Lu X-Git-Tag: pre-cygwin-heap~1940 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b238d59ba76dae7f8b574c029826ba5638d87b4f;p=pf3gnuchains%2Fpf3gnuchains4x.git 2000-04-03 H.J. Lu * gdb_regex.h: New. Include "regex.h" if USE_INCLUDED_REGEX is defined and otherwise. * irix5-nat.c: Include "gdb_regex.h" instead of "gnu-regex.h". * monitor.c: Likewise. * osfsolib.c: Likewise. * solib.c: Likewise. * source.c: Likewise. * symtab.c: Likewise. * Makefile.in (REGEX): Changed to @REGEX@. (REGEX_CFLAGS): New. (REGEX1): Removed. (ADD_DEPS): Use $(REGEX) instead of $(REGEX1). (INTERNAL_WARN_CFLAGS): Add $(REGEX_CFLAGS). * configure.in (--with-included-regex): New switch. (REGEX): New. Subsstitue @REGEX@ in Makefile.in. (REGEX_CFLAGS): New. Subsstitue @REGEX_CFLAGS@ in Makefile.in. * configure: Regenerated. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3b530901c7..e44dc91528 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,26 @@ +2000-04-03 H.J. Lu + + * gdb_regex.h: New. Include "regex.h" if USE_INCLUDED_REGEX + is defined and otherwise. + + * irix5-nat.c: Include "gdb_regex.h" instead of "gnu-regex.h". + * monitor.c: Likewise. + * osfsolib.c: Likewise. + * solib.c: Likewise. + * source.c: Likewise. + * symtab.c: Likewise. + + * Makefile.in (REGEX): Changed to @REGEX@. + (REGEX_CFLAGS): New. + (REGEX1): Removed. + (ADD_DEPS): Use $(REGEX) instead of $(REGEX1). + (INTERNAL_WARN_CFLAGS): Add $(REGEX_CFLAGS). + + * configure.in (--with-included-regex): New switch. + (REGEX): New. Subsstitue @REGEX@ in Makefile.in. + (REGEX_CFLAGS): New. Subsstitue @REGEX_CFLAGS@ in Makefile.in. + * configure: Regenerated. + 2000-04-03 Kevin Buettner * NEWS (powerpc-*-linux*): Mention. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index ef4a8245a9..5628234a42 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -114,6 +114,11 @@ LIBIBERTY = ../libiberty/libiberty.a MMALLOC = @MMALLOC@ MMALLOC_CFLAGS = @MMALLOC_CFLAGS@ +# We are using our own version of REGEX now to be consistent across +# machines. +REGEX = @REGEX@ +REGEX_CFLAGS = @REGEX_CFLAGS@ + # Where is the BFD library? Typically in ../bfd. BFD_DIR = ../bfd BFD = $(BFD_DIR)/libbfd.a @@ -271,7 +276,8 @@ INTERNAL_WARN_CFLAGS = \ $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \ $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \ $(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \ - $(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) $(GDB_WARN_CFLAGS) + $(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) \ + $(REGEX_CFLAGS) $(GDB_WARN_CFLAGS) INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS) # LDFLAGS is specifically reserved for setting from the command line @@ -283,11 +289,6 @@ INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS) INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS) @HLDFLAGS@ HLDENV = @HLDENV@ -# We are using our own version of REGEX now to be consistent across -# machines. -REGEX = gnu-regex.o -REGEX1 = gnu-regex.o - # If your system is missing alloca(), or, more likely, it's there but # it doesn't work, then refer to libiberty. @@ -308,7 +309,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \ $(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) -ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) +ADD_DEPS = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES) VERSION = 20000204 DIST=gdb diff --git a/gdb/configure b/gdb/configure index 698308bc7c..752b023024 100755 --- a/gdb/configure +++ b/gdb/configure @@ -28,6 +28,8 @@ ac_help="$ac_help ac_help="$ac_help --with-mmalloc Use memory mapped malloc package" ac_help="$ac_help + --with-included-regex Use included regex" +ac_help="$ac_help --with-cpu=CPU Set the default CPU variant to debug" ac_help="$ac_help --enable-gdbtk Enable GDBTK GUI front end" @@ -577,7 +579,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:581: checking for $ac_word" >&5 +echo "configure:583: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -607,7 +609,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:611: checking for $ac_word" >&5 +echo "configure:613: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -658,7 +660,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:662: checking for $ac_word" >&5 +echo "configure:664: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -690,7 +692,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:696: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -701,12 +703,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 705 "configure" +#line 707 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:712: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -732,12 +734,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:736: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:738: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:741: checking whether we are using GNU C" >&5 +echo "configure:743: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -746,7 +748,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -765,7 +767,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:769: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:771: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -797,7 +799,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:801: checking how to run the C preprocessor" >&5 +echo "configure:803: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -812,13 +814,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -829,13 +831,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -846,13 +848,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -877,9 +879,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:881: checking for AIX" >&5 +echo "configure:883: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:905: checking for POSIXized ISC" >&5 +echo "configure:907: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -925,7 +927,7 @@ fi echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:929: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:931: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -941,7 +943,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__ do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -978,7 +980,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } EOF -if { (eval echo configure:982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:984: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1049,7 +1051,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:1053: checking host system type" >&5 +echo "configure:1055: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1070,7 +1072,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:1074: checking target system type" >&5 +echo "configure:1076: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -1088,7 +1090,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:1092: checking build system type" >&5 +echo "configure:1094: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1113,7 +1115,7 @@ test "$host_alias" != "$target_alias" && ALL_LINGUAS= echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1117: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1119: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1142,7 +1144,7 @@ fi # 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:1146: checking for $ac_word" >&5 +echo "configure:1148: 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 @@ -1170,12 +1172,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1174: checking for ANSI C header files" >&5 +echo "configure:1176: 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 < #include @@ -1183,7 +1185,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1200,7 +1202,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 @@ -1218,7 +1220,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 @@ -1239,7 +1241,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1250,7 +1252,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1274,12 +1276,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1278: checking for working const" >&5 +echo "configure:1280: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1349,21 +1351,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1353: checking for inline" >&5 +echo "configure:1355: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1389,12 +1391,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1393: checking for off_t" >&5 +echo "configure:1395: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1422,12 +1424,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1426: checking for size_t" >&5 +echo "configure:1428: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1457,19 +1459,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1461: checking for working alloca.h" >&5 +echo "configure:1463: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1490,12 +1492,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1494: checking for alloca" >&5 +echo "configure:1496: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1555,12 +1557,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1559: checking whether alloca needs Cray hooks" >&5 +echo "configure:1561: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1589: checking for $ac_func" >&5 +echo "configure:1591: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1640,7 +1642,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1644: checking stack direction for C alloca" >&5 +echo "configure:1646: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1648,7 +1650,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1692,17 +1694,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:1696: checking for $ac_hdr" >&5 +echo "configure:1698: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1731,12 +1733,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1735: checking for $ac_func" >&5 +echo "configure:1737: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1784,7 +1786,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1788: checking for working mmap" >&5 +echo "configure:1790: 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 @@ -1792,7 +1794,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -1960,17 +1962,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1964: checking for $ac_hdr" >&5 +echo "configure:1966: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2000,12 +2002,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2004: checking for $ac_func" >&5 +echo "configure:2006: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2057,12 +2059,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2061: checking for $ac_func" >&5 +echo "configure:2063: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2119,19 +2121,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2123: checking for LC_MESSAGES" >&5 +echo "configure:2125: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2152,7 +2154,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2156: checking whether NLS is requested" >&5 +echo "configure:2158: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2172,7 +2174,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2176: checking whether included gettext is requested" >&5 +echo "configure:2178: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2191,17 +2193,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2195: checking for libintl.h" >&5 +echo "configure:2197: checking for libintl.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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2218,19 +2220,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2222: checking for gettext in libc" >&5 +echo "configure:2224: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -2246,7 +2248,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:2250: checking for bindtextdomain in -lintl" >&5 +echo "configure:2252: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2254,7 +2256,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2281,19 +2283,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:2285: checking for gettext in libintl" >&5 +echo "configure:2287: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -2321,7 +2323,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2325: checking for $ac_word" >&5 +echo "configure:2327: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2355,12 +2357,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2359: checking for $ac_func" >&5 +echo "configure:2361: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2410,7 +2412,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2414: checking for $ac_word" >&5 +echo "configure:2416: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2446,7 +2448,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2450: checking for $ac_word" >&5 +echo "configure:2452: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2478,7 +2480,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2518,7 +2520,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2522: checking for $ac_word" >&5 +echo "configure:2524: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2552,7 +2554,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2556: checking for $ac_word" >&5 +echo "configure:2558: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2588,7 +2590,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2592: checking for $ac_word" >&5 +echo "configure:2594: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2678,7 +2680,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2682: checking for catalogs to be installed" >&5 +echo "configure:2684: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2706,17 +2708,17 @@ echo "configure:2682: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:2710: checking for linux/version.h" >&5 +echo "configure:2712: checking for linux/version.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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2818,7 +2820,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:2822: checking for $ac_word" >&5 +echo "configure:2824: 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 @@ -2859,7 +2861,7 @@ done # 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:2863: checking for a BSD compatible install" >&5 +echo "configure:2865: 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 @@ -2920,7 +2922,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:2924: checking for $ac_word" >&5 +echo "configure:2926: 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 @@ -2952,7 +2954,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:2956: checking for $ac_word" >&5 +echo "configure:2958: 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 @@ -2984,7 +2986,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:2988: checking for $ac_word" >&5 +echo "configure:2990: 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 @@ -3021,7 +3023,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:3025: checking for $ac_word" >&5 +echo "configure:3027: 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 @@ -3055,7 +3057,7 @@ test -n "$YACC" || YACC="yacc" # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3059: checking for $ac_word" >&5 +echo "configure:3061: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3106,12 +3108,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3110: checking return type of signal handlers" >&5 +echo "configure:3112: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3128,7 +3130,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3148,12 +3150,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3152: checking for ANSI C header files" >&5 +echo "configure:3154: 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 < #include @@ -3161,7 +3163,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3178,7 +3180,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 @@ -3196,7 +3198,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 @@ -3217,7 +3219,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3228,7 +3230,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3261,17 +3263,17 @@ for ac_hdr in ctype.h curses.h endian.h link.h thread_db.h proc_service.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3265: checking for $ac_hdr" >&5 +echo "configure:3267: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3298,12 +3300,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3302: checking whether stat file-mode macros are broken" >&5 +echo "configure:3304: 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 < #include @@ -3355,12 +3357,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3359: checking for working const" >&5 +echo "configure:3361: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3433,12 +3435,12 @@ fi for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3437: checking for $ac_func" >&5 +echo "configure:3439: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3488,19 +3490,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3492: checking for working alloca.h" >&5 +echo "configure:3494: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3521,12 +3523,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3525: checking for alloca" >&5 +echo "configure:3527: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3586,12 +3588,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3590: checking whether alloca needs Cray hooks" >&5 +echo "configure:3592: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3620: checking for $ac_func" >&5 +echo "configure:3622: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3671,7 +3673,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3675: checking stack direction for C alloca" >&5 +echo "configure:3677: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3679,7 +3681,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3721,19 +3723,19 @@ fi echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:3725: checking for PTRACE_GETREGS" >&5 +echo "configure:3727: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:3737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -3754,19 +3756,19 @@ EOF fi echo $ac_n "checking for PTRACE_GETXFPREGS""... $ac_c" 1>&6 -echo "configure:3758: checking for PTRACE_GETXFPREGS" >&5 +echo "configure:3760: checking for PTRACE_GETXFPREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getxfpregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETXFPREGS; ; return 0; } EOF -if { (eval echo configure:3770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getxfpregs=yes else @@ -3787,7 +3789,7 @@ EOF fi echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:3791: checking for socketpair in -lsocket" >&5 +echo "configure:3793: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3795,7 +3797,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3836,12 +3838,12 @@ fi for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3840: checking for $ac_func" >&5 +echo "configure:3842: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3891,12 +3893,12 @@ done echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:3895: checking whether malloc must be declared" >&5 +echo "configure:3897: 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 < @@ -3917,7 +3919,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:3921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -3938,12 +3940,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:3942: checking whether realloc must be declared" >&5 +echo "configure:3944: 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 < @@ -3964,7 +3966,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:3968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -3985,12 +3987,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:3989: checking whether free must be declared" >&5 +echo "configure:3991: 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 < @@ -4011,7 +4013,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4032,12 +4034,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:4036: checking whether strerror must be declared" >&5 +echo "configure:4038: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4058,7 +4060,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:4062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -4079,12 +4081,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:4083: checking whether strdup must be declared" >&5 +echo "configure:4085: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4105,7 +4107,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:4109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -4126,12 +4128,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4130: checking whether strstr must be declared" >&5 +echo "configure:4132: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4152,7 +4154,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4179,9 +4181,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:4183: checking for HPUX save_state structure" >&5 +echo "configure:4185: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -4196,7 +4198,7 @@ fi rm -f conftest* cat > conftest.$ac_ext < EOF @@ -4263,19 +4265,19 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4267: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4269: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4297,19 +4299,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4301: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:4303: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prrun_t avar ; return 0; } EOF -if { (eval echo configure:4313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -4331,19 +4333,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4335: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:4337: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { gregset_t avar ; return 0; } EOF -if { (eval echo configure:4347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -4365,19 +4367,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4369: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:4371: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fpregset_t avar ; return 0; } EOF -if { (eval echo configure:4381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -4399,19 +4401,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4403: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:4405: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prgregset_t avar ; return 0; } EOF -if { (eval echo configure:4415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -4433,19 +4435,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4437: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:4439: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { prfpregset_t avar ; return 0; } EOF -if { (eval echo configure:4449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -4467,19 +4469,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4471: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:4473: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lwpid_t avar ; return 0; } EOF -if { (eval echo configure:4483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -4501,19 +4503,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4505: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:4507: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { psaddr_t avar ; return 0; } EOF -if { (eval echo configure:4517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -4537,12 +4539,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4541: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:4543: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4555,7 +4557,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4561: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -4577,7 +4579,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:4581: checking for main in -lm" >&5 +echo "configure:4583: 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 @@ -4585,14 +4587,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4621,7 +4623,7 @@ fi echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:4625: checking for wctype in -lc" >&5 +echo "configure:4627: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4629,7 +4631,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4659,7 +4661,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:4663: checking for wctype in -lw" >&5 +echo "configure:4665: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4667,7 +4669,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4710,12 +4712,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:4714: checking for long long support in compiler" >&5 +echo "configure:4716: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -4747,7 +4749,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:4751: checking for long long support in printf" >&5 +echo "configure:4753: 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 @@ -4755,7 +4757,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -4793,19 +4795,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:4797: checking for long double support in compiler" >&5 +echo "configure:4799: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -4827,7 +4829,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:4831: checking for long double support in printf" >&5 +echo "configure:4833: 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 @@ -4835,7 +4837,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -4869,7 +4871,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:4873: checking for long double support in scanf" >&5 +echo "configure:4875: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4877,7 +4879,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:4891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -4913,17 +4915,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:4917: checking for $ac_hdr" >&5 +echo "configure:4919: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4952,12 +4954,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4956: checking for $ac_func" >&5 +echo "configure:4958: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5005,7 +5007,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:5009: checking for working mmap" >&5 +echo "configure:5011: 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 @@ -5013,7 +5015,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -5182,7 +5184,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:5186: checking for HPUX/OSF thread support" >&5 +echo "configure:5188: 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 @@ -5201,7 +5203,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:5205: checking for Solaris thread debugging library" >&5 +echo "configure:5207: 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 @@ -5211,7 +5213,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:5215: checking for dlopen in -ldl" >&5 +echo "configure:5217: 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 @@ -5219,7 +5221,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5262,17 +5264,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:5266: checking for the ld -export-dynamic flag" >&5 +echo "configure:5268: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -5291,13 +5293,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:5295: checking if is old" >&5 +echo "configure:5297: checking if is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5308,7 +5310,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5314: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -5482,15 +5484,68 @@ EOF MMALLOC='../mmalloc/libmmalloc.a' fi +# Check whether --with-included-regex or --without-included-regex was given. +if test "${with_included_regex+set}" = set; then + withval="$with_included_regex" + case "${withval}" in + yes) want_included_regex=true ;; + no) want_included_regex=false;; + *) { echo "configure: error: bad value ${withval} for GDB with-included-regex option" 1>&2; exit 1; } ;; +esac +else + want_included_regex=true +fi + +REGEX="gnu-regex.o" +REGEX_CFLAGS="-DUSE_INCLUDED_REGEX" +if test $want_included_regex = false; then + echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 +echo "configure:5504: checking for GNU regex" >&5 + if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2 +#error No valid GNU regex. +#endif + +; return 0; } +EOF +if { (eval echo configure:5521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + gdb_cv_have_gnu_regex=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gdb_cv_have_gnu_regex=no +fi +rm -f conftest* +fi + + echo "$ac_t""$gdb_cv_have_gnu_regex" 1>&6 + if test $gdb_cv_have_gnu_regex = yes; then + REGEX= + REGEX_CFLAGS= + fi +fi + + # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:5489: checking for cygwin" >&5 +echo "configure:5544: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5528: checking for tgetent in -lncurses" >&5 +echo "configure:5583: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5532,7 +5587,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5562,7 +5617,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:5566: checking for tgetent in -lHcurses" >&5 +echo "configure:5621: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5570,7 +5625,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5600,7 +5655,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:5604: checking for tgetent in -ltermlib" >&5 +echo "configure:5659: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5608,7 +5663,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5638,7 +5693,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:5642: checking for tgetent in -ltermcap" >&5 +echo "configure:5697: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5646,7 +5701,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5676,7 +5731,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:5680: checking for tgetent in -lcurses" >&5 +echo "configure:5735: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5684,7 +5739,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5714,7 +5769,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:5718: checking for tgetent in -lterminfo" >&5 +echo "configure:5773: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5722,7 +5777,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5891,7 +5946,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:5895: checking for Tcl configuration" >&5 +echo "configure:5950: 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 @@ -5999,7 +6054,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:6003: checking for Tk configuration" >&5 +echo "configure:6058: 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 @@ -6095,7 +6150,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:6099: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:6154: 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" @@ -6161,17 +6216,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:6165: checking for tclInt.h" >&5 +echo "configure:6220: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6231,7 +6286,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:6235: checking for Tk private headers" >&5 +echo "configure:6290: 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" @@ -6297,17 +6352,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:6301: checking for tk.h" >&5 +echo "configure:6356: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6353,7 +6408,7 @@ fi echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:6357: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:6412: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -6376,7 +6431,7 @@ fi echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:6380: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:6435: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -6399,7 +6454,7 @@ fi echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:6403: checking for Tix private headers. srcdir=${srcdir}" >&5 +echo "configure:6458: checking for Tix private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_tixh}" = x ; then for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do if test -f $i/generic/tix.h ; then @@ -6437,7 +6492,7 @@ if test "${with_itclconfig+set}" = set; then fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:6441: checking for Itcl configuration" >&5 +echo "configure:6496: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6549,7 +6604,7 @@ if test "${with_itkconfig+set}" = set; then fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:6553: checking for Itk configuration" >&5 +echo "configure:6608: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6661,7 +6716,7 @@ if test "${with_tixconfig+set}" = set; then fi echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6 -echo "configure:6665: checking for Tix configuration" >&5 +echo "configure:6720: checking for Tix configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6800,7 +6855,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:6804: checking for X" >&5 +echo "configure:6859: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -6862,12 +6917,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6936,14 +6991,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -7106,7 +7161,7 @@ if test "${shared}" = "true"; then ;; *-*-linux*aout*) ;; - *-*-linux* | *-pc-linux-gnu) + *-*-linux* | *-pc-linux-gnu*) HLDFLAGS='-Wl,-rpath,$(libdir)' ;; *-*-solaris*) @@ -7225,7 +7280,7 @@ files="${files} config/nm-empty.h" links="${links} nm.h" fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:7229: checking whether ln -s works" >&5 +echo "configure:7284: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7249,12 +7304,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:7253: checking for Cygwin environment" >&5 +echo "configure:7308: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -7282,19 +7337,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:7286: checking for mingw32 environment" >&5 +echo "configure:7341: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -7313,7 +7368,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:7317: checking for executable suffix" >&5 +echo "configure:7372: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7323,7 +7378,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:7327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:7382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -7533,6 +7588,8 @@ s%@WARN_CFLAGS@%$WARN_CFLAGS%g s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g s%@MMALLOC_CFLAGS@%$MMALLOC_CFLAGS%g s%@MMALLOC@%$MMALLOC%g +s%@REGEX@%$REGEX%g +s%@REGEX_CFLAGS@%$REGEX_CFLAGS%g s%@DLLTOOL@%$DLLTOOL%g s%@WINDRES@%$WINDRES%g s%@TERM_LIB@%$TERM_LIB%g diff --git a/gdb/configure.in b/gdb/configure.in index c2c5df68ea..e486cb56df 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -503,6 +503,36 @@ if test x$want_mmalloc = xtrue; then MMALLOC='../mmalloc/libmmalloc.a' fi +AC_ARG_WITH(included-regex, +[ --with-included-regex Use included regex], +[case "${withval}" in + yes) want_included_regex=true ;; + no) want_included_regex=false;; + *) AC_MSG_ERROR(bad value ${withval} for GDB with-included-regex option) ;; +esac],[want_included_regex=true])dnl + +REGEX="gnu-regex.o" +REGEX_CFLAGS="-DUSE_INCLUDED_REGEX" +if test $want_included_regex = false; then + AC_MSG_CHECKING(for GNU regex) + AC_CACHE_VAL(gdb_cv_have_gnu_regex, +[AC_TRY_COMPILE([#include +#include +#include ], +[#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2 +#error No valid GNU regex. +#endif +], + [gdb_cv_have_gnu_regex=yes], + [gdb_cv_have_gnu_regex=no])]) + AC_MSG_RESULT($gdb_cv_have_gnu_regex) + if test $gdb_cv_have_gnu_regex = yes; then + REGEX= + REGEX_CFLAGS= + fi +fi +AC_SUBST(REGEX) +AC_SUBST(REGEX_CFLAGS) # In the Cygwin environment, we need some additional flags. AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin, diff --git a/gdb/gdb_regex.h b/gdb/gdb_regex.h new file mode 100644 index 0000000000..09aaf0862d --- /dev/null +++ b/gdb/gdb_regex.h @@ -0,0 +1,28 @@ +/* Portable + Copyright 2000 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _GDB_REGEX_H +#define _GDB_REGEX_H +#ifdef USE_INCLUDED_REGEX +#include "gnu-regex.h" +#else +#include +#endif +#endif /* _GDB_REGEX_H */ diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index b3373a9916..0c090de647 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -6,21 +6,22 @@ Implemented for Irix 4.x by Garrett A. Wollman. Modified for Irix 5.x by Ian Lance Taylor. -This file is part of GDB. + This file is part of GDB. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include "defs.h" #include "inferior.h" @@ -46,22 +47,23 @@ fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR)); * any MIPS SVR4 target. */ -void +void supply_gregset (gregsetp) gregset_t *gregsetp; { register int regi; register greg_t *regp = &(*gregsetp)[0]; int gregoff = sizeof (greg_t) - MIPS_REGSIZE; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + static char zerobuf[MAX_REGISTER_RAW_SIZE] = + {0}; - for(regi = 0; regi <= CTX_RA; regi++) - supply_register (regi, (char *)(regp + regi) + gregoff); + for (regi = 0; regi <= CTX_RA; regi++) + supply_register (regi, (char *) (regp + regi) + gregoff); - supply_register (PC_REGNUM, (char *)(regp + CTX_EPC) + gregoff); - supply_register (HI_REGNUM, (char *)(regp + CTX_MDHI) + gregoff); - supply_register (LO_REGNUM, (char *)(regp + CTX_MDLO) + gregoff); - supply_register (CAUSE_REGNUM, (char *)(regp + CTX_CAUSE) + gregoff); + supply_register (PC_REGNUM, (char *) (regp + CTX_EPC) + gregoff); + supply_register (HI_REGNUM, (char *) (regp + CTX_MDHI) + gregoff); + supply_register (LO_REGNUM, (char *) (regp + CTX_MDLO) + gregoff); + supply_register (CAUSE_REGNUM, (char *) (regp + CTX_CAUSE) + gregoff); /* Fill inaccessible registers with zero. */ supply_register (BADVADDR_REGNUM, zerobuf); @@ -119,15 +121,16 @@ supply_fpregset (fpregsetp) fpregset_t *fpregsetp; { register int regi; - static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0}; + static char zerobuf[MAX_REGISTER_RAW_SIZE] = + {0}; /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */ for (regi = 0; regi < 32; regi++) supply_register (FP0_REGNUM + regi, - (char *)&fpregsetp->fp_r.fp_regs[regi]); + (char *) &fpregsetp->fp_r.fp_regs[regi]); - supply_register (FCRCS_REGNUM, (char *)&fpregsetp->fp_csr); + supply_register (FCRCS_REGNUM, (char *) &fpregsetp->fp_csr); /* FIXME: how can we supply FCRIR_REGNUM? SGI doesn't tell us. */ supply_register (FCRIR_REGNUM, zerobuf); @@ -149,12 +152,12 @@ fill_fpregset (fpregsetp, regno) { from = (char *) ®isters[REGISTER_BYTE (regi)]; to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]); - memcpy(to, from, REGISTER_RAW_SIZE (regi)); + memcpy (to, from, REGISTER_RAW_SIZE (regi)); } } if ((regno == -1) || (regno == FCRCS_REGNUM)) - fpregsetp->fp_csr = *(unsigned *) ®isters[REGISTER_BYTE(FCRCS_REGNUM)]; + fpregsetp->fp_csr = *(unsigned *) ®isters[REGISTER_BYTE (FCRCS_REGNUM)]; } @@ -190,13 +193,13 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) { if (core_reg_size == REGISTER_BYTES) { - memcpy ((char *)registers, core_reg_sect, core_reg_size); + memcpy ((char *) registers, core_reg_sect, core_reg_size); } else if (MIPS_REGSIZE == 4 && core_reg_size == (2 * MIPS_REGSIZE) * NUM_REGS) { /* This is a core file from a N32 executable, 64 bits are saved - for all registers. */ + for all registers. */ char *srcp = core_reg_sect; char *dstp = registers; int regno; @@ -206,16 +209,16 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) if (regno >= FP0_REGNUM && regno < (FP0_REGNUM + 32)) { /* FIXME, this is wrong, N32 has 64 bit FP regs, but GDB - currently assumes that they are 32 bit. */ + currently assumes that they are 32 bit. */ *dstp++ = *srcp++; *dstp++ = *srcp++; *dstp++ = *srcp++; *dstp++ = *srcp++; - if (REGISTER_RAW_SIZE(regno) == 4) + if (REGISTER_RAW_SIZE (regno) == 4) { /* copying 4 bytes from eight bytes? I don't see how this can be right... */ - srcp += 4; + srcp += 4; } else { @@ -275,7 +278,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) #include "objfiles.h" #include "command.h" #include "frame.h" -#include "gnu-regex.h" +#include "gdb_regex.h" #include "inferior.h" #include "language.h" #include "gdbcmd.h" @@ -289,19 +292,21 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) typedef enum { - OBJ_LIST_OLD, /* Pre Irix 6.x object list. */ - OBJ_LIST_32, /* 32 Bit Elf32_Obj_Info. */ - OBJ_LIST_64 /* 64 Bit Elf64_Obj_Info, FIXME not yet implemented. */ -} obj_list_variant; + OBJ_LIST_OLD, /* Pre Irix 6.x object list. */ + OBJ_LIST_32, /* 32 Bit Elf32_Obj_Info. */ + OBJ_LIST_64 /* 64 Bit Elf64_Obj_Info, FIXME not yet implemented. */ +} +obj_list_variant; /* Define our own link_map structure. This will help to share code with osfsolib.c and solib.c. */ -struct link_map { - obj_list_variant l_variant; /* which variant of object list */ - CORE_ADDR l_lladdr; /* addr in inferior list was read from */ - CORE_ADDR l_next; /* address of next object list entry */ -}; +struct link_map + { + obj_list_variant l_variant; /* which variant of object list */ + CORE_ADDR l_lladdr; /* addr in inferior list was read from */ + CORE_ADDR l_next; /* address of next object list entry */ + }; /* Irix 5 shared objects are pre-linked to particular addresses although the dynamic linker may have to relocate them if the @@ -314,24 +319,25 @@ struct link_map { char shadow_contents[BREAKPOINT_MAX]; /* Stash old bkpt addr contents */ -struct so_list { - struct so_list *next; /* next structure in linked list */ - struct link_map lm; - CORE_ADDR offset; /* prelink to load address offset */ - char *so_name; /* shared object lib name */ - CORE_ADDR lmstart; /* lower addr bound of mapped object */ - CORE_ADDR lmend; /* upper addr bound of mapped object */ - char symbols_loaded; /* flag: symbols read in yet? */ - char from_tty; /* flag: print msgs? */ - struct objfile *objfile; /* objfile for loaded lib */ - struct section_table *sections; - struct section_table *sections_end; - struct section_table *textsection; - bfd *abfd; -}; +struct so_list + { + struct so_list *next; /* next structure in linked list */ + struct link_map lm; + CORE_ADDR offset; /* prelink to load address offset */ + char *so_name; /* shared object lib name */ + CORE_ADDR lmstart; /* lower addr bound of mapped object */ + CORE_ADDR lmend; /* upper addr bound of mapped object */ + char symbols_loaded; /* flag: symbols read in yet? */ + char from_tty; /* flag: print msgs? */ + struct objfile *objfile; /* objfile for loaded lib */ + struct section_table *sections; + struct section_table *sections_end; + struct section_table *textsection; + bfd *abfd; + }; static struct so_list *so_list_head; /* List of known shared objects */ -static CORE_ADDR debug_base; /* Base of dynamic linker structures */ +static CORE_ADDR debug_base; /* Base of dynamic linker structures */ static CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */ /* Local function prototypes */ @@ -352,48 +358,48 @@ static int symbol_add_stub PARAMS ((char *)); static struct so_list * -find_solib PARAMS ((struct so_list *)); + find_solib PARAMS ((struct so_list *)); static struct link_map * -first_link_map_member PARAMS ((void)); + first_link_map_member PARAMS ((void)); static struct link_map * -next_link_map_member PARAMS ((struct so_list *)); + next_link_map_member PARAMS ((struct so_list *)); static void xfer_link_map_member PARAMS ((struct so_list *, struct link_map *)); static CORE_ADDR -locate_base PARAMS ((void)); + locate_base PARAMS ((void)); static int solib_map_sections PARAMS ((char *)); /* -LOCAL FUNCTION + LOCAL FUNCTION - solib_map_sections -- open bfd and build sections for shared lib + solib_map_sections -- open bfd and build sections for shared lib -SYNOPSIS + SYNOPSIS - static int solib_map_sections (struct so_list *so) + static int solib_map_sections (struct so_list *so) -DESCRIPTION + DESCRIPTION - Given a pointer to one of the shared objects in our list - of mapped objects, use the recorded name to open a bfd - descriptor for the object, build a section table, and then - relocate all the section addresses by the base address at - which the shared object was mapped. + Given a pointer to one of the shared objects in our list + of mapped objects, use the recorded name to open a bfd + descriptor for the object, build a section table, and then + relocate all the section addresses by the base address at + which the shared object was mapped. -FIXMES + FIXMES - In most (all?) cases the shared object file name recorded in the - dynamic linkage tables will be a fully qualified pathname. For - cases where it isn't, do we really mimic the systems search - mechanism correctly in the below code (particularly the tilde - expansion stuff?). + In most (all?) cases the shared object file name recorded in the + dynamic linkage tables will be a fully qualified pathname. For + cases where it isn't, do we really mimic the systems search + mechanism correctly in the below code (particularly the tilde + expansion stuff?). */ static int @@ -407,10 +413,10 @@ solib_map_sections (arg) struct section_table *p; struct cleanup *old_chain; bfd *abfd; - - filename = tilde_expand (so -> so_name); + + filename = tilde_expand (so->so_name); old_chain = make_cleanup (free, filename); - + scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, &scratch_pathname); if (scratch_chan < 0) @@ -432,31 +438,31 @@ solib_map_sections (arg) scratch_pathname, bfd_errmsg (bfd_get_error ())); } /* Leave bfd open, core_xfer_memory and "info files" need it. */ - so -> abfd = abfd; - abfd -> cacheable = true; + so->abfd = abfd; + abfd->cacheable = true; if (!bfd_check_format (abfd, bfd_object)) { error ("\"%s\": not in executable format: %s.", scratch_pathname, bfd_errmsg (bfd_get_error ())); } - if (build_section_table (abfd, &so -> sections, &so -> sections_end)) + if (build_section_table (abfd, &so->sections, &so->sections_end)) { - error ("Can't find the file sections in `%s': %s", + error ("Can't find the file sections in `%s': %s", bfd_get_filename (exec_bfd), bfd_errmsg (bfd_get_error ())); } - for (p = so -> sections; p < so -> sections_end; p++) + for (p = so->sections; p < so->sections_end; p++) { /* Relocate the section binding addresses as recorded in the shared - object's file by the offset to get the address to which the - object was actually mapped. */ - p -> addr += LM_OFFSET (so); - p -> endaddr += LM_OFFSET (so); - so -> lmend = (CORE_ADDR) max (p -> endaddr, so -> lmend); - if (STREQ (p -> the_bfd_section -> name, ".text")) + object's file by the offset to get the address to which the + object was actually mapped. */ + p->addr += LM_OFFSET (so); + p->endaddr += LM_OFFSET (so); + so->lmend = (CORE_ADDR) max (p->endaddr, so->lmend); + if (STREQ (p->the_bfd_section->name, ".text")) { - so -> textsection = p; + so->textsection = p; } } @@ -468,48 +474,48 @@ solib_map_sections (arg) /* -LOCAL FUNCTION + LOCAL FUNCTION - locate_base -- locate the base address of dynamic linker structs + locate_base -- locate the base address of dynamic linker structs -SYNOPSIS + SYNOPSIS - CORE_ADDR locate_base (void) + CORE_ADDR locate_base (void) -DESCRIPTION + DESCRIPTION - For both the SunOS and SVR4 shared library implementations, if the - inferior executable has been linked dynamically, there is a single - address somewhere in the inferior's data space which is the key to - locating all of the dynamic linker's runtime structures. This - address is the value of the symbol defined by the macro DEBUG_BASE. - The job of this function is to find and return that address, or to - return 0 if there is no such address (the executable is statically - linked for example). + For both the SunOS and SVR4 shared library implementations, if the + inferior executable has been linked dynamically, there is a single + address somewhere in the inferior's data space which is the key to + locating all of the dynamic linker's runtime structures. This + address is the value of the symbol defined by the macro DEBUG_BASE. + The job of this function is to find and return that address, or to + return 0 if there is no such address (the executable is statically + linked for example). - For SunOS, the job is almost trivial, since the dynamic linker and - all of it's structures are statically linked to the executable at - link time. Thus the symbol for the address we are looking for has - already been added to the minimal symbol table for the executable's - objfile at the time the symbol file's symbols were read, and all we - have to do is look it up there. Note that we explicitly do NOT want - to find the copies in the shared library. + For SunOS, the job is almost trivial, since the dynamic linker and + all of it's structures are statically linked to the executable at + link time. Thus the symbol for the address we are looking for has + already been added to the minimal symbol table for the executable's + objfile at the time the symbol file's symbols were read, and all we + have to do is look it up there. Note that we explicitly do NOT want + to find the copies in the shared library. - The SVR4 version is much more complicated because the dynamic linker - and it's structures are located in the shared C library, which gets - run as the executable's "interpreter" by the kernel. We have to go - to a lot more work to discover the address of DEBUG_BASE. Because - of this complexity, we cache the value we find and return that value - on subsequent invocations. Note there is no copy in the executable - symbol tables. + The SVR4 version is much more complicated because the dynamic linker + and it's structures are located in the shared C library, which gets + run as the executable's "interpreter" by the kernel. We have to go + to a lot more work to discover the address of DEBUG_BASE. Because + of this complexity, we cache the value we find and return that value + on subsequent invocations. Note there is no copy in the executable + symbol tables. - Irix 5 is basically like SunOS. + Irix 5 is basically like SunOS. - Note that we can assume nothing about the process state at the time - we need to find this address. We may be stopped on the first instruc- - tion of the interpreter (C shared library), the first instruction of - the executable itself, or somewhere else entirely (if we attached - to the process for example). + Note that we can assume nothing about the process state at the time + we need to find this address. We may be stopped on the first instruc- + tion of the interpreter (C shared library), the first instruction of + the executable itself, or somewhere else entirely (if we attached + to the process for example). */ @@ -529,20 +535,20 @@ locate_base () /* -LOCAL FUNCTION + LOCAL FUNCTION - first_link_map_member -- locate first member in dynamic linker's map + first_link_map_member -- locate first member in dynamic linker's map -SYNOPSIS + SYNOPSIS - static struct link_map *first_link_map_member (void) + static struct link_map *first_link_map_member (void) -DESCRIPTION + DESCRIPTION - Read in a copy of the first member in the inferior's dynamic - link map from the inferior's dynamic linker structures, and return - a pointer to the link map descriptor. -*/ + Read in a copy of the first member in the inferior's dynamic + link map from the inferior's dynamic linker structures, and return + a pointer to the link map descriptor. + */ static struct link_map * first_link_map_member () @@ -572,7 +578,7 @@ first_link_map_member () /* The first entry in the list is the object file we are debugging, so skip it. */ - next_lladdr = (CORE_ADDR) list_old.next; + next_lladdr = (CORE_ADDR) list_old.next; #ifdef HANDLE_NEW_OBJ_LIST if (list_old.data == NEW_OBJ_INFO_MAGIC) @@ -582,7 +588,7 @@ first_link_map_member () read_memory (lladdr, (char *) &list_32, sizeof (Elf32_Obj_Info)); if (list_32.oi_size != sizeof (Elf32_Obj_Info)) return NULL; - next_lladdr = (CORE_ADDR) list_32.oi_next; + next_lladdr = (CORE_ADDR) list_32.oi_next; } #endif @@ -596,49 +602,49 @@ first_link_map_member () /* -LOCAL FUNCTION + LOCAL FUNCTION - next_link_map_member -- locate next member in dynamic linker's map + next_link_map_member -- locate next member in dynamic linker's map -SYNOPSIS + SYNOPSIS - static struct link_map *next_link_map_member (so_list_ptr) + static struct link_map *next_link_map_member (so_list_ptr) -DESCRIPTION + DESCRIPTION - Read in a copy of the next member in the inferior's dynamic - link map from the inferior's dynamic linker structures, and return - a pointer to the link map descriptor. -*/ + Read in a copy of the next member in the inferior's dynamic + link map from the inferior's dynamic linker structures, and return + a pointer to the link map descriptor. + */ static struct link_map * next_link_map_member (so_list_ptr) struct so_list *so_list_ptr; { - struct link_map *lm = &so_list_ptr -> lm; - CORE_ADDR next_lladdr = lm -> l_next; + struct link_map *lm = &so_list_ptr->lm; + CORE_ADDR next_lladdr = lm->l_next; static struct link_map next_lm; if (next_lladdr == 0) { /* We have hit the end of the list, so check to see if any were - added, but be quiet if we can't read from the target any more. */ + added, but be quiet if we can't read from the target any more. */ int status = 0; - if (lm -> l_variant == OBJ_LIST_OLD) + if (lm->l_variant == OBJ_LIST_OLD) { struct obj_list list_old; - status = target_read_memory (lm -> l_lladdr, + status = target_read_memory (lm->l_lladdr, (char *) &list_old, sizeof (struct obj_list)); next_lladdr = (CORE_ADDR) list_old.next; } #ifdef HANDLE_NEW_OBJ_LIST - else if (lm -> l_variant == OBJ_LIST_32) + else if (lm->l_variant == OBJ_LIST_32) { Elf32_Obj_Info list_32; - status = target_read_memory (lm -> l_lladdr, + status = target_read_memory (lm->l_lladdr, (char *) &list_32, sizeof (Elf32_Obj_Info)); next_lladdr = (CORE_ADDR) list_32.oi_next; @@ -656,20 +662,20 @@ next_link_map_member (so_list_ptr) /* -LOCAL FUNCTION + LOCAL FUNCTION - xfer_link_map_member -- set local variables from dynamic linker's map + xfer_link_map_member -- set local variables from dynamic linker's map -SYNOPSIS + SYNOPSIS - static void xfer_link_map_member (so_list_ptr, lm) + static void xfer_link_map_member (so_list_ptr, lm) -DESCRIPTION + DESCRIPTION - Read in a copy of the requested member in the inferior's dynamic - link map from the inferior's dynamic linker structures, and fill - in the necessary so_list_ptr elements. -*/ + Read in a copy of the requested member in the inferior's dynamic + link map from the inferior's dynamic linker structures, and fill + in the necessary so_list_ptr elements. + */ static void xfer_link_map_member (so_list_ptr, lm) @@ -677,15 +683,15 @@ xfer_link_map_member (so_list_ptr, lm) struct link_map *lm; { struct obj_list list_old; - CORE_ADDR lladdr = lm -> l_lladdr; - struct link_map *new_lm = &so_list_ptr -> lm; + CORE_ADDR lladdr = lm->l_lladdr; + struct link_map *new_lm = &so_list_ptr->lm; int errcode; read_memory (lladdr, (char *) &list_old, sizeof (struct obj_list)); - new_lm -> l_variant = OBJ_LIST_OLD; - new_lm -> l_lladdr = lladdr; - new_lm -> l_next = (CORE_ADDR) list_old.next; + new_lm->l_variant = OBJ_LIST_OLD; + new_lm->l_lladdr = lladdr; + new_lm->l_next = (CORE_ADDR) list_old.next; #ifdef HANDLE_NEW_OBJ_LIST if (list_old.data == NEW_OBJ_INFO_MAGIC) @@ -695,11 +701,11 @@ xfer_link_map_member (so_list_ptr, lm) read_memory (lladdr, (char *) &list_32, sizeof (Elf32_Obj_Info)); if (list_32.oi_size != sizeof (Elf32_Obj_Info)) return; - new_lm -> l_variant = OBJ_LIST_32; - new_lm -> l_next = (CORE_ADDR) list_32.oi_next; + new_lm->l_variant = OBJ_LIST_32; + new_lm->l_next = (CORE_ADDR) list_32.oi_next; target_read_string ((CORE_ADDR) list_32.oi_pathname, - &so_list_ptr -> so_name, + &so_list_ptr->so_name, list_32.oi_pathname_len + 1, &errcode); if (errcode != 0) memory_error (errcode, (CORE_ADDR) list_32.oi_pathname); @@ -713,16 +719,16 @@ xfer_link_map_member (so_list_ptr, lm) { #if defined (_MIPS_SIM_NABI32) && _MIPS_SIM == _MIPS_SIM_NABI32 /* If we are compiling GDB under N32 ABI, the alignments in - the obj struct are different from the O32 ABI and we will get - wrong values when accessing the struct. - As a workaround we use fixed values which are good for - Irix 6.2. */ + the obj struct are different from the O32 ABI and we will get + wrong values when accessing the struct. + As a workaround we use fixed values which are good for + Irix 6.2. */ char buf[432]; read_memory ((CORE_ADDR) list_old.data, buf, sizeof (buf)); target_read_string (extract_address (&buf[236], 4), - &so_list_ptr -> so_name, + &so_list_ptr->so_name, INT_MAX, &errcode); if (errcode != 0) memory_error (errcode, extract_address (&buf[236], 4)); @@ -737,7 +743,7 @@ xfer_link_map_member (so_list_ptr, lm) sizeof (struct obj)); target_read_string ((CORE_ADDR) obj_old.o_path, - &so_list_ptr -> so_name, + &so_list_ptr->so_name, INT_MAX, &errcode); if (errcode != 0) memory_error (errcode, (CORE_ADDR) obj_old.o_path); @@ -756,22 +762,22 @@ xfer_link_map_member (so_list_ptr, lm) /* -LOCAL FUNCTION + LOCAL FUNCTION - find_solib -- step through list of shared objects + find_solib -- step through list of shared objects -SYNOPSIS + SYNOPSIS - struct so_list *find_solib (struct so_list *so_list_ptr) + struct so_list *find_solib (struct so_list *so_list_ptr) -DESCRIPTION + DESCRIPTION - This module contains the routine which finds the names of any - loaded "images" in the current process. The argument in must be - NULL on the first call, and then the returned value must be passed - in on subsequent calls. This provides the capability to "step" down - the list of loaded objects. On the last object, a NULL value is - returned. + This module contains the routine which finds the names of any + loaded "images" in the current process. The argument in must be + NULL on the first call, and then the returned value must be passed + in on subsequent calls. This provides the capability to "step" down + the list of loaded objects. On the last object, a NULL value is + returned. */ static struct so_list * @@ -781,7 +787,7 @@ find_solib (so_list_ptr) struct so_list *so_list_next = NULL; struct link_map *lm = NULL; struct so_list *new; - + if (so_list_ptr == NULL) { /* We are setting up for a new scan through the loaded images. */ @@ -794,24 +800,24 @@ find_solib (so_list_ptr) else { /* We have been called before, and are in the process of walking - the shared library list. Advance to the next shared object. */ + the shared library list. Advance to the next shared object. */ lm = next_link_map_member (so_list_ptr); - so_list_next = so_list_ptr -> next; + so_list_next = so_list_ptr->next; } if ((so_list_next == NULL) && (lm != NULL)) { new = (struct so_list *) xmalloc (sizeof (struct so_list)); memset ((char *) new, 0, sizeof (struct so_list)); /* Add the new node as the next node in the list, or as the root - node if this is the first one. */ + node if this is the first one. */ if (so_list_ptr != NULL) { - so_list_ptr -> next = new; + so_list_ptr->next = new; } else { so_list_head = new; - } + } so_list_next = new; xfer_link_map_member (new, lm); } @@ -824,54 +830,56 @@ static int symbol_add_stub (arg) char *arg; { - register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */ + register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */ CORE_ADDR text_addr = 0; + struct section_addr_info section_addrs; - if (so -> textsection) - text_addr = so -> textsection -> addr; - else if (so -> abfd != NULL) + memset (§ion_addrs, 0, sizeof (section_addrs)); + if (so->textsection) + text_addr = so->textsection->addr; + else if (so->abfd != NULL) { asection *lowest_sect; /* If we didn't find a mapped non zero sized .text section, set up - text_addr so that the relocation in symbol_file_add does no harm. */ + text_addr so that the relocation in symbol_file_add does no harm. */ - lowest_sect = bfd_get_section_by_name (so -> abfd, ".text"); + lowest_sect = bfd_get_section_by_name (so->abfd, ".text"); if (lowest_sect == NULL) - bfd_map_over_sections (so -> abfd, find_lowest_section, + bfd_map_over_sections (so->abfd, find_lowest_section, (PTR) &lowest_sect); if (lowest_sect) - text_addr = bfd_section_vma (so -> abfd, lowest_sect) + LM_OFFSET (so); + text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so); } - - so -> objfile = symbol_file_add (so -> so_name, so -> from_tty, - text_addr, - 0, 0, 0, 0, 0); + + section_addrs.text_addr = text_addr; + so->objfile = symbol_file_add (so->so_name, so->from_tty, + §ion_addrs, 0, 0); return (1); } /* -GLOBAL FUNCTION + GLOBAL FUNCTION - solib_add -- add a shared library file to the symtab and section list + solib_add -- add a shared library file to the symtab and section list -SYNOPSIS + SYNOPSIS - void solib_add (char *arg_string, int from_tty, - struct target_ops *target) + void solib_add (char *arg_string, int from_tty, + struct target_ops *target) -DESCRIPTION + DESCRIPTION -*/ + */ void solib_add (arg_string, from_tty, target) char *arg_string; int from_tty; struct target_ops *target; -{ - register struct so_list *so = NULL; /* link map state variable */ +{ + register struct so_list *so = NULL; /* link map state variable */ /* Last shared library that we read. */ struct so_list *so_last = NULL; @@ -879,12 +887,12 @@ solib_add (arg_string, from_tty, target) char *re_err; int count; int old; - + if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL) { error ("Invalid regexp: %s", re_err); } - + /* Add the shared library sections to the section table of the specified target, if any. */ if (target) @@ -894,71 +902,42 @@ solib_add (arg_string, from_tty, target) count = 0; while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0]) + if (so->so_name[0]) { - count += so -> sections_end - so -> sections; + count += so->sections_end - so->sections; } } - + if (count) { - int update_coreops; - - /* We must update the to_sections field in the core_ops structure - here, otherwise we dereference a potential dangling pointer - for each call to target_read/write_memory within this routine. */ - update_coreops = core_ops.to_sections == target->to_sections; - - /* Reallocate the target's section table including the new size. */ - if (target -> to_sections) - { - old = target -> to_sections_end - target -> to_sections; - target -> to_sections = (struct section_table *) - xrealloc ((char *)target -> to_sections, - (sizeof (struct section_table)) * (count + old)); - } - else - { - old = 0; - target -> to_sections = (struct section_table *) - xmalloc ((sizeof (struct section_table)) * count); - } - target -> to_sections_end = target -> to_sections + (count + old); + old = target_resize_to_sections (target, count); - /* Update the to_sections field in the core_ops structure - if needed. */ - if (update_coreops) - { - core_ops.to_sections = target->to_sections; - core_ops.to_sections_end = target->to_sections_end; - } - /* Add these section table entries to the target's table. */ while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0]) + if (so->so_name[0]) { - count = so -> sections_end - so -> sections; - memcpy ((char *) (target -> to_sections + old), - so -> sections, + count = so->sections_end - so->sections; + memcpy ((char *) (target->to_sections + old), + so->sections, (sizeof (struct section_table)) * count); old += count; } } } } - + /* Now add the symbol files. */ while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0] && re_exec (so -> so_name)) + if (so->so_name[0] && re_exec (so->so_name)) { - so -> from_tty = from_tty; - if (so -> symbols_loaded) + so->from_tty = from_tty; + if (so->symbols_loaded) { if (from_tty) { - printf_unfiltered ("Symbols already loaded for %s\n", so -> so_name); + printf_unfiltered ("Symbols already loaded for %s\n", so->so_name); } } else if (catch_errors @@ -967,7 +946,7 @@ solib_add (arg_string, from_tty, target) RETURN_MASK_ALL)) { so_last = so; - so -> symbols_loaded = 1; + so->symbols_loaded = 1; } } } @@ -980,95 +959,95 @@ solib_add (arg_string, from_tty, target) /* -LOCAL FUNCTION + LOCAL FUNCTION - info_sharedlibrary_command -- code for "info sharedlibrary" + info_sharedlibrary_command -- code for "info sharedlibrary" -SYNOPSIS + SYNOPSIS - static void info_sharedlibrary_command () + static void info_sharedlibrary_command () -DESCRIPTION + DESCRIPTION - Walk through the shared library list and print information - about each attached library. -*/ + Walk through the shared library list and print information + about each attached library. + */ static void info_sharedlibrary_command (ignore, from_tty) char *ignore; int from_tty; { - register struct so_list *so = NULL; /* link map state variable */ + register struct so_list *so = NULL; /* link map state variable */ int header_done = 0; - + if (exec_bfd == NULL) { - printf_unfiltered ("No exec file.\n"); + printf_unfiltered ("No executable file.\n"); return; } while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0]) + if (so->so_name[0]) { if (!header_done) { - printf_unfiltered("%-12s%-12s%-12s%s\n", "From", "To", "Syms Read", - "Shared Object Library"); + printf_unfiltered ("%-12s%-12s%-12s%s\n", "From", "To", "Syms Read", + "Shared Object Library"); header_done++; } printf_unfiltered ("%-12s", - local_hex_string_custom ((unsigned long) LM_ADDR (so), - "08l")); + local_hex_string_custom ((unsigned long) LM_ADDR (so), + "08l")); printf_unfiltered ("%-12s", - local_hex_string_custom ((unsigned long) so -> lmend, - "08l")); - printf_unfiltered ("%-12s", so -> symbols_loaded ? "Yes" : "No"); - printf_unfiltered ("%s\n", so -> so_name); + local_hex_string_custom ((unsigned long) so->lmend, + "08l")); + printf_unfiltered ("%-12s", so->symbols_loaded ? "Yes" : "No"); + printf_unfiltered ("%s\n", so->so_name); } } if (so_list_head == NULL) { - printf_unfiltered ("No shared libraries loaded at this time.\n"); + printf_unfiltered ("No shared libraries loaded at this time.\n"); } } /* -GLOBAL FUNCTION + GLOBAL FUNCTION - solib_address -- check to see if an address is in a shared lib + solib_address -- check to see if an address is in a shared lib -SYNOPSIS + SYNOPSIS - char *solib_address (CORE_ADDR address) + char *solib_address (CORE_ADDR address) -DESCRIPTION + DESCRIPTION - Provides a hook for other gdb routines to discover whether or - not a particular address is within the mapped address space of - a shared library. Any address between the base mapping address - and the first address beyond the end of the last mapping, is - considered to be within the shared library address space, for - our purposes. + Provides a hook for other gdb routines to discover whether or + not a particular address is within the mapped address space of + a shared library. Any address between the base mapping address + and the first address beyond the end of the last mapping, is + considered to be within the shared library address space, for + our purposes. - For example, this routine is called at one point to disable - breakpoints which are in shared libraries that are not currently - mapped in. + For example, this routine is called at one point to disable + breakpoints which are in shared libraries that are not currently + mapped in. */ char * solib_address (address) CORE_ADDR address; { - register struct so_list *so = 0; /* link map state variable */ - + register struct so_list *so = 0; /* link map state variable */ + while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0]) + if (so->so_name[0]) { if ((address >= (CORE_ADDR) LM_ADDR (so)) && - (address < (CORE_ADDR) so -> lmend)) + (address < (CORE_ADDR) so->lmend)) return (so->so_name); } } @@ -1077,24 +1056,24 @@ solib_address (address) /* Called by free_all_symtabs */ -void -clear_solib() +void +clear_solib () { struct so_list *next; char *bfd_filename; - + disable_breakpoints_in_shlibs (1); while (so_list_head) { - if (so_list_head -> sections) + if (so_list_head->sections) { - free ((PTR)so_list_head -> sections); + free ((PTR) so_list_head->sections); } - if (so_list_head -> abfd) + if (so_list_head->abfd) { - bfd_filename = bfd_get_filename (so_list_head -> abfd); - if (!bfd_close (so_list_head -> abfd)) + bfd_filename = bfd_get_filename (so_list_head->abfd); + if (!bfd_close (so_list_head->abfd)) warning ("cannot close \"%s\": %s", bfd_filename, bfd_errmsg (bfd_get_error ())); } @@ -1102,11 +1081,11 @@ clear_solib() /* This happens for the executable on SVR4. */ bfd_filename = NULL; - next = so_list_head -> next; + next = so_list_head->next; if (bfd_filename) - free ((PTR)bfd_filename); + free ((PTR) bfd_filename); free (so_list_head->so_name); - free ((PTR)so_list_head); + free ((PTR) so_list_head); so_list_head = next; } debug_base = 0; @@ -1114,20 +1093,20 @@ clear_solib() /* -LOCAL FUNCTION + LOCAL FUNCTION - disable_break -- remove the "mapping changed" breakpoint + disable_break -- remove the "mapping changed" breakpoint -SYNOPSIS + SYNOPSIS - static int disable_break () + static int disable_break () -DESCRIPTION + DESCRIPTION - Removes the breakpoint that gets hit when the dynamic linker - completes a mapping change. + Removes the breakpoint that gets hit when the dynamic linker + completes a mapping change. -*/ + */ static int disable_break () @@ -1157,19 +1136,19 @@ disable_break () /* -LOCAL FUNCTION + LOCAL FUNCTION - enable_break -- arrange for dynamic linker to hit breakpoint + enable_break -- arrange for dynamic linker to hit breakpoint -SYNOPSIS + SYNOPSIS - int enable_break (void) + int enable_break (void) -DESCRIPTION + DESCRIPTION - This functions inserts a breakpoint at the entry point of the - main executable, where all shared libraries are mapped in. -*/ + This functions inserts a breakpoint at the entry point of the + main executable, where all shared libraries are mapped in. + */ static int enable_break () @@ -1184,61 +1163,61 @@ enable_break () return 0; } - + /* - -GLOBAL FUNCTION - - solib_create_inferior_hook -- shared library startup support - -SYNOPSIS - - void solib_create_inferior_hook() - -DESCRIPTION - - When gdb starts up the inferior, it nurses it along (through the - shell) until it is ready to execute it's first instruction. At this - point, this function gets called via expansion of the macro - SOLIB_CREATE_INFERIOR_HOOK. - - For SunOS executables, this first instruction is typically the - one at "_start", or a similar text label, regardless of whether - the executable is statically or dynamically linked. The runtime - startup code takes care of dynamically linking in any shared - libraries, once gdb allows the inferior to continue. - - For SVR4 executables, this first instruction is either the first - instruction in the dynamic linker (for dynamically linked - executables) or the instruction at "start" for statically linked - executables. For dynamically linked executables, the system - first exec's /lib/libc.so.N, which contains the dynamic linker, - and starts it running. The dynamic linker maps in any needed - shared libraries, maps in the actual user executable, and then - jumps to "start" in the user executable. - - For both SunOS shared libraries, and SVR4 shared libraries, we - can arrange to cooperate with the dynamic linker to discover the - names of shared libraries that are dynamically linked, and the - base addresses to which they are linked. - - This function is responsible for discovering those names and - addresses, and saving sufficient information about them to allow - their symbols to be read at a later time. - -FIXME - - Between enable_break() and disable_break(), this code does not - properly handle hitting breakpoints which the user might have - set in the startup code or in the dynamic linker itself. Proper - handling will probably have to wait until the implementation is - changed to use the "breakpoint handler function" method. - - Also, what if child has exit()ed? Must exit loop somehow. - */ - -void -solib_create_inferior_hook() + + GLOBAL FUNCTION + + solib_create_inferior_hook -- shared library startup support + + SYNOPSIS + + void solib_create_inferior_hook() + + DESCRIPTION + + When gdb starts up the inferior, it nurses it along (through the + shell) until it is ready to execute it's first instruction. At this + point, this function gets called via expansion of the macro + SOLIB_CREATE_INFERIOR_HOOK. + + For SunOS executables, this first instruction is typically the + one at "_start", or a similar text label, regardless of whether + the executable is statically or dynamically linked. The runtime + startup code takes care of dynamically linking in any shared + libraries, once gdb allows the inferior to continue. + + For SVR4 executables, this first instruction is either the first + instruction in the dynamic linker (for dynamically linked + executables) or the instruction at "start" for statically linked + executables. For dynamically linked executables, the system + first exec's /lib/libc.so.N, which contains the dynamic linker, + and starts it running. The dynamic linker maps in any needed + shared libraries, maps in the actual user executable, and then + jumps to "start" in the user executable. + + For both SunOS shared libraries, and SVR4 shared libraries, we + can arrange to cooperate with the dynamic linker to discover the + names of shared libraries that are dynamically linked, and the + base addresses to which they are linked. + + This function is responsible for discovering those names and + addresses, and saving sufficient information about them to allow + their symbols to be read at a later time. + + FIXME + + Between enable_break() and disable_break(), this code does not + properly handle hitting breakpoints which the user might have + set in the startup code or in the dynamic linker itself. Proper + handling will probably have to wait until the implementation is + changed to use the "breakpoint handler function" method. + + Also, what if child has exit()ed? Must exit loop somehow. + */ + +void +solib_create_inferior_hook () { if (!enable_break ()) { @@ -1260,7 +1239,7 @@ solib_create_inferior_hook() wait_for_inferior (); } while (stop_signal != TARGET_SIGNAL_TRAP); - + /* We are now either at the "mapping complete" breakpoint (or somewhere else, a condition we aren't prepared to deal with anyway), so adjust the PC as necessary after a breakpoint, disable the breakpoint, and @@ -1278,11 +1257,11 @@ solib_create_inferior_hook() } /* solib_add will call reinit_frame_cache. - But we are stopped in the startup code and we might not have symbols - for the startup code, so heuristic_proc_start could be called - and will put out an annoying warning. - Delaying the resetting of stop_soon_quietly until after symbol loading - suppresses the warning. */ + But we are stopped in the startup code and we might not have symbols + for the startup code, so heuristic_proc_start could be called + and will put out an annoying warning. + Delaying the resetting of stop_soon_quietly until after symbol loading + suppresses the warning. */ if (auto_solib_add) solib_add ((char *) 0, 0, (struct target_ops *) 0); stop_soon_quietly = 0; @@ -1290,33 +1269,33 @@ solib_create_inferior_hook() /* -LOCAL FUNCTION + LOCAL FUNCTION - sharedlibrary_command -- handle command to explicitly add library + sharedlibrary_command -- handle command to explicitly add library -SYNOPSIS + SYNOPSIS - static void sharedlibrary_command (char *args, int from_tty) + static void sharedlibrary_command (char *args, int from_tty) -DESCRIPTION + DESCRIPTION -*/ + */ static void sharedlibrary_command (args, from_tty) -char *args; -int from_tty; + char *args; + int from_tty; { dont_repeat (); solib_add (args, from_tty, (struct target_ops *) 0); } void -_initialize_solib() +_initialize_solib () { add_com ("sharedlibrary", class_files, sharedlibrary_command, "Load shared object library symbols for files matching REGEXP."); - add_info ("sharedlibrary", info_sharedlibrary_command, + add_info ("sharedlibrary", info_sharedlibrary_command, "Status of loaded shared object libraries."); add_show_from_set @@ -1330,16 +1309,18 @@ must be loaded manually, using `sharedlibrary'.", &setlist), &showlist); } - + /* Register that we are able to handle irix5 core file formats. This really is bfd_target_unknown_flavour */ static struct core_fns irix5_core_fns = { - bfd_target_unknown_flavour, - fetch_core_registers, - NULL + bfd_target_unknown_flavour, /* core_flavour */ + default_check_format, /* check_format */ + default_core_sniffer, /* core_sniffer */ + fetch_core_registers, /* core_read_registers */ + NULL /* next */ }; void diff --git a/gdb/monitor.c b/gdb/monitor.c index caf6150846..b857bbce00 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -50,7 +50,7 @@ #include "monitor.h" #include "gdbcmd.h" #include "inferior.h" -#include "gnu-regex.h" +#include "gdb_regex.h" #include "dcache.h" #include "srec.h" diff --git a/gdb/osfsolib.c b/gdb/osfsolib.c index 31c9bf9989..3ea550ace3 100644 --- a/gdb/osfsolib.c +++ b/gdb/osfsolib.c @@ -1,21 +1,22 @@ /* Handle OSF/1 shared libraries for GDB, the GNU Debugger. Copyright 1993, 94, 95, 96, 98, 1999 Free Software Foundation, Inc. - -This file is part of GDB. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This file is part of GDB. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* FIXME: Most of this code could be merged with solib.c by using next_link_map_member and xfer_link_map_member in solib.c. */ @@ -35,12 +36,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "command.h" #include "target.h" #include "frame.h" -#include "gnu-regex.h" +#include "gdb_regex.h" #include "inferior.h" #include "language.h" #include "gdbcmd.h" -#define MAX_PATH_SIZE 1024 /* FIXME: Should be dynamic */ +#define MAX_PATH_SIZE 1024 /* FIXME: Should be dynamic */ /* When handling shared libraries, GDB has to find out the pathnames of all shared libraries that are currently loaded (to read in their @@ -50,16 +51,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Under OSF/1 there are two possibilities to get at this information: 1) Peek around in the runtime loader structures. - These are not documented, and they are not defined in the system - header files. The definitions below were obtained by experimentation, - but they seem stable enough. + These are not documented, and they are not defined in the system + header files. The definitions below were obtained by experimentation, + but they seem stable enough. 2) Use the undocumented libxproc.a library, which contains the - equivalent ldr_* routines. - This approach is somewhat cleaner, but it requires that the GDB - executable is dynamically linked. In addition it requires a - NAT_CLIBS= -lxproc -Wl,-expect_unresolved,ldr_process_context - linker specification for GDB and all applications that are using - libgdb. + equivalent ldr_* routines. + This approach is somewhat cleaner, but it requires that the GDB + executable is dynamically linked. In addition it requires a + NAT_CLIBS= -lxproc -Wl,-expect_unresolved,ldr_process_context + linker specification for GDB and all applications that are using + libgdb. We will use the peeking approach until it becomes unwieldy. */ #ifndef USE_LDR_ROUTINES @@ -68,37 +69,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define RLD_CONTEXT_ADDRESS 0x3ffc0000000 typedef struct -{ - CORE_ADDR next; - CORE_ADDR previous; - CORE_ADDR unknown1; - char *module_name; - CORE_ADDR modinfo_addr; - long module_id; - CORE_ADDR unknown2; - CORE_ADDR unknown3; - long region_count; - CORE_ADDR regioninfo_addr; -} ldr_module_info_t; + { + CORE_ADDR next; + CORE_ADDR previous; + CORE_ADDR unknown1; + char *module_name; + CORE_ADDR modinfo_addr; + long module_id; + CORE_ADDR unknown2; + CORE_ADDR unknown3; + long region_count; + CORE_ADDR regioninfo_addr; + } +ldr_module_info_t; typedef struct -{ - long unknown1; - CORE_ADDR regionname_addr; - long protection; - CORE_ADDR vaddr; - CORE_ADDR mapaddr; - long size; - long unknown2[5]; -} ldr_region_info_t; + { + long unknown1; + CORE_ADDR regionname_addr; + long protection; + CORE_ADDR vaddr; + CORE_ADDR mapaddr; + long size; + long unknown2[5]; + } +ldr_region_info_t; typedef struct -{ - CORE_ADDR unknown1; - CORE_ADDR unknown2; - CORE_ADDR head; - CORE_ADDR tail; -} ldr_context_t; + { + CORE_ADDR unknown1; + CORE_ADDR unknown2; + CORE_ADDR head; + CORE_ADDR tail; + } +ldr_context_t; static ldr_context_t ldr_context; @@ -125,7 +129,7 @@ ldr_read_memory (memaddr, myaddr, len, readstring) { target_read_string (memaddr, &buffer, len, &result); if (result == 0) - strcpy (myaddr, buffer); + strcpy (myaddr, buffer); free (buffer); } else @@ -141,34 +145,36 @@ ldr_read_memory (memaddr, myaddr, len, readstring) /* Define our own link_map structure. This will help to share code with solib.c. */ -struct link_map { - CORE_ADDR l_offset; /* prelink to load address offset */ - char *l_name; /* full name of loaded object */ +struct link_map +{ + CORE_ADDR l_offset; /* prelink to load address offset */ + char *l_name; /* full name of loaded object */ ldr_module_info_t module_info; /* corresponding module info */ }; #define LM_OFFSET(so) ((so) -> lm.l_offset) #define LM_NAME(so) ((so) -> lm.l_name) -struct so_list { - struct so_list *next; /* next structure in linked list */ - struct link_map lm; /* copy of link map from inferior */ - struct link_map *lmaddr; /* addr in inferior lm was read from */ - CORE_ADDR lmend; /* upper addr bound of mapped object */ - char so_name[MAX_PATH_SIZE]; /* shared object lib name (FIXME) */ - char symbols_loaded; /* flag: symbols read in yet? */ - char from_tty; /* flag: print msgs? */ - struct objfile *objfile; /* objfile for loaded lib */ - struct section_table *sections; - struct section_table *sections_end; - struct section_table *textsection; - bfd *abfd; -}; +struct so_list + { + struct so_list *next; /* next structure in linked list */ + struct link_map lm; /* copy of link map from inferior */ + struct link_map *lmaddr; /* addr in inferior lm was read from */ + CORE_ADDR lmend; /* upper addr bound of mapped object */ + char so_name[MAX_PATH_SIZE]; /* shared object lib name (FIXME) */ + char symbols_loaded; /* flag: symbols read in yet? */ + char from_tty; /* flag: print msgs? */ + struct objfile *objfile; /* objfile for loaded lib */ + struct section_table *sections; + struct section_table *sections_end; + struct section_table *textsection; + bfd *abfd; + }; static struct so_list *so_list_head; /* List of known shared objects */ extern int -fdmatch PARAMS ((int, int)); /* In libiberty */ +fdmatch PARAMS ((int, int)); /* In libiberty */ /* Local function prototypes */ @@ -182,13 +188,13 @@ static int symbol_add_stub PARAMS ((char *)); static struct so_list * -find_solib PARAMS ((struct so_list *)); + find_solib PARAMS ((struct so_list *)); static struct link_map * -first_link_map_member PARAMS ((void)); + first_link_map_member PARAMS ((void)); static struct link_map * -next_link_map_member PARAMS ((struct so_list *)); + next_link_map_member PARAMS ((struct so_list *)); static void xfer_link_map_member PARAMS ((struct so_list *, struct link_map *)); @@ -198,29 +204,29 @@ solib_map_sections PARAMS ((char *)); /* -LOCAL FUNCTION + LOCAL FUNCTION - solib_map_sections -- open bfd and build sections for shared lib + solib_map_sections -- open bfd and build sections for shared lib -SYNOPSIS + SYNOPSIS - static int solib_map_sections (struct so_list *so) + static int solib_map_sections (struct so_list *so) -DESCRIPTION + DESCRIPTION - Given a pointer to one of the shared objects in our list - of mapped objects, use the recorded name to open a bfd - descriptor for the object, build a section table, and then - relocate all the section addresses by the base address at - which the shared object was mapped. + Given a pointer to one of the shared objects in our list + of mapped objects, use the recorded name to open a bfd + descriptor for the object, build a section table, and then + relocate all the section addresses by the base address at + which the shared object was mapped. -FIXMES + FIXMES - In most (all?) cases the shared object file name recorded in the - dynamic linkage tables will be a fully qualified pathname. For - cases where it isn't, do we really mimic the systems search - mechanism correctly in the below code (particularly the tilde - expansion stuff?). + In most (all?) cases the shared object file name recorded in the + dynamic linkage tables will be a fully qualified pathname. For + cases where it isn't, do we really mimic the systems search + mechanism correctly in the below code (particularly the tilde + expansion stuff?). */ static int @@ -234,10 +240,10 @@ solib_map_sections (arg) struct section_table *p; struct cleanup *old_chain; bfd *abfd; - - filename = tilde_expand (so -> so_name); + + filename = tilde_expand (so->so_name); old_chain = make_cleanup (free, filename); - + scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, &scratch_pathname); if (scratch_chan < 0) @@ -259,31 +265,31 @@ solib_map_sections (arg) scratch_pathname, bfd_errmsg (bfd_get_error ())); } /* Leave bfd open, core_xfer_memory and "info files" need it. */ - so -> abfd = abfd; - abfd -> cacheable = true; + so->abfd = abfd; + abfd->cacheable = true; if (!bfd_check_format (abfd, bfd_object)) { error ("\"%s\": not in executable format: %s.", scratch_pathname, bfd_errmsg (bfd_get_error ())); } - if (build_section_table (abfd, &so -> sections, &so -> sections_end)) + if (build_section_table (abfd, &so->sections, &so->sections_end)) { - error ("Can't find the file sections in `%s': %s", + error ("Can't find the file sections in `%s': %s", bfd_get_filename (exec_bfd), bfd_errmsg (bfd_get_error ())); } - for (p = so -> sections; p < so -> sections_end; p++) + for (p = so->sections; p < so->sections_end; p++) { /* Relocate the section binding addresses as recorded in the shared - object's file by the offset to get the address to which the - object was actually mapped. */ - p -> addr += LM_OFFSET (so); - p -> endaddr += LM_OFFSET (so); - so -> lmend = (CORE_ADDR) max (p -> endaddr, so -> lmend); - if (STREQ (p -> the_bfd_section -> name, ".text")) + object's file by the offset to get the address to which the + object was actually mapped. */ + p->addr += LM_OFFSET (so); + p->endaddr += LM_OFFSET (so); + so->lmend = (CORE_ADDR) max (p->endaddr, so->lmend); + if (STREQ (p->the_bfd_section->name, ".text")) { - so -> textsection = p; + so->textsection = p; } } @@ -295,20 +301,20 @@ solib_map_sections (arg) /* -LOCAL FUNCTION + LOCAL FUNCTION - first_link_map_member -- locate first member in dynamic linker's map + first_link_map_member -- locate first member in dynamic linker's map -SYNOPSIS + SYNOPSIS - static struct link_map *first_link_map_member (void) + static struct link_map *first_link_map_member (void) -DESCRIPTION + DESCRIPTION - Read in a copy of the first member in the inferior's dynamic - link map from the inferior's dynamic linker structures, and return - a pointer to the copy in our address space. -*/ + Read in a copy of the first member in the inferior's dynamic + link map from the inferior's dynamic linker structures, and return + a pointer to the copy in our address space. + */ static struct link_map * first_link_map_member () @@ -324,11 +330,11 @@ first_link_map_member () ldr_set_core_reader (ldr_read_memory); ldr_xdetach (fake_ldr_process); if (ldr_xattach (fake_ldr_process) != 0 - || ldr_next_module(fake_ldr_process, &mod_id) != 0 + || ldr_next_module (fake_ldr_process, &mod_id) != 0 || mod_id == LDR_NULL_MODULE - || ldr_inq_module(fake_ldr_process, mod_id, - &first_lm.module_info, sizeof(ldr_module_info_t), - &retsize) != 0) + || ldr_inq_module (fake_ldr_process, mod_id, + &first_lm.module_info, sizeof (ldr_module_info_t), + &retsize) != 0) return lm; #else CORE_ADDR ldr_context_addr; @@ -363,11 +369,11 @@ next_link_map_member (so_list_ptr) ldr_module_t mod_id = so_list_ptr->lm.module_info.lmi_modid; size_t retsize; - if (ldr_next_module(fake_ldr_process, &mod_id) != 0 + if (ldr_next_module (fake_ldr_process, &mod_id) != 0 || mod_id == LDR_NULL_MODULE - || ldr_inq_module(fake_ldr_process, mod_id, - &next_lm.module_info, sizeof(ldr_module_info_t), - &retsize) != 0) + || ldr_inq_module (fake_ldr_process, mod_id, + &next_lm.module_info, sizeof (ldr_module_info_t), + &retsize) != 0) return lm; lm = &next_lm; @@ -440,7 +446,7 @@ xfer_link_map_member (so_list_ptr, lm) &retsize) != 0) break; region_offset = (CORE_ADDR) region_info.lri_mapaddr - - (CORE_ADDR) region_info.lri_vaddr; + - (CORE_ADDR) region_info.lri_vaddr; if (i == 0) LM_OFFSET (so_list_ptr) = region_offset; else if (LM_OFFSET (so_list_ptr) != region_offset) @@ -465,7 +471,7 @@ xfer_link_map_member (so_list_ptr, lm) CORE_ADDR region_offset; if (target_read_memory (lm->module_info.regioninfo_addr - + i * sizeof (region_info), + + i * sizeof (region_info), (char *) ®ion_info, sizeof (region_info)) != 0) break; @@ -482,7 +488,7 @@ xfer_link_map_member (so_list_ptr, lm) else region_name = "??"; warning ("cannot handle shared library relocation for %s (%s)", - so_list_ptr->so_name, region_name); + so_list_ptr->so_name, region_name); free (buffer); } } @@ -496,25 +502,25 @@ xfer_link_map_member (so_list_ptr, lm) /* -LOCAL FUNCTION + LOCAL FUNCTION - find_solib -- step through list of shared objects + find_solib -- step through list of shared objects -SYNOPSIS + SYNOPSIS - struct so_list *find_solib (struct so_list *so_list_ptr) + struct so_list *find_solib (struct so_list *so_list_ptr) -DESCRIPTION + DESCRIPTION - This module contains the routine which finds the names of any - loaded "images" in the current process. The argument in must be - NULL on the first call, and then the returned value must be passed - in on subsequent calls. This provides the capability to "step" down - the list of loaded objects. On the last object, a NULL value is - returned. + This module contains the routine which finds the names of any + loaded "images" in the current process. The argument in must be + NULL on the first call, and then the returned value must be passed + in on subsequent calls. This provides the capability to "step" down + the list of loaded objects. On the last object, a NULL value is + returned. - The arg and return value are "struct link_map" pointers, as defined - in . + The arg and return value are "struct link_map" pointers, as defined + in . */ static struct so_list * @@ -524,7 +530,7 @@ find_solib (so_list_ptr) struct so_list *so_list_next = NULL; struct link_map *lm = NULL; struct so_list *new; - + if (so_list_ptr == NULL) { /* We are setting up for a new scan through the loaded images. */ @@ -537,27 +543,27 @@ find_solib (so_list_ptr) else { /* We have been called before, and are in the process of walking - the shared library list. Advance to the next shared object. */ + the shared library list. Advance to the next shared object. */ lm = next_link_map_member (so_list_ptr); - so_list_next = so_list_ptr -> next; + so_list_next = so_list_ptr->next; } if ((so_list_next == NULL) && (lm != NULL)) { /* Get next link map structure from inferior image and build a local - abbreviated load_map structure */ + abbreviated load_map structure */ new = (struct so_list *) xmalloc (sizeof (struct so_list)); memset ((char *) new, 0, sizeof (struct so_list)); - new -> lmaddr = lm; + new->lmaddr = lm; /* Add the new node as the next node in the list, or as the root - node if this is the first one. */ + node if this is the first one. */ if (so_list_ptr != NULL) { - so_list_ptr -> next = new; + so_list_ptr->next = new; } else { so_list_head = new; - } + } so_list_next = new; xfer_link_map_member (new, lm); } @@ -570,54 +576,56 @@ static int symbol_add_stub (arg) char *arg; { - register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */ + register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */ CORE_ADDR text_addr = 0; + struct section_addr_info section_addrs; - if (so -> textsection) - text_addr = so -> textsection -> addr; - else if (so -> abfd != NULL) + memset (§ion_addrs, 0, sizeof (section_addrs)); + if (so->textsection) + text_addr = so->textsection->addr; + else if (so->abfd != NULL) { asection *lowest_sect; /* If we didn't find a mapped non zero sized .text section, set up - text_addr so that the relocation in symbol_file_add does no harm. */ + text_addr so that the relocation in symbol_file_add does no harm. */ - lowest_sect = bfd_get_section_by_name (so -> abfd, ".text"); + lowest_sect = bfd_get_section_by_name (so->abfd, ".text"); if (lowest_sect == NULL) - bfd_map_over_sections (so -> abfd, find_lowest_section, + bfd_map_over_sections (so->abfd, find_lowest_section, (PTR) &lowest_sect); if (lowest_sect) - text_addr = bfd_section_vma (so -> abfd, lowest_sect) + LM_OFFSET (so); + text_addr = bfd_section_vma (so->abfd, lowest_sect) + LM_OFFSET (so); } - - so -> objfile = symbol_file_add (so -> so_name, so -> from_tty, - text_addr, - 0, 0, 0, 0, 1); + + section_addrs.text_addr = text_addr; + so->objfile = symbol_file_add (so->so_name, so->from_tty, + §ion_addrs, 0, OBJF_SHARED); return (1); } /* -GLOBAL FUNCTION + GLOBAL FUNCTION - solib_add -- add a shared library file to the symtab and section list + solib_add -- add a shared library file to the symtab and section list -SYNOPSIS + SYNOPSIS - void solib_add (char *arg_string, int from_tty, - struct target_ops *target) + void solib_add (char *arg_string, int from_tty, + struct target_ops *target) -DESCRIPTION + DESCRIPTION -*/ + */ void solib_add (arg_string, from_tty, target) char *arg_string; int from_tty; struct target_ops *target; -{ - register struct so_list *so = NULL; /* link map state variable */ +{ + register struct so_list *so = NULL; /* link map state variable */ /* Last shared library that we read. */ struct so_list *so_last = NULL; @@ -625,13 +633,13 @@ solib_add (arg_string, from_tty, target) char *re_err; int count; int old; - + if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL) { error ("Invalid regexp: %s", re_err); } - - + + /* Add the shared library sections to the section table of the specified target, if any. */ if (target) @@ -641,72 +649,44 @@ solib_add (arg_string, from_tty, target) count = 0; while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0]) + if (so->so_name[0]) { - count += so -> sections_end - so -> sections; + count += so->sections_end - so->sections; } } - + if (count) { - int update_coreops; - - /* We must update the to_sections field in the core_ops structure - here, otherwise we dereference a potential dangling pointer - for each call to target_read/write_memory within this routine. */ - update_coreops = core_ops.to_sections == target->to_sections; - - /* Reallocate the target's section table including the new size. */ - if (target -> to_sections) - { - old = target -> to_sections_end - target -> to_sections; - target -> to_sections = (struct section_table *) - xrealloc ((char *)target -> to_sections, - (sizeof (struct section_table)) * (count + old)); - } - else - { - old = 0; - target -> to_sections = (struct section_table *) - xmalloc ((sizeof (struct section_table)) * count); - } - target -> to_sections_end = target -> to_sections + (count + old); - - /* Update the to_sections field in the core_ops structure - if needed. */ - if (update_coreops) - { - core_ops.to_sections = target->to_sections; - core_ops.to_sections_end = target->to_sections_end; - } - /* Add these section table entries to the target's table. */ + + old = target_resize_to_sections (target, count); + while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0]) + if (so->so_name[0]) { - count = so -> sections_end - so -> sections; - memcpy ((char *) (target -> to_sections + old), - so -> sections, + count = so->sections_end - so->sections; + memcpy ((char *) (target->to_sections + old), + so->sections, (sizeof (struct section_table)) * count); old += count; } } } } - + /* Now add the symbol files. */ so = NULL; while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0] && re_exec (so -> so_name)) + if (so->so_name[0] && re_exec (so->so_name)) { - so -> from_tty = from_tty; - if (so -> symbols_loaded) + so->from_tty = from_tty; + if (so->symbols_loaded) { if (from_tty) { - printf_unfiltered ("Symbols already loaded for %s\n", so -> so_name); + printf_unfiltered ("Symbols already loaded for %s\n", so->so_name); } } else if (catch_errors @@ -715,7 +695,7 @@ solib_add (arg_string, from_tty, target) RETURN_MASK_ALL)) { so_last = so; - so -> symbols_loaded = 1; + so->symbols_loaded = 1; } } } @@ -728,99 +708,99 @@ solib_add (arg_string, from_tty, target) /* -LOCAL FUNCTION + LOCAL FUNCTION - info_sharedlibrary_command -- code for "info sharedlibrary" + info_sharedlibrary_command -- code for "info sharedlibrary" -SYNOPSIS + SYNOPSIS - static void info_sharedlibrary_command () + static void info_sharedlibrary_command () -DESCRIPTION + DESCRIPTION - Walk through the shared library list and print information - about each attached library. -*/ + Walk through the shared library list and print information + about each attached library. + */ static void info_sharedlibrary_command (ignore, from_tty) char *ignore; int from_tty; { - register struct so_list *so = NULL; /* link map state variable */ + register struct so_list *so = NULL; /* link map state variable */ int header_done = 0; - + if (exec_bfd == NULL) { - printf_unfiltered ("No exec file.\n"); + printf_unfiltered ("No executable file.\n"); return; } while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0]) + if (so->so_name[0]) { unsigned long txt_start = 0; unsigned long txt_end = 0; if (!header_done) { - printf_unfiltered("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read", - "Shared Object Library"); + printf_unfiltered ("%-20s%-20s%-12s%s\n", "From", "To", "Syms Read", + "Shared Object Library"); header_done++; } - if (so -> textsection) + if (so->textsection) { - txt_start = (unsigned long) so -> textsection -> addr; - txt_end = (unsigned long) so -> textsection -> endaddr; + txt_start = (unsigned long) so->textsection->addr; + txt_end = (unsigned long) so->textsection->endaddr; } printf_unfiltered ("%-20s", local_hex_string_custom (txt_start, "08l")); printf_unfiltered ("%-20s", local_hex_string_custom (txt_end, "08l")); - printf_unfiltered ("%-12s", so -> symbols_loaded ? "Yes" : "No"); - printf_unfiltered ("%s\n", so -> so_name); + printf_unfiltered ("%-12s", so->symbols_loaded ? "Yes" : "No"); + printf_unfiltered ("%s\n", so->so_name); } } if (so_list_head == NULL) { - printf_unfiltered ("No shared libraries loaded at this time.\n"); + printf_unfiltered ("No shared libraries loaded at this time.\n"); } } /* -GLOBAL FUNCTION + GLOBAL FUNCTION - solib_address -- check to see if an address is in a shared lib + solib_address -- check to see if an address is in a shared lib -SYNOPSIS + SYNOPSIS - char *solib_address (CORE_ADDR address) + char *solib_address (CORE_ADDR address) -DESCRIPTION + DESCRIPTION - Provides a hook for other gdb routines to discover whether or - not a particular address is within the mapped address space of - a shared library. Any address between the base mapping address - and the first address beyond the end of the last mapping, is - considered to be within the shared library address space, for - our purposes. + Provides a hook for other gdb routines to discover whether or + not a particular address is within the mapped address space of + a shared library. Any address between the base mapping address + and the first address beyond the end of the last mapping, is + considered to be within the shared library address space, for + our purposes. - For example, this routine is called at one point to disable - breakpoints which are in shared libraries that are not currently - mapped in. + For example, this routine is called at one point to disable + breakpoints which are in shared libraries that are not currently + mapped in. */ char * solib_address (address) CORE_ADDR address; { - register struct so_list *so = 0; /* link map state variable */ - + register struct so_list *so = 0; /* link map state variable */ + while ((so = find_solib (so)) != NULL) { - if (so -> so_name[0] && so -> textsection) + if (so->so_name[0] && so->textsection) { - if ((address >= (CORE_ADDR) so -> textsection -> addr) && - (address < (CORE_ADDR) so -> textsection -> endaddr)) + if ((address >= (CORE_ADDR) so->textsection->addr) && + (address < (CORE_ADDR) so->textsection->endaddr)) return (so->so_name); } } @@ -829,24 +809,24 @@ solib_address (address) /* Called by free_all_symtabs */ -void -clear_solib() +void +clear_solib () { struct so_list *next; char *bfd_filename; - + disable_breakpoints_in_shlibs (1); while (so_list_head) { - if (so_list_head -> sections) + if (so_list_head->sections) { - free ((PTR)so_list_head -> sections); + free ((PTR) so_list_head->sections); } - if (so_list_head -> abfd) + if (so_list_head->abfd) { - bfd_filename = bfd_get_filename (so_list_head -> abfd); - if (!bfd_close (so_list_head -> abfd)) + bfd_filename = bfd_get_filename (so_list_head->abfd); + if (!bfd_close (so_list_head->abfd)) warning ("cannot close \"%s\": %s", bfd_filename, bfd_errmsg (bfd_get_error ())); } @@ -854,52 +834,52 @@ clear_solib() /* This happens for the executable on SVR4. */ bfd_filename = NULL; - next = so_list_head -> next; + next = so_list_head->next; if (bfd_filename) - free ((PTR)bfd_filename); - free ((PTR)so_list_head); + free ((PTR) bfd_filename); + free ((PTR) so_list_head); so_list_head = next; } } - + /* - -GLOBAL FUNCTION - - solib_create_inferior_hook -- shared library startup support - -SYNOPSIS - - void solib_create_inferior_hook() - -DESCRIPTION - - When gdb starts up the inferior, it nurses it along (through the - shell) until it is ready to execute it's first instruction. At this - point, this function gets called via expansion of the macro - SOLIB_CREATE_INFERIOR_HOOK. - For a statically bound executable, this first instruction is the - one at "_start", or a similar text label. No further processing is - needed in that case. - For a dynamically bound executable, this first instruction is somewhere - in the rld, and the actual user executable is not yet mapped in. - We continue the inferior again, rld then maps in the actual user - executable and any needed shared libraries and then sends - itself a SIGTRAP. - At that point we discover the names of all shared libraries and - read their symbols in. - -FIXME - - This code does not properly handle hitting breakpoints which the - user might have set in the rld itself. Proper handling would have - to check if the SIGTRAP happened due to a kill call. - - Also, what if child has exit()ed? Must exit loop somehow. - */ + + GLOBAL FUNCTION + + solib_create_inferior_hook -- shared library startup support + + SYNOPSIS + + void solib_create_inferior_hook() + + DESCRIPTION + + When gdb starts up the inferior, it nurses it along (through the + shell) until it is ready to execute it's first instruction. At this + point, this function gets called via expansion of the macro + SOLIB_CREATE_INFERIOR_HOOK. + For a statically bound executable, this first instruction is the + one at "_start", or a similar text label. No further processing is + needed in that case. + For a dynamically bound executable, this first instruction is somewhere + in the rld, and the actual user executable is not yet mapped in. + We continue the inferior again, rld then maps in the actual user + executable and any needed shared libraries and then sends + itself a SIGTRAP. + At that point we discover the names of all shared libraries and + read their symbols in. + + FIXME + + This code does not properly handle hitting breakpoints which the + user might have set in the rld itself. Proper handling would have + to check if the SIGTRAP happened due to a kill call. + + Also, what if child has exit()ed? Must exit loop somehow. + */ void -solib_create_inferior_hook() +solib_create_inferior_hook () { /* Nothing to do for statically bound executables. */ @@ -913,7 +893,7 @@ solib_create_inferior_hook() which point all of the libraries will have been mapped in and we can go groveling around in the rld structures to find out what we need to know about them. */ - + clear_proceed_status (); stop_soon_quietly = 1; stop_signal = TARGET_SIGNAL_0; @@ -925,11 +905,11 @@ solib_create_inferior_hook() while (stop_signal != TARGET_SIGNAL_TRAP); /* solib_add will call reinit_frame_cache. - But we are stopped in the runtime loader and we do not have symbols - for the runtime loader. So heuristic_proc_start will be called - and will put out an annoying warning. - Delaying the resetting of stop_soon_quietly until after symbol loading - suppresses the warning. */ + But we are stopped in the runtime loader and we do not have symbols + for the runtime loader. So heuristic_proc_start will be called + and will put out an annoying warning. + Delaying the resetting of stop_soon_quietly until after symbol loading + suppresses the warning. */ if (auto_solib_add) solib_add ((char *) 0, 0, (struct target_ops *) 0); stop_soon_quietly = 0; @@ -938,33 +918,33 @@ solib_create_inferior_hook() /* -LOCAL FUNCTION + LOCAL FUNCTION - sharedlibrary_command -- handle command to explicitly add library + sharedlibrary_command -- handle command to explicitly add library -SYNOPSIS + SYNOPSIS - static void sharedlibrary_command (char *args, int from_tty) + static void sharedlibrary_command (char *args, int from_tty) -DESCRIPTION + DESCRIPTION -*/ + */ static void sharedlibrary_command (args, from_tty) -char *args; -int from_tty; + char *args; + int from_tty; { dont_repeat (); solib_add (args, from_tty, (struct target_ops *) 0); } void -_initialize_solib() +_initialize_solib () { add_com ("sharedlibrary", class_files, sharedlibrary_command, "Load shared object library symbols for files matching REGEXP."); - add_info ("sharedlibrary", info_sharedlibrary_command, + add_info ("sharedlibrary", info_sharedlibrary_command, "Status of loaded shared object libraries."); add_show_from_set diff --git a/gdb/solib.c b/gdb/solib.c index c44a65d95f..1f2df646a8 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -49,7 +49,7 @@ #include "command.h" #include "target.h" #include "frame.h" -#include "gnu-regex.h" +#include "gdb_regex.h" #include "inferior.h" #include "environ.h" #include "language.h" diff --git a/gdb/source.c b/gdb/source.c index 9fe97425aa..9569aa0b1f 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1,28 +1,29 @@ /* List lines of source files for GDB, the GNU debugger. - Copyright 1986, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 1998 - Free Software Foundation, Inc. + Copyright 1986-1989, 1991-1999 Free Software Foundation, Inc. -This file is part of GDB. + This file is part of GDB. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include "defs.h" #include "symtab.h" #include "expression.h" #include "language.h" #include "command.h" +#include "source.h" #include "gdbcmd.h" #include "frame.h" #include "value.h" @@ -31,15 +32,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "gdb_string.h" #include "gdb_stat.h" #include -#ifdef HAVE_UNISTD_H -#include -#endif #include "gdbcore.h" -#include "gnu-regex.h" +#include "gdb_regex.h" #include "symfile.h" #include "objfiles.h" #include "annotate.h" #include "gdbtypes.h" +#ifdef UI_OUT +#include "ui-out.h" +#endif #ifdef CRLF_SOURCE_FILES @@ -61,12 +62,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif /* ! defined (CRLF_SOURCE_FILES) */ -/* Forward declarations */ - -int open_source_file PARAMS ((struct symtab *)); - -void find_source_lines PARAMS ((struct symtab *, int)); - /* Prototypes for exported functions. */ void _initialize_source PARAMS ((void)); @@ -124,8 +119,8 @@ static int first_line_listed; static struct symtab *last_source_visited = NULL; static int last_source_error = 0; - + /* Set the source file default for the "list" command to be S. If S is NULL, and we don't have a default, find one. This @@ -143,7 +138,7 @@ select_source_symtab (s) struct partial_symtab *ps; struct partial_symtab *cs_pst = 0; struct objfile *ofp; - + if (s) { current_source_symtab = s; @@ -164,20 +159,20 @@ select_source_symtab (s) current_source_symtab = sal.symtab; current_source_line = max (sal.line - (lines_to_list - 1), 1); if (current_source_symtab) - return; + return; } - + /* All right; find the last file in the symtab list (ignoring .h's). */ current_source_line = 1; - for (ofp = object_files; ofp != NULL; ofp = ofp -> next) + for (ofp = object_files; ofp != NULL; ofp = ofp->next) { - for (s = ofp -> symtabs; s; s = s->next) + for (s = ofp->symtabs; s; s = s->next) { - char *name = s -> filename; + char *name = s->filename; int len = strlen (name); - if (! (len > 2 && (STREQ (&name[len - 2], ".h")))) + if (!(len > 2 && (STREQ (&name[len - 2], ".h")))) { current_source_symtab = s; } @@ -188,13 +183,13 @@ select_source_symtab (s) /* Howabout the partial symbol tables? */ - for (ofp = object_files; ofp != NULL; ofp = ofp -> next) + for (ofp = object_files; ofp != NULL; ofp = ofp->next) { - for (ps = ofp -> psymtabs; ps != NULL; ps = ps -> next) + for (ps = ofp->psymtabs; ps != NULL; ps = ps->next) { - char *name = ps -> filename; + char *name = ps->filename; int len = strlen (name); - if (! (len > 2 && (STREQ (&name[len - 2], ".h")))) + if (!(len > 2 && (STREQ (&name[len - 2], ".h")))) { cs_pst = ps; } @@ -202,9 +197,9 @@ select_source_symtab (s) } if (cs_pst) { - if (cs_pst -> readin) + if (cs_pst->readin) { - fatal ("Internal: select_source_symtab: readin pst found and no symtabs."); + internal_error ("select_source_symtab: readin pst found and no symtabs."); } else { @@ -237,19 +232,19 @@ forget_cached_source_info () register struct symtab *s; register struct objfile *objfile; - for (objfile = object_files; objfile != NULL; objfile = objfile -> next) + for (objfile = object_files; objfile != NULL; objfile = objfile->next) { - for (s = objfile -> symtabs; s != NULL; s = s -> next) + for (s = objfile->symtabs; s != NULL; s = s->next) { - if (s -> line_charpos != NULL) + if (s->line_charpos != NULL) { - mfree (objfile -> md, s -> line_charpos); - s -> line_charpos = NULL; + mfree (objfile->md, s->line_charpos); + s->line_charpos = NULL; } - if (s -> fullname != NULL) + if (s->fullname != NULL) { - mfree (objfile -> md, s -> fullname); - s -> fullname = NULL; + mfree (objfile->md, s->fullname); + s->fullname = NULL; } } } @@ -266,7 +261,7 @@ init_source_path () } /* Add zero or more directories to the front of the source path. */ - + void directory_command (dirname, from_tty) char *dirname; @@ -276,7 +271,7 @@ directory_command (dirname, from_tty) /* FIXME, this goes to "delete dir"... */ if (dirname == 0) { - if (query ("Reinitialize source path to empty? ")) + if (from_tty && query ("Reinitialize source path to empty? ")) { free (source_path); init_source_path (); @@ -288,7 +283,7 @@ directory_command (dirname, from_tty) last_source_visited = NULL; } if (from_tty) - show_directories ((char *)0, from_tty); + show_directories ((char *) 0, from_tty); forget_cached_source_info (); } @@ -319,7 +314,7 @@ mod_path (dirname, which_path) char *space = strchr (name, ' '); char *tab = strchr (name, '\t'); - if (separator == 0 && space == 0 && tab == 0) + if (separator == 0 && space == 0 && tab == 0) p = dirname = name + strlen (name); else { @@ -338,15 +333,17 @@ mod_path (dirname, which_path) } } -#ifndef _WIN32 - /* On win32 h:\ is different to h: */ - if (SLASH_P (p[-1])) + if (!(SLASH_P (*name) && p <= name + 1) /* "/" */ +#if defined(_WIN32) || defined(__MSDOS__) + /* On MS-DOS and MS-Windows, h:\ is different from h: */ + && !(!SLASH_P (*name) && ROOTED_P (name) && p <= name + 3) /* d:/ */ +#endif + && SLASH_P (p[-1])) /* Sigh. "foo/" => "foo" */ --p; -#endif *p = '\0'; - while (p[-1] == '.') + while (p > name && p[-1] == '.') { if (p - name == 1) { @@ -354,7 +351,7 @@ mod_path (dirname, which_path) name = current_directory; goto append; } - else if (SLASH_P (p[-2])) + else if (p > name + 1 && SLASH_P (p[-2])) { if (p - name == 2) { @@ -376,32 +373,37 @@ mod_path (dirname, which_path) if (name[0] == '~') name = tilde_expand (name); - else if (!ROOTED_P (name) && name[0] != '$') - name = concat (current_directory, SLASH_STRING, name, NULL); +#if defined(_WIN32) || defined(__MSDOS__) + else if (ROOTED_P (name) && p == name + 2) /* "d:" => "d:." */ + name = concat (name, ".", NULL); +#endif + else if (!ROOTED_P (name) && name[0] != '$') + name = concat (current_directory, SLASH_STRING, name, NULL); else name = savestring (name, p - name); make_cleanup (free, name); /* Unless it's a variable, check existence. */ - if (name[0] != '$') { - /* These are warnings, not errors, since we don't want a - non-existent directory in a .gdbinit file to stop processing - of the .gdbinit file. - - Whether they get added to the path is more debatable. Current - answer is yes, in case the user wants to go make the directory - or whatever. If the directory continues to not exist/not be - a directory/etc, then having them in the path should be - harmless. */ - if (stat (name, &st) < 0) - { - int save_errno = errno; - fprintf_unfiltered (gdb_stderr, "Warning: "); - print_sys_errmsg (name, save_errno); - } - else if ((st.st_mode & S_IFMT) != S_IFDIR) - warning ("%s is not a directory.", name); - } + if (name[0] != '$') + { + /* These are warnings, not errors, since we don't want a + non-existent directory in a .gdbinit file to stop processing + of the .gdbinit file. + + Whether they get added to the path is more debatable. Current + answer is yes, in case the user wants to go make the directory + or whatever. If the directory continues to not exist/not be + a directory/etc, then having them in the path should be + harmless. */ + if (stat (name, &st) < 0) + { + int save_errno = errno; + fprintf_unfiltered (gdb_stderr, "Warning: "); + print_sys_errmsg (name, save_errno); + } + else if ((st.st_mode & S_IFMT) != S_IFDIR) + warning ("%s is not a directory.", name); + } append: { @@ -410,15 +412,23 @@ mod_path (dirname, which_path) p = *which_path; while (1) { + /* FIXME: strncmp loses in interesting ways on MS-DOS and + MS-Windows because of case-insensitivity and two different + but functionally identical slash characters. We need a + special filesystem-dependent file-name comparison function. + + Actually, even on Unix I would use realpath() or its work- + alike before comparing. Then all the code above which + removes excess slashes and dots could simply go away. */ if (!strncmp (p, name, len) && (p[len] == '\0' || p[len] == DIRNAME_SEPARATOR)) { /* Found it in the search path, remove old copy */ if (p > *which_path) - p--; /* Back over leading separator */ + p--; /* Back over leading separator */ if (prefix > p - *which_path) goto skip_dup; /* Same dir twice in one cmd */ - strcpy (p, &p[len+1]); /* Copy from next \0 or : */ + strcpy (p, &p[len + 1]); /* Copy from next \0 or : */ } p = strchr (p, DIRNAME_SEPARATOR); if (p != 0) @@ -433,7 +443,7 @@ mod_path (dirname, which_path) tinybuf[0] = DIRNAME_SEPARATOR; tinybuf[1] = '\0'; - /* If we have already tacked on a name(s) in this command, be sure they stay on the front as we tack on some more. */ + /* If we have already tacked on a name(s) in this command, be sure they stay on the front as we tack on some more. */ if (prefix) { char *temp, c; @@ -455,8 +465,9 @@ mod_path (dirname, which_path) old = *which_path; } } - skip_dup: ; - } while (*dirname != '\0'); + skip_dup:; + } + while (*dirname != '\0'); } @@ -469,7 +480,7 @@ source_info (ignore, from_tty) if (!s) { - printf_filtered("No current source file.\n"); + printf_filtered ("No current source file.\n"); return; } printf_filtered ("Current source file is %s\n", s->filename); @@ -484,9 +495,9 @@ source_info (ignore, from_tty) printf_filtered ("Source language is %s.\n", language_str (s->language)); printf_filtered ("Compiled with %s debugging format.\n", s->debugformat); } + - /* Open a file named STRING, searching path PATH (dir names sep by some char) using mode MODE and protection bits PROT in the calls to open. @@ -506,7 +517,7 @@ source_info (ignore, from_tty) Otherwise, return -1, with errno set for the last name we tried to open. */ /* >>>> This should only allow files of certain types, - >>>> eg executable, non-directory */ + >>>> eg executable, non-directory */ int openp (path, try_cwd_first, string, mode, prot, filename_opened) char *path; @@ -529,7 +540,7 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened) mode |= O_BINARY; #endif - if (try_cwd_first || SLASH_P (string[0])) + if (try_cwd_first || ROOTED_P (string)) { int i; filename = string; @@ -557,36 +568,41 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened) len = strlen (p); if (len == 4 && p[0] == '$' && p[1] == 'c' - && p[2] == 'w' && p[3] == 'd') { - /* Name is $cwd -- insert current directory name instead. */ - int newlen; - - /* First, realloc the filename buffer if too short. */ - len = strlen (current_directory); - newlen = len + strlen (string) + 2; - if (newlen > alloclen) { - alloclen = newlen; - filename = (char *) alloca (alloclen); + && p[2] == 'w' && p[3] == 'd') + { + /* Name is $cwd -- insert current directory name instead. */ + int newlen; + + /* First, realloc the filename buffer if too short. */ + len = strlen (current_directory); + newlen = len + strlen (string) + 2; + if (newlen > alloclen) + { + alloclen = newlen; + filename = (char *) alloca (alloclen); + } + strcpy (filename, current_directory); + } + else + { + /* Normal file name in path -- just use it. */ + strncpy (filename, p, len); + filename[len] = 0; } - strcpy (filename, current_directory); - } else { - /* Normal file name in path -- just use it. */ - strncpy (filename, p, len); - filename[len] = 0; - } /* Remove trailing slashes */ - while (len > 0 && SLASH_P (filename[len-1])) + while (len > 0 && SLASH_P (filename[len - 1])) filename[--len] = 0; - strcat (filename+len, SLASH_STRING); + strcat (filename + len, SLASH_STRING); strcat (filename, string); fd = open (filename, mode); - if (fd >= 0) break; + if (fd >= 0) + break; } - done: +done: if (filename_opened) { if (fd < 0) @@ -596,13 +612,12 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened) else { /* Beware the // my son, the Emacs barfs, the botch that catch... */ - - *filename_opened = concat (current_directory, - SLASH_CHAR - == current_directory[strlen(current_directory)-1] - ? "": SLASH_STRING, + + *filename_opened = concat (current_directory, + SLASH_P (current_directory[strlen (current_directory) - 1]) + ? "" : SLASH_STRING, filename, NULL); - } + } } #ifdef MPW /* This is a debugging hack that can go away when all combinations @@ -612,11 +627,11 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened) if (debug_openp) { - printf("openp on %s, path %s mode %d prot %d\n returned %d", - string, path, mode, prot, fd); + printf ("openp on %s, path %s mode %d prot %d\n returned %d", + string, path, mode, prot, fd); if (*filename_opened) - printf(" (filename is %s)", *filename_opened); - printf("\n"); + printf (" (filename is %s)", *filename_opened); + printf ("\n"); } } #endif /* MPW */ @@ -624,7 +639,7 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened) return fd; } - + /* This is essentially a convenience, for clients that want the behaviour of openp, using source_path, but that really don't want the file to be opened but want instead just to know what the full pathname is (as @@ -636,13 +651,13 @@ openp (path, try_cwd_first, string, mode, prot, filename_opened) set to the fully-qualified pathname. Else, this functions returns 0, and FULL_PATHNAME is set to NULL. - */ + */ int source_full_path_of (filename, full_pathname) - char * filename; - char ** full_pathname; + char *filename; + char **full_pathname; { - int fd; + int fd; fd = openp (source_path, 1, filename, O_RDONLY, 0, full_pathname); if (fd < 0) @@ -669,11 +684,11 @@ open_source_file (s) char *fullname; /* Quick way out if we already know its full name */ - if (s->fullname) + if (s->fullname) { result = open (s->fullname, OPEN_MODE); if (result >= 0) - return result; + return result; /* Didn't work -- free old one, try again. */ mfree (s->objfile->md, s->fullname); s->fullname = NULL; @@ -684,19 +699,19 @@ open_source_file (s) /* Replace a path entry of $cdir with the compilation directory name */ #define cdir_len 5 /* We cast strstr's result in case an ANSIhole has made it const, - which produces a "required warning" when assigned to a nonconst. */ - p = (char *)strstr (source_path, "$cdir"); + which produces a "required warning" when assigned to a nonconst. */ + p = (char *) strstr (source_path, "$cdir"); if (p && (p == path || p[-1] == DIRNAME_SEPARATOR) - && (p[cdir_len] == DIRNAME_SEPARATOR || p[cdir_len] == '\0')) + && (p[cdir_len] == DIRNAME_SEPARATOR || p[cdir_len] == '\0')) { int len; path = (char *) alloca (strlen (source_path) + 1 + strlen (s->dirname) + 1); len = p - source_path; - strncpy (path, source_path, len); /* Before $cdir */ - strcpy (path + len, s->dirname); /* new stuff */ - strcat (path + len, source_path + len + cdir_len); /* After $cdir */ + strncpy (path, source_path, len); /* Before $cdir */ + strcpy (path + len, s->dirname); /* new stuff */ + strcat (path + len, source_path + len + cdir_len); /* After $cdir */ } } @@ -762,8 +777,8 @@ symtab_to_filename (s) close (fd); return s->fullname; } - + /* Create and initialize the table S->line_charpos that records the positions of the lines in the source file, which is assumed to be open on descriptor DESC. @@ -782,21 +797,21 @@ find_source_lines (s, desc) long mtime = 0; int size; - line_charpos = (int *) xmmalloc (s -> objfile -> md, + line_charpos = (int *) xmmalloc (s->objfile->md, lines_allocated * sizeof (int)); if (fstat (desc, &st) < 0) perror_with_name (s->filename); if (s && s->objfile && s->objfile->obfd) - mtime = bfd_get_mtime(s->objfile->obfd); + mtime = bfd_get_mtime (s->objfile->obfd); else if (exec_bfd) - mtime = bfd_get_mtime(exec_bfd); + mtime = bfd_get_mtime (exec_bfd); if (mtime && mtime < st.st_mtime) { if (tui_version) printf_filtered ("\n"); - warning("Source file is more recent than executable.\n"); + warning ("Source file is more recent than executable.\n"); } #ifdef LSEEK_NOT_LINEAR @@ -807,15 +822,15 @@ find_source_lines (s, desc) line_charpos[0] = lseek (desc, 0, SEEK_CUR); nlines = 1; - while (myread(desc, &c, 1)>0) + while (myread (desc, &c, 1) > 0) { - if (c == '\n') + if (c == '\n') { - if (nlines == lines_allocated) + if (nlines == lines_allocated) { lines_allocated *= 2; line_charpos = - (int *) xmrealloc (s -> objfile -> md, (char *) line_charpos, + (int *) xmrealloc (s->objfile->md, (char *) line_charpos, sizeof (int) * lines_allocated); } line_charpos[nlines++] = lseek (desc, 0, SEEK_CUR); @@ -846,14 +861,14 @@ find_source_lines (s, desc) while (p != end) { if (*p++ == '\n' - /* A newline at the end does not start a new line. */ + /* A newline at the end does not start a new line. */ && p != end) { if (nlines == lines_allocated) { lines_allocated *= 2; line_charpos = - (int *) xmrealloc (s -> objfile -> md, (char *) line_charpos, + (int *) xmrealloc (s->objfile->md, (char *) line_charpos, sizeof (int) * lines_allocated); } line_charpos[nlines++] = p - data; @@ -864,23 +879,25 @@ find_source_lines (s, desc) #endif /* lseek linear. */ s->nlines = nlines; s->line_charpos = - (int *) xmrealloc (s -> objfile -> md, (char *) line_charpos, - nlines * sizeof (int)); + (int *) xmrealloc (s->objfile->md, (char *) line_charpos, + nlines * sizeof (int)); } /* Return the character position of a line LINE in symtab S. Return 0 if anything is invalid. */ -#if 0 /* Currently unused */ +#if 0 /* Currently unused */ int source_line_charpos (s, line) struct symtab *s; int line; { - if (!s) return 0; - if (!s->line_charpos || line <= 0) return 0; + if (!s) + return 0; + if (!s->line_charpos || line <= 0) + return 0; if (line > s->nlines) line = s->nlines; return s->line_charpos[line - 1]; @@ -890,16 +907,17 @@ source_line_charpos (s, line) int source_charpos_line (s, chr) - register struct symtab *s; - register int chr; + register struct symtab *s; + register int chr; { register int line = 0; register int *lnp; - - if (s == 0 || s->line_charpos == 0) return 0; + + if (s == 0 || s->line_charpos == 0) + return 0; lnp = s->line_charpos; /* Files are usually short, so sequential search is Ok */ - while (line < s->nlines && *lnp <= chr) + while (line < s->nlines && *lnp <= chr) { line++; lnp++; @@ -909,9 +927,9 @@ source_charpos_line (s, chr) return line; } -#endif /* 0 */ - +#endif /* 0 */ + /* Get full pathname and line number positions for a symtab. Return nonzero if line numbers may have changed. Set *FULLNAME to actual name of the file as found by `openp', @@ -923,18 +941,20 @@ get_filename_and_charpos (s, fullname) char **fullname; { register int desc, linenums_changed = 0; - + desc = open_source_file (s); if (desc < 0) { if (fullname) *fullname = NULL; return 0; - } + } if (fullname) *fullname = s->fullname; - if (s->line_charpos == 0) linenums_changed = 1; - if (linenums_changed) find_source_lines (s, desc); + if (s->line_charpos == 0) + linenums_changed = 1; + if (linenums_changed) + find_source_lines (s, desc); close (desc); return linenums_changed; } @@ -956,7 +976,7 @@ identify_source_line (s, line, mid_statement, pc) CORE_ADDR pc; { if (s->line_charpos == 0) - get_filename_and_charpos (s, (char **)NULL); + get_filename_and_charpos (s, (char **) NULL); if (s->fullname == 0) return 0; if (line > s->nlines) @@ -971,15 +991,17 @@ identify_source_line (s, line, mid_statement, pc) current_source_symtab = s; return 1; } - + /* Print source lines from the file of symtab S, starting with line number LINE and stopping before line number STOPLINE. */ +static void print_source_lines_base PARAMS ((struct symtab * s, int line, int stopline, int noerror)); static void print_source_lines_base (s, line, stopline, noerror) struct symtab *s; - int line, stopline; + int line; + int stopline; int noerror; { register int c; @@ -992,31 +1014,50 @@ print_source_lines_base (s, line, stopline, noerror) current_source_line = line; first_line_listed = line; - - /* Only prints "No such file or directory" once */ - if ((s != last_source_visited) || (! last_source_error)) +#ifdef UI_OUT + /* If printing of source lines is disabled, just print file and line number */ + if (ui_out_test_flags (uiout, ui_source_list)) { - last_source_visited = s; - desc = open_source_file (s); +#endif + /* Only prints "No such file or directory" once */ + if ((s != last_source_visited) || (!last_source_error)) + { + last_source_visited = s; + desc = open_source_file (s); + } + else + { + desc = last_source_error; + noerror = 1; + } +#ifdef UI_OUT } else { - desc = last_source_error; + desc = -1; noerror = 1; } +#endif if (desc < 0) { last_source_error = desc; - if (! noerror) - { + if (!noerror) + { char *name = alloca (strlen (s->filename) + 100); sprintf (name, "%d\t%s", line, s->filename); print_sys_errmsg (name, errno); } else +#ifdef UI_OUT + ui_out_field_int (uiout, "line", line); + ui_out_text (uiout, "\tin "); + ui_out_field_string (uiout, "file", s->filename); + ui_out_text (uiout, "\n"); +#else printf_filtered ("%d\tin %s\n", line, s->filename); +#endif return; } @@ -1044,8 +1085,47 @@ print_source_lines_base (s, line, stopline, noerror) while (nlines-- > 0) { +#ifdef UI_OUT + char buf[20]; + + c = fgetc (stream); + if (c == EOF) + break; + last_line_listed = current_source_line; + sprintf (buf, "%d\t", current_source_line++); + ui_out_text (uiout, buf); + do + { + if (c < 040 && c != '\t' && c != '\n' && c != '\r') + { + sprintf (buf, "^%c", c + 0100); + ui_out_text (uiout, buf); + } + else if (c == 0177) + ui_out_text (uiout, "^?"); +#ifdef CRLF_SOURCE_FILES + else if (c == '\r') + { + /* Skip a \r character, but only before a \n. */ + int c1 = fgetc (stream); + + if (c1 != '\n') + printf_filtered ("^%c", c + 0100); + if (c1 != EOF) + ungetc (c1, stream); + } +#endif + else + { + sprintf (buf, "%c", c); + ui_out_text (uiout, buf); + } + } + while (c != '\n' && (c = fgetc (stream)) >= 0); +#else c = fgetc (stream); - if (c == EOF) break; + if (c == EOF) + break; last_line_listed = current_source_line; printf_filtered ("%d\t", current_source_line++); do @@ -1062,7 +1142,9 @@ print_source_lines_base (s, line, stopline, noerror) #endif else printf_filtered ("%c", c); - } while (c != '\n' && (c = fgetc (stream)) >= 0); + } + while (c != '\n' && (c = fgetc (stream)) >= 0); +#endif } fclose (stream); @@ -1073,44 +1155,44 @@ print_source_lines_base (s, line, stopline, noerror) not the command line version, then the source is shown in the source window otherwise it is simply printed */ -void +void print_source_lines (s, line, stopline, noerror) - struct symtab *s; - int line, stopline, noerror; + struct symtab *s; + int line, stopline, noerror; { #if defined(TUI) - if (!tui_version || - m_winPtrIsNull(srcWin) || !srcWin->generic.isVisible ) - print_source_lines_base(s, line, stopline, noerror); + if (!tui_version || + m_winPtrIsNull (srcWin) || !srcWin->generic.isVisible) + print_source_lines_base (s, line, stopline, noerror); else { - TuiGenWinInfoPtr locator = locatorWinInfoPtr(); + TuiGenWinInfoPtr locator = locatorWinInfoPtr (); extern void tui_vAddWinToLayout PARAMS ((va_list)); extern void tui_vUpdateSourceWindowsWithLine PARAMS ((va_list)); - /* Regardless of whether we can open the file, - set current_source_symtab. */ - current_source_symtab = s; - current_source_line = line; - first_line_listed = line; + /* Regardless of whether we can open the file, + set current_source_symtab. */ + current_source_symtab = s; + current_source_line = line; + first_line_listed = line; - /* make sure that the source window is displayed */ - tuiDo((TuiOpaqueFuncPtr)tui_vAddWinToLayout, SRC_WIN); + /* make sure that the source window is displayed */ + tuiDo ((TuiOpaqueFuncPtr) tui_vAddWinToLayout, SRC_WIN); - tuiDo((TuiOpaqueFuncPtr)tui_vUpdateSourceWindowsWithLine, s, line); - tuiDo((TuiOpaqueFuncPtr)tui_vUpdateLocatorFilename, s->filename); - } + tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateSourceWindowsWithLine, s, line); + tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateLocatorFilename, s->filename); + } #else - print_source_lines_base(s, line, stopline, noerror); + print_source_lines_base (s, line, stopline, noerror); #endif } /* Print a list of files and line numbers which a user may choose from - in order to list a function which was specified ambiguously (as with - `list classname::overloadedfuncname', for example). The vector in - SALS provides the filenames and line numbers. */ + in order to list a function which was specified ambiguously (as with + `list classname::overloadedfuncname', for example). The vector in + SALS provides the filenames and line numbers. */ static void ambiguous_line_spec (sals) @@ -1119,8 +1201,8 @@ ambiguous_line_spec (sals) int i; for (i = 0; i < sals->nelts; ++i) - printf_filtered("file: \"%s\", line number: %d\n", - sals->sals[i].symtab->filename, sals->sals[i].line); + printf_filtered ("file: \"%s\", line number: %d\n", + sals->sals[i].symtab->filename, sals->sals[i].line); } static void @@ -1138,7 +1220,7 @@ list_command (arg, from_tty) int linenum_beg = 0; char *p; - if (!have_full_symbols () && !have_partial_symbols()) + if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); /* Pull in a current source symtab if necessary */ @@ -1181,7 +1263,8 @@ list_command (arg, from_tty) { sals = decode_line_1 (&arg1, 0, 0, 0, 0); - if (! sals.nelts) return; /* C++ */ + if (!sals.nelts) + return; /* C++ */ if (sals.nelts > 1) { ambiguous_line_spec (&sals); @@ -1214,7 +1297,7 @@ list_command (arg, from_tty) sals_end = decode_line_1 (&arg1, 0, 0, 0, 0); else sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0); - if (sals_end.nelts == 0) + if (sals_end.nelts == 0) return; if (sals_end.nelts > 1) { @@ -1235,7 +1318,7 @@ list_command (arg, from_tty) error ("Specified start and end are in different files."); if (dummy_beg && dummy_end) error ("Two empty args do not say what lines to list."); - + /* if line was specified by address, first print exactly which line, and which file. In this case, sal.symtab == 0 means address is outside @@ -1245,7 +1328,7 @@ list_command (arg, from_tty) if (sal.symtab == 0) /* FIXME-32x64--assumes sal.pc fits in long. */ error ("No source file for address %s.", - local_hex_string((unsigned long) sal.pc)); + local_hex_string ((unsigned long) sal.pc)); sym = find_pc_function (sal.pc); if (sym) { @@ -1266,7 +1349,7 @@ list_command (arg, from_tty) and it does not imply a symtab, it must be an undebuggable symbol which means no source code. */ - if (! linenum_beg && sal.symtab == 0) + if (!linenum_beg && sal.symtab == 0) error ("No line number known for %s.", arg); /* If this command is repeated with RET, @@ -1284,19 +1367,14 @@ list_command (arg, from_tty) else if (sal.symtab == 0) error ("No default source file yet. Do \"help list\"."); else if (no_end) - if (lines_to_list % 2 == 0) - print_source_lines (sal.symtab, - max (sal.line - (lines_to_list / 2), 1), - sal.line + (lines_to_list / 2), 0); - else - /* If lines_to_list is odd, then we round down in - * one of the lines_to_list/2 computations, round up in - * the other, so the total window size around the specified - * line comes out right. - */ - print_source_lines (sal.symtab, - max (sal.line - (lines_to_list / 2), 1), - sal.line + ((1+lines_to_list) / 2), 0); + { + int first_line = sal.line - lines_to_list / 2; + + if (first_line < 1) first_line = 1; + + print_source_lines (sal.symtab, first_line, first_line + lines_to_list, + 0); + } else print_source_lines (sal.symtab, sal.line, (dummy_end @@ -1317,7 +1395,7 @@ line_info (arg, from_tty) CORE_ADDR start_pc, end_pc; int i; - INIT_SAL (&sal); /* initialize to zeroes */ + INIT_SAL (&sal); /* initialize to zeroes */ if (arg == 0) { @@ -1331,7 +1409,7 @@ line_info (arg, from_tty) else { sals = decode_line_spec_1 (arg, 0); - + dont_repeat (); } @@ -1340,15 +1418,15 @@ line_info (arg, from_tty) for (i = 0; i < sals.nelts; i++) { sal = sals.sals[i]; - + if (sal.symtab == 0) { printf_filtered ("No line number information available"); if (sal.pc != 0) { /* This is useful for "info line *0x7f34". If we can't tell the - user about a source line, at least let them have the symbolic - address. */ + user about a source line, at least let them have the symbolic + address. */ printf_filtered (" for address "); wrap_here (" "); print_address (sal.pc, gdb_stdout); @@ -1420,22 +1498,22 @@ forward_search_command (regex, from_tty) #if defined(TUI) /* - ** If this is the TUI, search from the first line displayed in - ** the source window, otherwise, search from last_line_listed+1 - ** in current_source_symtab - */ + ** If this is the TUI, search from the first line displayed in + ** the source window, otherwise, search from last_line_listed+1 + ** in current_source_symtab + */ if (!tui_version) line = last_line_listed; else { if (srcWin->generic.isVisible && srcWin->generic.contentSize > 0) - line = ((TuiWinContent) - srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo; + line = ((TuiWinContent) + srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo; else - { - printf_filtered("No source displayed.\nExpression not found.\n"); - return; - } + { + printf_filtered ("No source displayed.\nExpression not found.\n"); + return; + } } line++; #else @@ -1470,46 +1548,59 @@ forward_search_command (regex, from_tty) stream = fdopen (desc, FDOPEN_MODE); clearerr (stream); - while (1) { - static char *buf = NULL; - register char *p; - int cursize, newsize; - - cursize = 256; - buf = xmalloc (cursize); - p = buf; - - c = getc (stream); - if (c == EOF) - break; - do { - *p++ = c; - if (p - buf == cursize) + while (1) + { + static char *buf = NULL; + register char *p; + int cursize, newsize; + + cursize = 256; + buf = xmalloc (cursize); + p = buf; + + c = getc (stream); + if (c == EOF) + break; + do { - newsize = cursize + cursize / 2; - buf = xrealloc (buf, newsize); - p = buf + cursize; - cursize = newsize; + *p++ = c; + if (p - buf == cursize) + { + newsize = cursize + cursize / 2; + buf = xrealloc (buf, newsize); + p = buf + cursize; + cursize = newsize; + } } - } while (c != '\n' && (c = getc (stream)) >= 0); + while (c != '\n' && (c = getc (stream)) >= 0); - /* we now have a source line in buf, null terminate and match */ - *p = 0; - if (re_exec (buf) > 0) - { - /* Match! */ - fclose (stream); - if (tui_version) - print_source_lines_base (current_source_symtab, line, line+1, 0); - print_source_lines (current_source_symtab, line, line+1, 0); - set_internalvar (lookup_internalvar ("_"), - value_from_longest (builtin_type_int, - (LONGEST) line)); - current_source_line = max (line - lines_to_list / 2, 1); - return; - } - line++; - } +#ifdef CRLF_SOURCE_FILES + /* Remove the \r, if any, at the end of the line, otherwise + regular expressions that end with $ or \n won't work. */ + if (p - buf > 1 && p[-2] == '\r') + { + p--; + p[-1] = '\n'; + } +#endif + + /* we now have a source line in buf, null terminate and match */ + *p = 0; + if (re_exec (buf) > 0) + { + /* Match! */ + fclose (stream); + if (tui_version) + print_source_lines_base (current_source_symtab, line, line + 1, 0); + print_source_lines (current_source_symtab, line, line + 1, 0); + set_internalvar (lookup_internalvar ("_"), + value_from_longest (builtin_type_int, + (LONGEST) line)); + current_source_line = max (line - lines_to_list / 2, 1); + return; + } + line++; + } printf_filtered ("Expression not found\n"); fclose (stream); @@ -1528,22 +1619,22 @@ reverse_search_command (regex, from_tty) char *msg; #if defined(TUI) /* - ** If this is the TUI, search from the first line displayed in - ** the source window, otherwise, search from last_line_listed-1 - ** in current_source_symtab - */ + ** If this is the TUI, search from the first line displayed in + ** the source window, otherwise, search from last_line_listed-1 + ** in current_source_symtab + */ if (!tui_version) line = last_line_listed; else { if (srcWin->generic.isVisible && srcWin->generic.contentSize > 0) - line = ((TuiWinContent) - srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo; + line = ((TuiWinContent) + srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo; else - { - printf_filtered("No source displayed.\nExpression not found.\n"); - return; - } + { + printf_filtered ("No source displayed.\nExpression not found.\n"); + return; + } } line--; #else @@ -1587,9 +1678,21 @@ reverse_search_command (regex, from_tty) c = getc (stream); if (c == EOF) break; - do { - *p++ = c; - } while (c != '\n' && (c = getc (stream)) >= 0); + do + { + *p++ = c; + } + while (c != '\n' && (c = getc (stream)) >= 0); + +#ifdef CRLF_SOURCE_FILES + /* Remove the \r, if any, at the end of the line, otherwise + regular expressions that end with $ or \n won't work. */ + if (p - buf > 1 && p[-2] == '\r') + { + p--; + p[-1] = '\n'; + } +#endif /* We now have a source line in buf; null terminate and match. */ *p = 0; @@ -1597,9 +1700,9 @@ reverse_search_command (regex, from_tty) { /* Match! */ fclose (stream); - if (tui_version) - print_source_lines_base (current_source_symtab, line, line+1, 0); - print_source_lines (current_source_symtab, line, line+1, 0); + if (tui_version) + print_source_lines_base (current_source_symtab, line, line + 1, 0); + print_source_lines (current_source_symtab, line, line + 1, 0); set_internalvar (lookup_internalvar ("_"), value_from_longest (builtin_type_int, (LONGEST) line)); @@ -1633,7 +1736,7 @@ _initialize_source () re_set_syntax (RE_SYNTAX_GREP); c = add_cmd ("directory", class_files, directory_command, - "Add directory DIR to beginning of search path for source files.\n\ + "Add directory DIR to beginning of search path for source files.\n\ Forget cached info on source file locations and line positions.\n\ DIR can also be $cwd for the current working directory, or $cdir for the\n\ directory in which the source file was compiled into object code.\n\ @@ -1641,7 +1744,7 @@ With no argument, reset the search path to $cdir:$cwd, the default.", &cmdlist); if (dbx_commands) - add_com_alias("use", "directory", class_files, 0); + add_com_alias ("use", "directory", class_files, 0); c->completer = filename_completer; @@ -1653,12 +1756,12 @@ $cdir in the path means the compilation directory of the source file.", if (xdb_commands) { - add_com_alias("D", "directory", class_files, 0); + add_com_alias ("D", "directory", class_files, 0); add_cmd ("ld", no_class, show_directories, - "Current search path for finding source files.\n\ + "Current search path for finding source files.\n\ $cwd in the path means the current working directory.\n\ $cdir in the path means the compilation directory of the source file.", - &cmdlist); + &cmdlist); } add_info ("source", source_info, @@ -1688,8 +1791,8 @@ The matching line number is also stored as the value of \"$_\"."); if (xdb_commands) { - add_com_alias("/", "forward-search", class_files, 0); - add_com_alias("?", "reverse-search", class_files, 0); + add_com_alias ("/", "forward-search", class_files, 0); + add_com_alias ("?", "reverse-search", class_files, 0); } add_com ("list", class_files, list_command, @@ -1717,8 +1820,8 @@ With two args if one is empty it stands for ten lines away from the other arg.", add_show_from_set (add_set_cmd ("listsize", class_support, var_uinteger, - (char *)&lines_to_list, - "Set number of source lines gdb will list by default.", + (char *) &lines_to_list, + "Set number of source lines gdb will list by default.", &setlist), &showlist); } diff --git a/gdb/symtab.c b/gdb/symtab.c index 62857b332a..51313525c0 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -30,7 +30,7 @@ #include "objfiles.h" #include "gdbcmd.h" #include "call-cmds.h" -#include "gnu-regex.h" +#include "gdb_regex.h" #include "expression.h" #include "language.h" #include "demangle.h"