From 281c4447738409888d9659924937da182a65b4e1 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Tue, 26 Sep 2017 15:19:10 +0200 Subject: [PATCH] Remove support for Solaris < 10 (PR gdb/22185) Given that GCC has obsoleted/removed support for Solaris 9 in GCC 4.9/5 in 2013: https://gcc.gnu.org/gcc-4.9/changes.html https://gcc.gnu.org/ml/gcc-patches/2013-05/msg00728.html and the last gdb version that can be compiled with gcc 4.9 is 7.12.1 only when configured with --disable-build-with-cxx, it's time to obsolete/remove support for Solaris < 10. This patch does this, simplifying configure.nat along the way (only a single sol2 configuration with variants for i386 and sparc). Some configure checks for older Solaris versions can go, too, and the check for libthread_db.so.1 removed: * Since Solaris 10, dlopen has moved to libc and libdl.so is just a filter on ld.so.1, so no need to check. * $RDYNAMIC is already handled above (and is a no-op with Solaris ld anyway). Both proc-service.c and sol-thread.c lose support for (Solaris-only) PROC_SERVICE_IS_OLD. The attached revised patch has been tested on sparcv9-sun-solaris2.10, sparcv9-sun-solaris2.11.4, amd64-pc-solaris2.10, amd64-pc-solaris2.11.4, and x86_64-pc-linux-gnu. I've also started an i386-pc-solaris2.9 build to check that it really stops as expected. PR gdb/22185 * configure.host <*-*-solaris2.[01], *-*-solaris2.[2-9]*>: Mark as obsolete. Use gdb_host sol2 for i[34567]86-*-solaris2*, x86_64-*-solaris2*. Remove i386sol2 support. * configure.nat : Remove. : Fold into ... : ... this. Move common settings to default section. Add sol-thread.o. * configure.tgt : Rename to ... : ... this. : Remove. : Remove. * configure.ac: Remove wctype in libw check. (_MSE_INT_H): Don't define on Solaris 7-9. : Remove libthread_db.so.1 check. * configure: Regenerate. * config.in: Regenerate. * proc-service.c: Remove PROC_SERVICE_IS_OLD handling. (gdb_ps_prochandle_t, gdb_ps_read_buf_t, gdb_ps_write_buf_t) (gdb_ps_size_t): Remove. Use base types in users. * sol-thread.c: Likewise, also for gdb_ps_addr_t. * NEWS (Changes since GDB 8.0): Document Solaris 2.0-9 removal. --- gdb/ChangeLog | 32 ++++++++++ gdb/NEWS | 4 ++ gdb/config.in | 17 ------ gdb/configure | 172 ----------------------------------------------------- gdb/configure.ac | 53 ----------------- gdb/configure.host | 6 +- gdb/configure.nat | 38 ++++-------- gdb/configure.tgt | 13 +--- gdb/proc-service.c | 38 +++--------- gdb/sol-thread.c | 74 +++++++---------------- 10 files changed, 83 insertions(+), 364 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 89c960a..2c825ef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,37 @@ 2017-09-26 Rainer Orth + PR gdb/22185 + * configure.host <*-*-solaris2.[01], *-*-solaris2.[2-9]*>: Mark as + obsolete. + Use gdb_host sol2 for i[34567]86-*-solaris2*, x86_64-*-solaris2*. + Remove i386sol2 support. + * configure.nat : Remove. + : Fold into ... + : ... this. + Move common settings to default section. + Add sol-thread.o. + * configure.tgt : Rename to ... + : ... this. + : Remove. + : Remove. + + * configure.ac: Remove wctype in libw check. + (_MSE_INT_H): Don't define on Solaris 7-9. + : Remove libthread_db.so.1 check. + * configure: Regenerate. + * config.in: Regenerate. + + * proc-service.c: Remove PROC_SERVICE_IS_OLD handling. + (gdb_ps_prochandle_t, gdb_ps_read_buf_t, gdb_ps_write_buf_t) + (gdb_ps_size_t): Remove. + Use base types in users. + * sol-thread.c: Likewise, also for gdb_ps_addr_t. + + * NEWS (Changes since GDB 8.0): Document Solaris 2.0-9 removal. + +2017-09-26 Rainer Orth + PR build/22206 * sparc64-tdep.c (adi_tag_fd): Print pid as long. (adi_is_addr_mapped): Likewise. diff --git a/gdb/NEWS b/gdb/NEWS index 9246659..81c21b8 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -118,6 +118,10 @@ FreeBSD/aarch64 aarch64*-*-freebsd* FreeBSD/aarch64 aarch64*-*-freebsd* +* Removed targets and native configurations + +Solaris 2.0-9 i?86-*-solaris2.[0-9], sparc*-*-solaris2.[0-9] + *** Changes in GDB 8.0 * GDB now supports access to the PKU register on GNU/Linux. The register is diff --git a/gdb/config.in b/gdb/config.in index 4a40956..9fa90af 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -231,9 +231,6 @@ /* Define if you have the babeltrace library. */ #undef HAVE_LIBBABELTRACE -/* Define to 1 if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - /* Define if you have the expat library. */ #undef HAVE_LIBEXPAT @@ -267,9 +264,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -/* Define to 1 if you have the `w' library (-lw). */ -#undef HAVE_LIBW - /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_PERF_EVENT_H @@ -567,9 +561,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_THREAD_DB_H -/* Define if using Solaris thread debugging. */ -#undef HAVE_THREAD_DB_LIB - /* Define to 1 if you have the `ttrace' function. */ #undef HAVE_TTRACE @@ -667,10 +658,6 @@ /* Define to 1 if the "%ll" format works to print long longs. */ #undef PRINTF_HAS_LONG_LONG -/* Define if on solaris uses int instead of size_t, and - assorted other type changes. */ -#undef PROC_SERVICE_IS_OLD - /* Define to the type of arg 1 for ptrace. */ #undef PTRACE_TYPE_ARG1 @@ -810,10 +797,6 @@ /* Define to 1 if on MINIX. */ #undef _MINIX -/* Define to 1 to avoid a clash between and on Solaris - 2.[789] when using GCC. */ -#undef _MSE_INT_H - /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE diff --git a/gdb/configure b/gdb/configure index 61e8fa8..e4bde75 100755 --- a/gdb/configure +++ b/gdb/configure @@ -7723,62 +7723,6 @@ _ACEOF fi -# We need to link with -lw to get `wctype' on Solaris before Solaris -# 2.6. Solaris 2.6 and beyond have this function in libc, and have a -# libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 -# is known to have this problem). Therefore we avoid libw if we can. -ac_fn_c_check_func "$LINENO" "wctype" "ac_cv_func_wctype" -if test "x$ac_cv_func_wctype" = x""yes; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype in -lw" >&5 -$as_echo_n "checking for wctype in -lw... " >&6; } -if test "${ac_cv_lib_w_wctype+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lw $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char wctype (); -int -main () -{ -return wctype (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_w_wctype=yes -else - ac_cv_lib_w_wctype=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_w_wctype" >&5 -$as_echo "$ac_cv_lib_w_wctype" >&6; } -if test "x$ac_cv_lib_w_wctype" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBW 1 -_ACEOF - - LIBS="-lw $LIBS" - -fi - -fi - - # Some systems (e.g. Solaris) have `gethostbyname' in libnsl. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 $as_echo_n "checking for library containing gethostbyname... " >&6; } @@ -11651,17 +11595,6 @@ fi done -# On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash -# between and that would cause AC_CHECK_HEADERS to -# think that we don't have if we're using GCC. -case $host_os in - solaris2.[789]) - if test "$GCC" = yes; then - -$as_echo "#define _MSE_INT_H 1" >>confdefs.h - - fi ;; -esac for ac_header in curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -14681,111 +14614,6 @@ $as_echo "$found" >&6; } if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in - solaris*) - # See if thread_db library is around for Solaris thread debugging. - # Note that we must explicitly test for version 1 of the library - # because version 0 (present on Solaris 2.4 or earlier) doesn't have - # the same API. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris thread debugging library" >&5 -$as_echo_n "checking for Solaris thread debugging library... " >&6; } - if test -f /usr/lib/libthread_db.so.1 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_THREAD_DB_LIB 1" >>confdefs.h - - CONFIG_OBS="${CONFIG_OBS} sol-thread.o" - CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - - LIBS="-ldl $LIBS" - -fi - - CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC" - # Sun randomly tweaked the prototypes in - # at one point. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if is old" >&5 -$as_echo_n "checking if is old... " >&6; } - if test "${gdb_cv_proc_service_is_old+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - ps_err_e ps_pdwrite - (struct ps_prochandle*, psaddr_t, const void*, size_t); - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdb_cv_proc_service_is_old=no -else - gdb_cv_proc_service_is_old=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_proc_service_is_old" >&5 -$as_echo "$gdb_cv_proc_service_is_old" >&6; } - if test $gdb_cv_proc_service_is_old = yes; then - -$as_echo "#define PROC_SERVICE_IS_OLD 1" >>confdefs.h - - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; aix*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AiX thread debugging library" >&5 $as_echo_n "checking for AiX thread debugging library... " >&6; } diff --git a/gdb/configure.ac b/gdb/configure.ac index b4d7a87..2e4ccb6 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -508,13 +508,6 @@ esac # We might need to link with -lm; most simulators need it. AC_CHECK_LIB(m, main) -# We need to link with -lw to get `wctype' on Solaris before Solaris -# 2.6. Solaris 2.6 and beyond have this function in libc, and have a -# libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 -# is known to have this problem). Therefore we avoid libw if we can. -AC_CHECK_FUNC(wctype, [], - [AC_CHECK_LIB(w, wctype)]) - # Some systems (e.g. Solaris) have `gethostbyname' in libnsl. AC_SEARCH_LIBS(gethostbyname, nsl) @@ -1308,17 +1301,6 @@ AC_CHECK_HEADERS(sys/user.h, [], [], #endif ]) -# On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash -# between and that would cause AC_CHECK_HEADERS to -# think that we don't have if we're using GCC. -case $host_os in - solaris2.[[789]]) - if test "$GCC" = yes; then - AC_DEFINE(_MSE_INT_H, 1, - [Define to 1 to avoid a clash between and on - Solaris 2.[789] when using GCC. ]) - fi ;; -esac AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h) AC_CHECK_HEADERS(term.h, [], [], [#if HAVE_CURSES_H @@ -1769,41 +1751,6 @@ dnl and not doing a canadian cross build (build == host). if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in - solaris*) - # See if thread_db library is around for Solaris thread debugging. - # Note that we must explicitly test for version 1 of the library - # because version 0 (present on Solaris 2.4 or earlier) doesn't have - # the same API. - AC_MSG_CHECKING(for Solaris thread debugging library) - if test -f /usr/lib/libthread_db.so.1 ; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_THREAD_DB_LIB, 1, - [Define if using Solaris thread debugging.]) - CONFIG_OBS="${CONFIG_OBS} sol-thread.o" - CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" - AC_CHECK_LIB(dl, dlopen) - CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC" - # Sun randomly tweaked the prototypes in - # at one point. - AC_MSG_CHECKING(if is old) - AC_CACHE_VAL(gdb_cv_proc_service_is_old,[ - AC_TRY_COMPILE([ - #include - ps_err_e ps_pdwrite - (struct ps_prochandle*, psaddr_t, const void*, size_t); - ],, gdb_cv_proc_service_is_old=no, - gdb_cv_proc_service_is_old=yes) - ]) - AC_MSG_RESULT($gdb_cv_proc_service_is_old) - if test $gdb_cv_proc_service_is_old = yes; then - AC_DEFINE(PROC_SERVICE_IS_OLD, 1, - [Define if on solaris uses int instead of - size_t, and assorted other type changes.]) - fi - else - AC_MSG_RESULT(no) - fi - ;; aix*) AC_MSG_CHECKING(for AiX thread debugging library) AC_CACHE_VAL(gdb_cv_have_aix_thread_debug, diff --git a/gdb/configure.host b/gdb/configure.host index 304675f..911d9c1 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -20,6 +20,7 @@ case $host in vax-*-netbsdelf*) ;; *-*-irix* | \ + *-*-solaris2.[01] | *-*-solaris2.[2-9]* | \ alpha*-*-osf* | \ alpha*-*-freebsd* | \ alpha*-*-kfreebsd*-gnu | \ @@ -113,9 +114,8 @@ i[34567]86-*-linux*) gdb_host=linux ;; i[34567]86-*-gnu*) gdb_host=i386gnu ;; i[3456]86-*-nto*) gdb_host=nto ;; i[34567]86-*-openbsd*) gdb_host=obsd ;; -i[34567]86-*-solaris2.1[0-9]* | x86_64-*-solaris2.1[0-9]*) - gdb_host=sol2-64 ;; -i[34567]86-*-solaris*) gdb_host=i386sol2 ;; +i[34567]86-*-solaris2* | x86_64-*-solaris2*) + gdb_host=sol2 ;; i[34567]86-*-cygwin*) gdb_host=cygwin ;; ia64-*-linux*) gdb_host=linux ;; diff --git a/gdb/configure.nat b/gdb/configure.nat index bf851f5..3794663 100644 --- a/gdb/configure.nat +++ b/gdb/configure.nat @@ -85,6 +85,12 @@ case ${gdb_host} in darwin) NATDEPFILES='fork-child.o fork-inferior.o darwin-nat.o \ darwin-nat-info.o' + ;; + sol2) + NATDEPFILES='fork-child.o fork-inferior.o \ + procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o \ + sol-thread.o' + HAVE_NATIVE_GCORE_HOST=1 ;; esac @@ -212,17 +218,6 @@ case ${gdb_host} in ;; esac ;; - i386sol2) - case ${gdb_host_cpu} in - i386) - # Host: Solaris x86 - NATDEPFILES='fork-child.o fork-inferior.o \ - i386-v4-nat.o i386-sol2-nat.o \ - procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o' - HAVE_NATIVE_GCORE_HOST=1 - ;; - esac - ;; linux) case ${gdb_host_cpu} in aarch64) @@ -461,24 +456,15 @@ case ${gdb_host} in ;; sol2) case ${gdb_host_cpu} in + i386) + # Host: Solaris x86_64 + NATDEPFILES="${NATDEPFILES} \ + amd64-nat.o i386-v4-nat.o i386-sol2-nat.o" + ;; sparc) # Host: Solaris SPARC & UltraSPARC NAT_FILE='nm-sol2.h' - NATDEPFILES='sparc-sol2-nat.o \ - fork-child.o fork-inferior.o \ - procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o' - HAVE_NATIVE_GCORE_HOST=1 - ;; - esac - ;; - sol2-64) - case ${gdb_host_cpu} in - i386) - # Host: Solaris x86_64 - NATDEPFILES='fork-child.o fork-inferior.o \ - amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \ - procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o' - HAVE_NATIVE_GCORE_HOST=1 + NATDEPFILES="${NATDEPFILES} sparc-sol2-nat.o" ;; esac ;; diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 7ac3ae0..122a726 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -223,17 +223,12 @@ i[34567]86-*-nto*) i386-nto-tdep.o nto-tdep.o" build_gdbserver=yes ;; -i[34567]86-*-solaris2.1[0-9]* | x86_64-*-solaris2.1[0-9]*) +i[34567]86-*-solaris2* | x86_64-*-solaris2*) # Target: Solaris x86_64 gdb_target_obs="i386-tdep.o i386.o i387-tdep.o amd64-tdep.o amd64.o \ amd64-sol2-tdep.o i386-sol2-tdep.o sol2-tdep.o \ solib-svr4.o" ;; -i[34567]86-*-solaris*) - # Target: Solaris x86 - gdb_target_obs="i386-tdep.o i387-tdep.o i386-sol2-tdep.o sol2-tdep.o \ - i386.o solib-svr4.o" - ;; i[34567]86-*-linux*) # Target: Intel 386 running GNU/Linux gdb_target_obs="i386-tdep.o i386.o i386-linux-tdep.o \ @@ -591,12 +586,6 @@ sparc64-*-openbsd*) nbsd-tdep.o obsd-tdep.o bsd-uthread.o solib-svr4.o \ ravenscar-thread.o sparc-ravenscar-thread.o" ;; -sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) - # Target: Solaris SPARC - gdb_target_obs="sparc-tdep.o sparc-sol2-tdep.o sol2-tdep.o \ - solib-svr4.o \ - ravenscar-thread.o sparc-ravenscar-thread.o" - ;; sparc-*-solaris2* | sparcv9-*-solaris2* | sparc64-*-solaris2*) # Target: Solaris UltraSPARC gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o sparc-tdep.o \ diff --git a/gdb/proc-service.c b/gdb/proc-service.c index 4620fea..4f53c9b 100644 --- a/gdb/proc-service.c +++ b/gdb/proc-service.c @@ -34,24 +34,6 @@ #include "gregset.h" -/* Fix-up some broken systems. */ - -/* The prototypes in are slightly different on older - systems. Compensate for the discrepancies. */ - -#ifdef PROC_SERVICE_IS_OLD -typedef const struct ps_prochandle *gdb_ps_prochandle_t; -typedef char *gdb_ps_read_buf_t; -typedef char *gdb_ps_write_buf_t; -typedef int gdb_ps_size_t; -#else -typedef struct ps_prochandle *gdb_ps_prochandle_t; -typedef void *gdb_ps_read_buf_t; -typedef const void *gdb_ps_write_buf_t; -typedef size_t gdb_ps_size_t; -#endif - - /* Helper functions. */ /* Convert a psaddr_t to a CORE_ADDR. */ @@ -107,7 +89,7 @@ ps_xfer_memory (const struct ps_prochandle *ph, psaddr_t addr, symbol is stored in SYM_ADDR. */ ps_err_e -ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, +ps_pglobal_lookup (struct ps_prochandle *ph, const char *obj, const char *name, psaddr_t *sym_addr) { struct inferior *inf = find_inferior_ptid (ph->ptid); @@ -129,8 +111,7 @@ ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, them into BUF. */ ps_err_e -ps_pdread (gdb_ps_prochandle_t ph, psaddr_t addr, - gdb_ps_read_buf_t buf, gdb_ps_size_t size) +ps_pdread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t size) { return ps_xfer_memory (ph, addr, (gdb_byte *) buf, size, 0); } @@ -138,8 +119,8 @@ ps_pdread (gdb_ps_prochandle_t ph, psaddr_t addr, /* Write SIZE bytes from BUF into the target process PH at address ADDR. */ ps_err_e -ps_pdwrite (gdb_ps_prochandle_t ph, psaddr_t addr, - gdb_ps_write_buf_t buf, gdb_ps_size_t size) +ps_pdwrite (struct ps_prochandle *ph, psaddr_t addr, + const void *buf, size_t size) { return ps_xfer_memory (ph, addr, (gdb_byte *) buf, size, 1); } @@ -148,7 +129,7 @@ ps_pdwrite (gdb_ps_prochandle_t ph, psaddr_t addr, and store them in GREGSET. */ ps_err_e -ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) +ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset) { ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0); struct regcache *regcache @@ -164,7 +145,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) from GREGSET. */ ps_err_e -ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset) +ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset) { ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0); struct regcache *regcache @@ -180,8 +161,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset) process PH and store them in FPREGSET. */ ps_err_e -ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, - gdb_prfpregset_t *fpregset) +ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, gdb_prfpregset_t *fpregset) { ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0); struct regcache *regcache @@ -197,7 +177,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, process PH from FPREGSET. */ ps_err_e -ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, +ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, const gdb_prfpregset_t *fpregset) { ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0); @@ -214,7 +194,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, -- not used on Solaris. */ pid_t -ps_getpid (gdb_ps_prochandle_t ph) +ps_getpid (struct ps_prochandle *ph) { return ptid_get_pid (ph->ptid); } diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index d493f7b..c521914 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -700,34 +700,6 @@ sol_thread_alive (struct target_ops *ops, ptid_t ptid) /* These routines implement the lower half of the thread_db interface, i.e. the ps_* routines. */ -/* Various versions of have slightly different - function prototypes. In particular, we have - - NEWER OLDER - struct ps_prochandle * const struct ps_prochandle * - void* char* - const void* char* - int size_t - - Which one you have depends on the Solaris version and what patches - you've applied. On the theory that there are only two major - variants, we have configure check the prototype of ps_pdwrite (), - and use that info to make appropriate typedefs here. */ - -#ifdef PROC_SERVICE_IS_OLD -typedef const struct ps_prochandle *gdb_ps_prochandle_t; -typedef char *gdb_ps_read_buf_t; -typedef char *gdb_ps_write_buf_t; -typedef int gdb_ps_size_t; -typedef psaddr_t gdb_ps_addr_t; -#else -typedef struct ps_prochandle *gdb_ps_prochandle_t; -typedef void *gdb_ps_read_buf_t; -typedef const void *gdb_ps_write_buf_t; -typedef size_t gdb_ps_size_t; -typedef psaddr_t gdb_ps_addr_t; -#endif - /* The next four routines are called by libthread_db to tell us to stop and stop a particular process or lwp. Since GDB ensures that these are all stopped by the time we call anything in thread_db, @@ -736,7 +708,7 @@ typedef psaddr_t gdb_ps_addr_t; /* Process stop. */ ps_err_e -ps_pstop (gdb_ps_prochandle_t ph) +ps_pstop (struct ps_prochandle *ph) { return PS_OK; } @@ -744,7 +716,7 @@ ps_pstop (gdb_ps_prochandle_t ph) /* Process continue. */ ps_err_e -ps_pcontinue (gdb_ps_prochandle_t ph) +ps_pcontinue (struct ps_prochandle *ph) { return PS_OK; } @@ -752,7 +724,7 @@ ps_pcontinue (gdb_ps_prochandle_t ph) /* LWP stop. */ ps_err_e -ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid) +ps_lstop (struct ps_prochandle *ph, lwpid_t lwpid) { return PS_OK; } @@ -760,7 +732,7 @@ ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid) /* LWP continue. */ ps_err_e -ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid) +ps_lcontinue (struct ps_prochandle *ph, lwpid_t lwpid) { return PS_OK; } @@ -768,8 +740,8 @@ ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid) /* Looks up the symbol LD_SYMBOL_NAME in the debugger's symbol table. */ ps_err_e -ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name, - const char *ld_symbol_name, gdb_ps_addr_t *ld_symbol_addr) +ps_pglobal_lookup (struct ps_prochandle *ph, const char *ld_object_name, + const char *ld_symbol_name, psaddr_t *ld_symbol_addr) { struct bound_minimal_symbol ms; @@ -784,7 +756,7 @@ ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name, /* Common routine for reading and writing memory. */ static ps_err_e -rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr, +rw_common (int dowrite, const struct ps_prochandle *ph, psaddr_t addr, gdb_byte *buf, int size) { int ret; @@ -819,8 +791,7 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr, /* Copies SIZE bytes from target process .data segment to debugger memory. */ ps_err_e -ps_pdread (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, - gdb_ps_read_buf_t buf, gdb_ps_size_t size) +ps_pdread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t size) { return rw_common (0, ph, addr, (gdb_byte *) buf, size); } @@ -828,8 +799,8 @@ ps_pdread (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, /* Copies SIZE bytes from debugger memory .data segment to target process. */ ps_err_e -ps_pdwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, - gdb_ps_write_buf_t buf, gdb_ps_size_t size) +ps_pdwrite (struct ps_prochandle *ph, psaddr_t addr, + const void *buf, size_t size) { return rw_common (1, ph, addr, (gdb_byte *) buf, size); } @@ -837,8 +808,7 @@ ps_pdwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, /* Copies SIZE bytes from target process .text segment to debugger memory. */ ps_err_e -ps_ptread (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, - gdb_ps_read_buf_t buf, gdb_ps_size_t size) +ps_ptread (struct ps_prochandle *ph, psaddr_t addr, void *buf, size_t size) { return rw_common (0, ph, addr, (gdb_byte *) buf, size); } @@ -846,8 +816,8 @@ ps_ptread (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, /* Copies SIZE bytes from debugger memory .text segment to target process. */ ps_err_e -ps_ptwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, - gdb_ps_write_buf_t buf, gdb_ps_size_t size) +ps_ptwrite (struct ps_prochandle *ph, psaddr_t addr, + const void *buf, size_t size) { return rw_common (1, ph, addr, (gdb_byte *) buf, size); } @@ -855,7 +825,7 @@ ps_ptwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, /* Get general-purpose registers for LWP. */ ps_err_e -ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) +ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset) { ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); struct regcache *regcache @@ -870,7 +840,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) /* Set general-purpose registers for LWP. */ ps_err_e -ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, +ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset) { ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); @@ -898,7 +868,7 @@ ps_plog (const char *fmt, ...) /* Get size of extra register set. Currently a noop. */ ps_err_e -ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize) +ps_lgetxregsize (struct ps_prochandle *ph, lwpid_t lwpid, int *xregsize) { return PS_OK; } @@ -906,7 +876,7 @@ ps_lgetxregsize (gdb_ps_prochandle_t ph, lwpid_t lwpid, int *xregsize) /* Get extra register set. Currently a noop. */ ps_err_e -ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) +ps_lgetxregs (struct ps_prochandle *ph, lwpid_t lwpid, caddr_t xregset) { return PS_OK; } @@ -914,7 +884,7 @@ ps_lgetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) /* Set extra register set. Currently a noop. */ ps_err_e -ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) +ps_lsetxregs (struct ps_prochandle *ph, lwpid_t lwpid, caddr_t xregset) { return PS_OK; } @@ -922,7 +892,7 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset) /* Get floating-point registers for LWP. */ ps_err_e -ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, +ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, prfpregset_t *fpregset) { ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); @@ -938,7 +908,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, /* Set floating-point regs for LWP. */ ps_err_e -ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, +ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, const prfpregset_t * fpregset) { ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); @@ -957,7 +927,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, (e.g. procfs) method, but this ought to work. */ ps_err_e -ps_pdmodel (gdb_ps_prochandle_t ph, int *data_model) +ps_pdmodel (struct ps_prochandle *ph, int *data_model) { if (exec_bfd == 0) *data_model = PR_MODEL_UNKNOWN; @@ -978,7 +948,7 @@ ps_pdmodel (gdb_ps_prochandle_t ph, int *data_model) of libthread_db would fail because of ps_lgetLDT being undefined. */ ps_err_e -ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid, +ps_lgetLDT (struct ps_prochandle *ph, lwpid_t lwpid, struct ssd *pldt) { /* NOTE: only used on Solaris, therefore OK to refer to procfs.c. */ -- 2.7.4