From c14cabbac4f755a9a62fd06b1e9974ba90db9593 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 8 May 1997 01:00:39 +0000 Subject: [PATCH] Part II of getting GdbTk's stop button to always work. --- gdb/ChangeLog | 22 +++++++ gdb/config.in | 3 + gdb/configure | 188 ++++++++++++++++++++++++++++++++++--------------------- gdb/configure.in | 2 + gdb/gdbtk.c | 53 ++++++++++------ gdb/remote-sim.c | 55 ++++++++-------- 6 files changed, 204 insertions(+), 119 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fc24056..11561e4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,25 @@ +Thu May 8 08:42:47 1997 Andrew Cagney + + * configure.in (AC_TYPE_SIGNAL): Add + * configure: Re-generate. + * remote-sim.c: Signal returns RETSIGTYPE. + +start-sanitize-gdbtk +Wed May 7 19:10:19 1997 Andrew Cagney + + * gdbtk.c (wrapped_call): New function - make actual call to tk + worker function. + (call_wrapper): Rewrite to use top.c:catch_errors. + + * gdbtk.c (gdb_stop): If No target_stop set quit flag and hope for + best. + +end-sanitize-gdbtk +Wed May 7 20:05:07 1997 Andrew Cagney + + * target.h (target_stop): Drop argument so it can be tested for + NULL. + Sat May 3 20:51:48 1997 Mark Alexander * utils.c (floatformat_from_doublest): Handle infinity properly. diff --git a/gdb/config.in b/gdb/config.in index 9678df4..8a1d0db 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -35,6 +35,9 @@ /* Define if you need to in order for stat and other things to work. */ #undef _POSIX_SOURCE +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + /* Define if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN diff --git a/gdb/configure b/gdb/configure index 8119a55..1fbcd48 100755 --- a/gdb/configure +++ b/gdb/configure @@ -1232,13 +1232,55 @@ test "$program_suffix" != NONE && 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:1237: 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 +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:1259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 -echo "configure:1237: checking for ANSI C header files" >&5 +echo "configure:1279: 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 @@ -1246,7 +1288,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1263,7 +1305,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 @@ -1281,7 +1323,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 @@ -1302,7 +1344,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1313,7 +1355,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -1340,17 +1382,17 @@ for ac_hdr in limits.h memory.h string.h strings.h unistd.h termios.h termio.h s do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1344: checking for $ac_hdr" >&5 +echo "configure:1386: 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:1354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1377,12 +1419,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:1381: checking whether stat file-mode macros are broken" >&5 +echo "configure:1423: 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 @@ -1434,12 +1476,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1438: checking for working const" >&5 +echo "configure:1480: 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:1534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1512,12 +1554,12 @@ fi for ac_func in setpgid sbrk select poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1516: checking for $ac_func" >&5 +echo "configure:1558: 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; then +if { (eval echo configure:1586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1582,19 +1624,19 @@ EOF fi echo $ac_n "checking for gregset_t type""... $ac_c" 1>&6 -echo "configure:1586: checking for gregset_t type" >&5 +echo "configure:1628: checking for gregset_t type" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { gregset_t *gregsetp = 0 ; return 0; } EOF -if { (eval echo configure:1598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* gdb_cv_have_gregset_t=yes else @@ -1615,19 +1657,19 @@ EOF fi echo $ac_n "checking for fpregset_t type""... $ac_c" 1>&6 -echo "configure:1619: checking for fpregset_t type" >&5 +echo "configure:1661: checking for fpregset_t type" >&5 if eval "test \"`echo '$''{'gdb_cv_have_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fpregset_t *fpregsetp = 0 ; return 0; } EOF -if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* gdb_cv_have_fpregset_t=yes else @@ -1648,7 +1690,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:1652: checking for main in -lm" >&5 +echo "configure:1694: 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 @@ -1656,14 +1698,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1693,12 +1735,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:1697: checking for long long support in compiler" >&5 +echo "configure:1739: 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:1754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -1730,7 +1772,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:1734: checking for long long support in printf" >&5 +echo "configure:1776: 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 @@ -1738,7 +1780,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -1772,19 +1814,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:1776: checking for long double support in compiler" >&5 +echo "configure:1818: 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:1830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -1806,7 +1848,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:1810: checking for long double support in printf" >&5 +echo "configure:1852: 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 @@ -1814,7 +1856,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -1850,17 +1892,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:1854: checking for $ac_hdr" >&5 +echo "configure:1896: 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:1864: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1889,12 +1931,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1893: checking for $ac_func" >&5 +echo "configure:1935: 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; then +if { (eval echo configure:1963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1942,7 +1984,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1946: checking for working mmap" >&5 +echo "configure:1988: 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 @@ -1950,7 +1992,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2114,12 +2156,12 @@ fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:2118: checking whether malloc must be declared" >&5 +echo "configure:2160: 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 < @@ -2140,7 +2182,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:2144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -2162,12 +2204,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:2166: checking whether realloc must be declared" >&5 +echo "configure:2208: 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 < @@ -2188,7 +2230,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:2192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -2210,12 +2252,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:2214: checking whether free must be declared" >&5 +echo "configure:2256: 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 < @@ -2236,7 +2278,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:2240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -2264,7 +2306,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:2268: checking for HPUX/OSF thread support" >&5 +echo "configure:2310: 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 @@ -2282,7 +2324,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:2286: checking for Solaris thread debugging library" >&5 +echo "configure:2328: 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 @@ -2291,7 +2333,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2295: checking for dlopen in -ldl" >&5 +echo "configure:2337: 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 @@ -2299,7 +2341,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2447,7 +2489,7 @@ if test "${with_tclconfig+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:2451: checking for Tcl configuration" >&5 +echo "configure:2493: 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 @@ -2555,7 +2597,7 @@ if test "${with_tkconfig+set}" = set; then fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:2559: checking for Tk configuration" >&5 +echo "configure:2601: 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 @@ -2650,7 +2692,7 @@ fi no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:2654: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:2696: 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" @@ -2716,17 +2758,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:2720: checking for tclInt.h" >&5 +echo "configure:2762: 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:2730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2786,7 +2828,7 @@ fi # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:2790: checking for Tk private headers" >&5 +echo "configure:2832: 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" @@ -2852,17 +2894,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:2856: checking for tk.h" >&5 +echo "configure:2898: 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:2866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3067,7 +3109,7 @@ links="${links} nm.h" fi # start-sanitize-gdbtk echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3071: checking whether ln -s works" >&5 +echo "configure:3113: 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 diff --git a/gdb/configure.in b/gdb/configure.in index e831e1a..6a90e31 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -55,6 +55,8 @@ AC_PROG_AWK AC_ARG_PROGRAM +AC_TYPE_SIGNAL + AC_HEADER_STDC AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h stdlib.h sys/procfs.h link.h endian.h objlist.h) AC_HEADER_STAT diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index fc2b0de..2306d09 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -806,6 +806,26 @@ gdb_cmd (clientData, interp, argc, argv) return TCL_OK; } +/* Client of call_wrapper - this routine performs the actual call to + the client function. */ + +struct wrapped_call_args +{ + Tcl_Interp *interp; + Tcl_CmdProc *func; + int argc; + char **argv; + int val; +}; + +static int +wrapped_call (args) + struct wrapped_call_args *args; +{ + args->val = (*args->func) (args->func, args->interp, args->argc, args->argv); + return 1; +} + /* This routine acts as a top-level for all GDB code called by tcl/Tk. It handles cleanups, and calls to return_to_top_level (usually via error). This is necessary in order to prevent a longjmp out of the bowels of Tk, @@ -820,26 +840,22 @@ call_wrapper (clientData, interp, argc, argv) int argc; char *argv[]; { - int val; - struct cleanup *saved_cleanup_chain; - Tcl_CmdProc *func; - jmp_buf saved_error_return; + struct wrapped_call_args wrapped_args; Tcl_DString result, *old_result_ptr; Tcl_DStringInit (&result); old_result_ptr = result_ptr; result_ptr = &result; - func = (Tcl_CmdProc *)clientData; - memcpy (saved_error_return, error_return, sizeof (jmp_buf)); - - saved_cleanup_chain = save_cleanups (); + wrapped_args.func = (Tcl_CmdProc *)clientData; + wrapped_args.interp = interp; + wrapped_args.argc = argc; + wrapped_args.argv = argv; + wrapped_args.val = 0; - if (!setjmp (error_return)) - val = func (clientData, interp, argc, argv); - else + if (!catch_errors (wrapped_call, &wrapped_args, "", RETURN_MASK_ALL)) { - val = TCL_ERROR; /* Flag an error for TCL */ + wrapped_args.val = TCL_ERROR; /* Flag an error for TCL */ gdb_flush (gdb_stderr); /* Flush error output */ @@ -853,16 +869,10 @@ call_wrapper (clientData, interp, argc, argv) Tcl_Eval (interp, "gdbtk_tcl_idle"); } - do_cleanups (ALL_CLEANUPS); - - restore_cleanups (saved_cleanup_chain); - - memcpy (error_return, saved_error_return, sizeof (jmp_buf)); - Tcl_DStringResult (interp, &result); result_ptr = old_result_ptr; - return val; + return wrapped_args.val; } static int @@ -892,7 +902,10 @@ gdb_stop (clientData, interp, argc, argv) int argc; char *argv[]; { - target_stop (); + if (target_stop) + target_stop (); + else + quit_flag = 1; /* hope something sees this */ return TCL_OK; } diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index a4af8e3..8a7d1df 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -243,26 +243,6 @@ gdb_os_flush_stderr (p) gdb_flush (gdb_stderr); } -/* GDB version of os_poll_quit callback. - Taken from gdb/util.c - should be in a library */ - -static int -gdb_os_poll_quit (p) - host_callback *p; -{ - notice_quit (); - if (quit_flag) - { - quit_flag = 0; /* we've stolen it */ - return 1; - } - else if (immediate_quit) - { - return 1; - } - return 0; -} - /* GDB version of printf_filtered callback. */ /* VARARGS */ @@ -615,25 +595,47 @@ gdbsim_resume (pid, step, siggnal) } /* Notify the simulator of an asynchronous request to stop. - Since some simulators can not stop, help them out. - When stepping, need to also notify the client that it - too should quit */ + + The simulator shall ensure that the stop request is eventually + delivered to the simulator. If the call is made while the + simulator is not running then the stop request is processed when + the simulator is next resumed. + + For simulators that do not support this operation, just abort */ static void gdbsim_stop () { if (! sim_stop (gdbsim_desc)) { - error ("gdbsim_stop: simulator failed to stop!\n"); + quit (); } } +/* GDB version of os_poll_quit callback. + Taken from gdb/util.c - should be in a library */ + +static int +gdb_os_poll_quit (p) + host_callback *p; +{ + notice_quit (); + if (quit_flag) /* gdb's idea of quit */ + { + quit_flag = 0; /* we've stolen it */ + return 1; + } + else if (immediate_quit) + { + return 1; + } + return 0; +} + /* Wait for inferior process to do something. Return pid of child, or -1 in case of error; store status through argument pointer STATUS, just as `wait' would. */ -static void (*prev_sigint) (); - static void gdbsim_cntrl_c (int signo) { @@ -645,6 +647,7 @@ gdbsim_wait (pid, status) int pid; struct target_waitstatus *status; { + static RETSIGTYPE (*prev_sigint) (); int sigrc = 0; enum sim_stop reason = sim_running; -- 2.7.4