public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Fix gdb 8.1 Solaris compilation
@ 2017-09-21 13:02 Rainer Orth
  2017-09-21 13:17 ` Andreas Schwab
  2017-09-21 14:21 ` Fix gdb 8.1 Solaris compilation Pedro Alves
  0 siblings, 2 replies; 18+ messages in thread
From: Rainer Orth @ 2017-09-21 13:02 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 4468 bytes --]

I just tried to compile gdb trunk on Solaris 11.4 (formerly 12), and
failed for a couple of reasons:

*

In file included from /usr/include/python2.7/Python.h:128:0,
                 from /vol/src/gnu/gdb/gdb/dist/gdb/python/python-internal.h:94,
                 from /vol/src/gnu/gdb/gdb/dist/gdb/python/py-instruction.h:23,
                 from /vol/src/gnu/gdb/gdb/dist/gdb/python/py-instruction.c:21:
/usr/include/python2.7/ceval.h:67:0: error: ignoring #pragma no_inline  [-Werror=unknown-pragmas]
 #pragma no_inline(PyEval_EvalFrameEx)
 ^

  New in Solaris 11.4: <python2.7/ceval.h> uses a Studio-only #pragma.
  I've disabled the warning in warnings.m4.

*

/vol/src/gnu/gdb/gdb/dist/gdb/ser-pipe.c: In function ‘int pipe_open(serial*, const char*)’:
/vol/src/gnu/gdb/gdb/dist/gdb/ser-pipe.c:77:9: error: ‘pid_t vfork()’ is deprecated (declared at /usr/include/unistd.h:659) [-Werror=deprecated-declarations]
   pid = vfork ();
         ^
/vol/src/gnu/gdb/gdb/dist/gdb/ser-pipe.c:77:16: error: ‘pid_t vfork()’ is deprecated (declared at /usr/include/unistd.h:659) [-Werror=deprecated-declarations]
   pid = vfork ();
                ^

  Since Solaris 11, vfork () is marked deprecated in <unistd.h>.

  cf. vfork(2):

       The  vfork()  and vforkx() functions are deprecated. Their sole legiti-
       mate use as a prelude to an immediate call to a function from the  exec
       family can be achieved safely by posix_spawn(3C) or posix_spawnp(3C).

  Again, I've disabled the warning.

*

/vol/src/gnu/gdb/gdb/dist/gdb/cli/cli-cmds.c: In function ‘void shell_escape(const char*, int)’:
/vol/src/gnu/gdb/gdb/dist/gdb/cli/cli-cmds.c:750:14: error: ‘pid_t vfork()’ is deprecated (declared at /usr/include/unistd.h:659) [-Werror=deprecated-declarations]
   if ((pid = vfork ()) == 0)
              ^
/vol/src/gnu/gdb/gdb/dist/gdb/cli/cli-cmds.c:750:21: error: ‘pid_t vfork()’ is deprecated (declared at /usr/include/unistd.h:659) [-Werror=deprecated-declarations]
   if ((pid = vfork ()) == 0)
                     ^

  Same problem.

*

/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c: In function ‘void procfs_init_inferior(target_ops*, int)’:
/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c:4380:30: error: ‘START_INFERIOR_TRAPS_EXPECTED’ was not declared in this scope
   gdb_startup_inferior (pid, START_INFERIOR_TRAPS_EXPECTED);
                              ^

  defined in nat/fork-inferior.h, need to include that header

/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c: In function ‘void procfs_create_inferior(target_ops*, const char*, const string&, char**, int)’:
/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c:4605:38: error: ‘fork_inferior’ was not declared in this scope
          NULL, NULL, shell_file, NULL);
                                      ^

  likewise

/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c: In function ‘void procfs_info_proc(target_ops*, const char*, info_proc_what)’:
/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c:5124:20: error: ‘argv’ was not declared in this scope
   for (char *arg : argv)
                    ^

  Typo, should be built_argv instead!

*

Undefined                       first referenced
 symbol                             in file
fork_inferior(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char**, void (*)(), void (*)(int), void (*)(), char const*, void (*)(char const*, char* const*, char* const*)) procfs.o
startup_inferior(int, int, target_waitstatus*, ptid_t*) fork-child.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2249: gdb] Error 1

  Need to add fork-inferior.o to NATDEPFILES.

With the changes below, I can build gdb on sparcv9-sun-solaris2.11 and
amd64-pc-solaris2.11 and a simple smoke test (gdb/gdb gdb/gdb) works.

Ok for mainline?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2017-09-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.nat <i386sol2,i386>: Add fork-inferior.o to NATDEPFILES.
	<sol2,sparc>: Likewise.
	<sol2-64,i386>: Likewise.

	* warning.m4 (AM_GDB_WARNINGS): Disable -Wunknown-pragmas,
	-Wdeprecated-declarations on *-*-solaris*.
	* configure: Regenerate.

	* procfs.c: Include "nat/inferior.h".
	(procfs_info_proc): Fix typo.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol2-gdb81.patch --]
[-- Type: text/x-patch, Size: 2561 bytes --]

diff --git a/gdb/configure.nat b/gdb/configure.nat
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -216,7 +216,8 @@ case ${gdb_host} in
 	case ${gdb_host_cpu} in
 	    i386)
 		# Host: Solaris x86
-		NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
+		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
 		;;
@@ -464,7 +465,7 @@ case ${gdb_host} in
 		# Host: Solaris SPARC & UltraSPARC
 		NAT_FILE='nm-sol2.h'
 		NATDEPFILES='sparc-sol2-nat.o \
-		fork-child.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
 		;;
@@ -474,7 +475,8 @@ case ${gdb_host} in
 	case ${gdb_host_cpu} in
 	    i386)
 		# Host: Solaris x86_64
-		NATDEPFILES='fork-child.o amd64-nat.o i386-v4-nat.o i386-sol2-nat.o \
+		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
 		;;
diff --git a/gdb/procfs.c b/gdb/procfs.c
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -30,6 +30,7 @@
 #include "gdbthread.h"
 #include "regcache.h"
 #include "inf-child.h"
+#include "nat/fork-inferior.h"
 #include "filestuff.h"
 
 #if defined (NEW_PROC_API)
@@ -5121,7 +5122,7 @@ procfs_info_proc (struct target_ops *ops
 
   old_chain = make_cleanup (null_cleanup, 0);
   gdb_argv built_argv (args);
-  for (char *arg : argv)
+  for (char *arg : built_argv)
     {
       if (isdigit (arg[0]))
 	{
diff --git a/gdb/warning.m4 b/gdb/warning.m4
--- a/gdb/warning.m4
+++ b/gdb/warning.m4
@@ -43,10 +43,17 @@ build_warnings="-Wall -Wpointer-arith \
 -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \
 -Wno-mismatched-tags"
 
-# Enable -Wno-format by default when using gcc on mingw since many
-# GCC versions complain about %I64.
 case "${host}" in
-  *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;;
+  *-*-mingw32*)
+    # Enable -Wno-format by default when using gcc on mingw since many
+    # GCC versions complain about %I64.
+    build_warnings="$build_warnings -Wno-format" ;;
+  *-*-solaris*)
+    # Solaris 11.4 <python2.7/ceval.h> uses #pragma no_inline that GCC
+    # doesn't understand.
+    build_warnings="$build_warnings -Wno-unknown-pragmas"
+    # Solaris 11 <unistd.h> marks vfork deprecated.
+    build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
   *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
 esac
 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Fix gdb 8.1 Solaris compilation
  2017-09-21 13:02 Fix gdb 8.1 Solaris compilation Rainer Orth
@ 2017-09-21 13:17 ` Andreas Schwab
  2017-09-21 14:14   ` Rainer Orth
  2017-09-21 14:21 ` Fix gdb 8.1 Solaris compilation Pedro Alves
  1 sibling, 1 reply; 18+ messages in thread
From: Andreas Schwab @ 2017-09-21 13:17 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb-patches

On Sep 21 2017, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:

> diff --git a/gdb/configure.nat b/gdb/configure.nat
> --- a/gdb/configure.nat
> +++ b/gdb/configure.nat
> @@ -216,7 +216,8 @@ case ${gdb_host} in
>  	case ${gdb_host_cpu} in
>  	    i386)
>  		# Host: Solaris x86
> -		NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
> +		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
>  		;;

Doesn't that lack backslashes?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Fix gdb 8.1 Solaris compilation
  2017-09-21 13:17 ` Andreas Schwab
@ 2017-09-21 14:14   ` Rainer Orth
  2017-09-21 14:31     ` Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation] Rainer Orth
  0 siblings, 1 reply; 18+ messages in thread
From: Rainer Orth @ 2017-09-21 14:14 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

Hi Andreas,

> On Sep 21 2017, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>
>> diff --git a/gdb/configure.nat b/gdb/configure.nat
>> --- a/gdb/configure.nat
>> +++ b/gdb/configure.nat
>> @@ -216,7 +216,8 @@ case ${gdb_host} in
>>  	case ${gdb_host_cpu} in
>>  	    i386)
>>  		# Host: Solaris x86
>> -		NATDEPFILES='fork-child.o i386-v4-nat.o i386-sol2-nat.o \
>> +		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
>>  		;;
>
> Doesn't that lack backslashes?

It does, good catch, thanks.  The configure fragment resp. shell is fine
without, of course, but they are needed once substituted into Makefile.
Fixed locally.

However, this section is only needed on Solaris < 10, which is why I
didn't notice it until I tried an i386-pc-solaris2.9 build.  It's
probably time to remove support for those old Solaris versions in gdb,
too: gcc lost them after 4.9.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Fix gdb 8.1 Solaris compilation
  2017-09-21 13:02 Fix gdb 8.1 Solaris compilation Rainer Orth
  2017-09-21 13:17 ` Andreas Schwab
@ 2017-09-21 14:21 ` Pedro Alves
  2017-09-21 14:23   ` Rainer Orth
  1 sibling, 1 reply; 18+ messages in thread
From: Pedro Alves @ 2017-09-21 14:21 UTC (permalink / raw)
  To: Rainer Orth, gdb-patches

On 09/21/2017 02:02 PM, Rainer Orth wrote:

> With the changes below, I can build gdb on sparcv9-sun-solaris2.11 and
> amd64-pc-solaris2.11 and a simple smoke test (gdb/gdb gdb/gdb) works.
> 
> Ok for mainline?
> 

OK.

(Since you posted a non-'git format-patch' patch, I feel compelled
to say: please remember to push with meaningful git subject line
and commit log.)

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Fix gdb 8.1 Solaris compilation
  2017-09-21 14:21 ` Fix gdb 8.1 Solaris compilation Pedro Alves
@ 2017-09-21 14:23   ` Rainer Orth
  0 siblings, 0 replies; 18+ messages in thread
From: Rainer Orth @ 2017-09-21 14:23 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Hi Pedro,

> On 09/21/2017 02:02 PM, Rainer Orth wrote:
>
>> With the changes below, I can build gdb on sparcv9-sun-solaris2.11 and
>> amd64-pc-solaris2.11 and a simple smoke test (gdb/gdb gdb/gdb) works.
>> 
>> Ok for mainline?
>
> OK.
>
> (Since you posted a non-'git format-patch' patch, I feel compelled
> to say: please remember to push with meaningful git subject line
> and commit log.)

I do, but am working with hg locally since I always found git to be a
total nightmare.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-21 14:14   ` Rainer Orth
@ 2017-09-21 14:31     ` Rainer Orth
  2017-09-21 14:39       ` Pedro Alves
  0 siblings, 1 reply; 18+ messages in thread
From: Rainer Orth @ 2017-09-21 14:31 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gdb-patches

Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> However, this section is only needed on Solaris < 10, which is why I
> didn't notice it until I tried an i386-pc-solaris2.9 build.  It's
> probably time to remove support for those old Solaris versions in gdb,
> too: gcc lost them after 4.9.

I'm pretty certain we should: the Solaris 9/x86 build didn't complete,
even with the configure.nat section fixed:

In file included from build-gnulib/import/wchar.h:87:0,
                 from /vol/gcc-4.9/include/c++/4.9.0/cwchar:44,
                 from /vol/gcc-4.9/include/c++/4.9.0/bits/postypes.h:40,
                 from /vol/gcc-4.9/include/c++/4.9.0/bits/char_traits.h:40,
                 from /vol/gcc-4.9/include/c++/4.9.0/string:40,
                 from /vol/src/gnu/gdb/gdb/local/gdb/common/common-utils.h:23,
                 from /vol/src/gnu/gdb/gdb/local/gdb/common/common-defs.h:78,
                 from /vol/src/gnu/gdb/gdb/local/gdb/defs.h:28,
                 from /vol/src/gnu/gdb/gdb/local/gdb/gdb.c:19:
/vol/gcc-4.9/lib/gcc/i386-pc-solaris2.9/4.9.0/include-fixed/wchar.h:59:12: error: ‘std::wcstok’ has not been declared
 using std::wcstok;
            ^
/vol/gcc-4.9/lib/gcc/i386-pc-solaris2.9/4.9.0/include-fixed/wchar.h:60:12: error: ‘std::wcsftime’ has not been declared
 using std::wcsftime;
            ^

This bad interaction between gnulib and fixed Solaris 9 headers may be
fixable, but even trying to seems like a total waste of time.

How is obsoletion/removal handled in gdb?  In gcc, in one release a
target is obsoleted and trying to build it yields an error which can be
overridden with --enable-obsolete.  Unless someone steps up to continue
maintenance, the code is removed in the next release.

Does gdb go for immediate removal instead?  I have no idea which release
last built/worked on Solaris 9.  I have a build of 7.11 lying around,
but never tried anything later.

Thoughts?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-21 14:31     ` Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation] Rainer Orth
@ 2017-09-21 14:39       ` Pedro Alves
  2017-09-22 14:45         ` Rainer Orth
  0 siblings, 1 reply; 18+ messages in thread
From: Pedro Alves @ 2017-09-21 14:39 UTC (permalink / raw)
  To: Rainer Orth, Andreas Schwab; +Cc: gdb-patches

On 09/21/2017 03:30 PM, Rainer Orth wrote:

> This bad interaction between gnulib and fixed Solaris 9 headers may be
> fixable, but even trying to seems like a total waste of time.
> 
> How is obsoletion/removal handled in gdb?  In gcc, in one release a
> target is obsoleted and trying to build it yields an error which can be
> overridden with --enable-obsolete.  Unless someone steps up to continue
> maintenance, the code is removed in the next release.

GDB is more aggressive:

  https://sourceware.org/gdb/wiki/Internals%20Obsoleting-code

For Solaris, I believe it's been a while that the only maintenance
we've seen comes from you.  Which kind of makes you the de-facto
maintainer.  :-)  Since gcc obsoleted Solaris 9 years ago, and nobody
all these years stepped forward, I think we should be able to just drop
it.  I think you've proposed this in the past, even.  I very
much doubt anyone would step forward this time.

> Does gdb go for immediate removal instead?  I have no idea which release
> last built/worked on Solaris 9.  I have a build of 7.11 lying around,
> but never tried anything later.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-21 14:39       ` Pedro Alves
@ 2017-09-22 14:45         ` Rainer Orth
  2017-09-22 15:40           ` Pedro Alves
  0 siblings, 1 reply; 18+ messages in thread
From: Rainer Orth @ 2017-09-22 14:45 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Andreas Schwab, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2691 bytes --]

Hi Pedro,

> On 09/21/2017 03:30 PM, Rainer Orth wrote:
>
>> This bad interaction between gnulib and fixed Solaris 9 headers may be
>> fixable, but even trying to seems like a total waste of time.
>> 
>> How is obsoletion/removal handled in gdb?  In gcc, in one release a
>> target is obsoleted and trying to build it yields an error which can be
>> overridden with --enable-obsolete.  Unless someone steps up to continue
>> maintenance, the code is removed in the next release.
>
> GDB is more aggressive:
>
>   https://sourceware.org/gdb/wiki/Internals%20Obsoleting-code
>
> For Solaris, I believe it's been a while that the only maintenance
> we've seen comes from you.  Which kind of makes you the de-facto
> maintainer.  :-)  Since gcc obsoleted Solaris 9 years ago, and nobody

I feared that much ;-)

> all these years stepped forward, I think we should be able to just drop
> it.  I think you've proposed this in the past, even.  I very

Indeed: I found a line or two of notes about it.  Must have been in the
context of removing support for unstructured /proc in procfs.c and
friends.  I've dusted off and completed that patch as well...

> much doubt anyone would step forward this time.

Indeed.  I've opened a tracking PR gdb/22185 and produced a first patch.
It will need a bit more testing (especially on Linux which also uses
proc-service.c), but it's basically straightforward.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2017-09-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	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 <i386sol2>: Remove.
	<sol2-64>: Fold into ...
	<sol2>: ... this.
	Move common settings to default section.
	* configure.tgt <i[34567]86-*-solaris2.1[0-9]*,
	x86_64-*-solaris2.1[0-9]*>: Rename to ...
	<i[34567]86-*-solaris2*, x86_64-*-solaris2*>: ... this.
	<i[34567]86-*-solaris*>: Remove.
	<sparc-*-solaris2.[0-6], sparc-*-solaris2.[0-6].*>: Remove.

	* configure.ac: Remove wctype in libw check.
	(_MSE_INT_H): Don't define on Solaris 7-9.
	(PROC_SERVICE_IS_OLD): Remove.
	(HAVE_THREAD_DB_LIB): Don't consider libthread_db.so.0 any
	longer.
	* 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol89-remove.patch --]
[-- Type: text/x-patch, Size: 18237 bytes --]

# HG changeset patch
# Parent  5123ae285cd10f18efd6d5db4a75bc4989514ef1
Remove support for Solaris < 10 (PR gdb/22185)

diff --git a/gdb/NEWS b/gdb/NEWS
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -115,6 +115,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/configure.ac b/gdb/configure.ac
--- 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 <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to
-# think that we don't have <curses.h> 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 <widec.h> and <wchar.h> 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
@@ -1770,39 +1752,10 @@ dnl and not doing a canadian cross build
 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 <proc_service.h>
-	 # at one point.
-	 AC_MSG_CHECKING(if <proc_service.h> is old)
-	 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
-	    AC_TRY_COMPILE([
-		#include <proc_service.h>
-		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 <proc_service.h> on solaris uses int instead of
-             size_t, and assorted other type changes.])
-	 fi
-      else
-         AC_MSG_RESULT(no)
-      fi
+      CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
+      CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
+      AC_CHECK_LIB(dl, dlopen)
+      CONFIG_LDFLAGS="${CONFIG_LDFLAGS} $RDYNAMIC"
       ;;
    aix*)
       AC_MSG_CHECKING(for AiX thread debugging library)
diff --git a/gdb/configure.host b/gdb/configure.host
--- 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
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -85,6 +85,11 @@ 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'
+	HAVE_NATIVE_GCORE_HOST=1
         ;;
 esac
 
@@ -212,17 +217,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 +455,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
--- 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
--- a/gdb/proc-service.c
+++ b/gdb/proc-service.c
@@ -34,24 +34,6 @@
 #include "gregset.h"
 \f
 
-/* Fix-up some broken systems.  */
-
-/* The prototypes in <proc_service.h> 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
-\f
-
 /* Helper functions.  */
 
 /* Convert a psaddr_t to a CORE_ADDR.  */
@@ -107,7 +89,7 @@ ps_xfer_memory (const struct ps_prochand
    symbol is stored in SYM_ADDR.  */
 
 ps_err_e
-ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj,
+ps_pglobal_lookup (ps_prochandle_t ph, const char *obj,
 		   const char *name, psaddr_t *sym_addr)
 {
   struct inferior *inf = find_inferior_ptid (ph->ptid);
@@ -129,8 +111,8 @@ ps_pglobal_lookup (gdb_ps_prochandle_t p
    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 (ps_prochandle_t ph, psaddr_t addr,
+	   ps_read_buf_t buf, ps_size_t size)
 {
   return ps_xfer_memory (ph, addr, (gdb_byte *) buf, size, 0);
 }
@@ -138,8 +120,8 @@ ps_pdread (gdb_ps_prochandle_t ph, psadd
 /* 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 (ps_prochandle_t ph, psaddr_t addr,
+	    ps_write_buf_t buf, ps_size_t size)
 {
   return ps_xfer_memory (ph, addr, (gdb_byte *) buf, size, 1);
 }
@@ -148,7 +130,7 @@ ps_pdwrite (gdb_ps_prochandle_t ph, psad
    and store them in GREGSET.  */
 
 ps_err_e
-ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
+ps_lgetregs (ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 {
   ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0);
   struct regcache *regcache
@@ -164,7 +146,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwp
    from GREGSET.  */
 
 ps_err_e
-ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset)
+ps_lsetregs (ps_prochandle_t 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 +162,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwp
    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 (ps_prochandle_t 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 +178,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, l
    process PH from FPREGSET.  */
 
 ps_err_e
-ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ps_lsetfpregs (ps_prochandle_t ph, lwpid_t lwpid,
 	       const gdb_prfpregset_t *fpregset)
 {
   ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0);
@@ -214,7 +195,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, l
    -- not used on Solaris.  */
 
 pid_t
-ps_getpid (gdb_ps_prochandle_t ph)
+ps_getpid (ps_prochandle_t ph)
 {
   return ptid_get_pid (ph->ptid);
 }
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -700,34 +700,6 @@ sol_thread_alive (struct target_ops *ops
 /* These routines implement the lower half of the thread_db interface,
    i.e. the ps_* routines.  */
 
-/* Various versions of <proc_service.h> 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 (ps_prochandle_t 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 (ps_prochandle_t 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 (ps_prochandle_t ph, lwpid_t lwpid)
 {
   return PS_OK;
 }
@@ -760,7 +732,7 @@ ps_lstop (gdb_ps_prochandle_t ph, lwpid_
 /* LWP continue.  */
 
 ps_err_e
-ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid)
+ps_lcontinue (ps_prochandle_t ph, lwpid_t lwpid)
 {
   return PS_OK;
 }
@@ -768,8 +740,8 @@ ps_lcontinue (gdb_ps_prochandle_t ph, lw
 /* 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 (ps_prochandle_t ph, const char *ld_object_name,
+		   const char *ld_symbol_name, ps_addr_t *ld_symbol_addr)
 {
   struct bound_minimal_symbol ms;
 
@@ -784,7 +756,7 @@ ps_pglobal_lookup (gdb_ps_prochandle_t p
 /* 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, ps_addr_t addr,
 	   gdb_byte *buf, int size)
 {
   int ret;
@@ -819,8 +791,8 @@ rw_common (int dowrite, const struct ps_
 /* 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 (ps_prochandle_t ph, ps_addr_t addr,
+	   ps_read_buf_t buf, ps_size_t size)
 {
   return rw_common (0, ph, addr, (gdb_byte *) buf, size);
 }
@@ -828,8 +800,8 @@ ps_pdread (gdb_ps_prochandle_t ph, gdb_p
 /* 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 (ps_prochandle_t ph, ps_addr_t addr,
+	    ps_write_buf_t buf, ps_size_t size)
 {
   return rw_common (1, ph, addr, (gdb_byte *) buf, size);
 }
@@ -837,8 +809,8 @@ ps_pdwrite (gdb_ps_prochandle_t ph, gdb_
 /* 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 (ps_prochandle_t ph, ps_addr_t addr,
+	   ps_read_buf_t buf, ps_size_t size)
 {
   return rw_common (0, ph, addr, (gdb_byte *) buf, size);
 }
@@ -846,8 +818,8 @@ ps_ptread (gdb_ps_prochandle_t ph, gdb_p
 /* 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 (ps_prochandle_t ph, ps_addr_t addr,
+	    ps_write_buf_t buf, ps_size_t size)
 {
   return rw_common (1, ph, addr, (gdb_byte *) buf, size);
 }
@@ -855,7 +827,7 @@ ps_ptwrite (gdb_ps_prochandle_t ph, gdb_
 /* Get general-purpose registers for LWP.  */
 
 ps_err_e
-ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
+ps_lgetregs (ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 {
   ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
   struct regcache *regcache
@@ -870,7 +842,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwp
 /* Set general-purpose registers for LWP.  */
 
 ps_err_e
-ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ps_lsetregs (ps_prochandle_t ph, lwpid_t lwpid,
 	     const prgregset_t gregset)
 {
   ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
@@ -898,7 +870,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 (ps_prochandle_t ph, lwpid_t lwpid, int *xregsize)
 {
   return PS_OK;
 }
@@ -906,7 +878,7 @@ ps_lgetxregsize (gdb_ps_prochandle_t ph,
 /* 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 (ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
 {
   return PS_OK;
 }
@@ -914,7 +886,7 @@ ps_lgetxregs (gdb_ps_prochandle_t ph, lw
 /* 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 (ps_prochandle_t ph, lwpid_t lwpid, caddr_t xregset)
 {
   return PS_OK;
 }
@@ -922,7 +894,7 @@ ps_lsetxregs (gdb_ps_prochandle_t ph, lw
 /* Get floating-point registers for LWP.  */
 
 ps_err_e
-ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ps_lgetfpregs (ps_prochandle_t ph, lwpid_t lwpid,
 	       prfpregset_t *fpregset)
 {
   ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
@@ -938,7 +910,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, l
 /* Set floating-point regs for LWP.  */
 
 ps_err_e
-ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
+ps_lsetfpregs (ps_prochandle_t ph, lwpid_t lwpid,
 	       const prfpregset_t * fpregset)
 {
   ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
@@ -957,7 +929,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, l
    (e.g. procfs) method, but this ought to work.  */
 
 ps_err_e
-ps_pdmodel (gdb_ps_prochandle_t ph, int *data_model)
+ps_pdmodel (ps_prochandle_t ph, int *data_model)
 {
   if (exec_bfd == 0)
     *data_model = PR_MODEL_UNKNOWN;
@@ -978,7 +950,7 @@ ps_pdmodel (gdb_ps_prochandle_t ph, int 
    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 (ps_prochandle_t ph, lwpid_t lwpid,
 	    struct ssd *pldt)
 {
   /* NOTE: only used on Solaris, therefore OK to refer to procfs.c.  */

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-22 14:45         ` Rainer Orth
@ 2017-09-22 15:40           ` Pedro Alves
  2017-09-26 11:20             ` Rainer Orth
  0 siblings, 1 reply; 18+ messages in thread
From: Pedro Alves @ 2017-09-22 15:40 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Andreas Schwab, gdb-patches

On 09/22/2017 03:44 PM, Rainer Orth wrote:
>> On 09/21/2017 03:30 PM, Rainer Orth wrote:
> 
>> all these years stepped forward, I think we should be able to just drop
>> it.  I think you've proposed this in the past, even.  I very
> 
> Indeed: I found a line or two of notes about it.  Must have been in the
> context of removing support for unstructured /proc in procfs.c and
> friends.  I've dusted off and completed that patch as well...

Yay, looking forward to that.  :-)

>> much doubt anyone would step forward this time.
> 
> Indeed.  I've opened a tracking PR gdb/22185 and produced a first patch.
> It will need a bit more testing (especially on Linux which also uses
> proc-service.c), but it's basically straightforward.

Eh, the Solaris port doesn't actually use proc-service.c.   The
Solaris proc-service implementation is directly in sol-thread.c.
I think proc-service.c was originally based on sol-thread.c, maybe
aiming at sharing at some point, and that's where it got the
PROC_SERVICE_IS_OLD handling from.

The patch looks good to me.

I mildly wonder if the adding of sol-thread.o could move
from gdb/configure.ac to gdb/configure.nat.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-22 15:40           ` Pedro Alves
@ 2017-09-26 11:20             ` Rainer Orth
  2017-09-26 11:26               ` Pedro Alves
                                 ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Rainer Orth @ 2017-09-26 11:20 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 3814 bytes --]

Hi Pedro,

> On 09/22/2017 03:44 PM, Rainer Orth wrote:
>>> On 09/21/2017 03:30 PM, Rainer Orth wrote:
>> 
>>> all these years stepped forward, I think we should be able to just drop
>>> it.  I think you've proposed this in the past, even.  I very
>> 
>> Indeed: I found a line or two of notes about it.  Must have been in the
>> context of removing support for unstructured /proc in procfs.c and
>> friends.  I've dusted off and completed that patch as well...
>
> Yay, looking forward to that.  :-)

the patch compiles now.  I'll post an initial version soon.

>>> much doubt anyone would step forward this time.
>> 
>> Indeed.  I've opened a tracking PR gdb/22185 and produced a first patch.
>> It will need a bit more testing (especially on Linux which also uses
>> proc-service.c), but it's basically straightforward.
>
> Eh, the Solaris port doesn't actually use proc-service.c.   The
> Solaris proc-service implementation is directly in sol-thread.c.
> I think proc-service.c was originally based on sol-thread.c, maybe
> aiming at sharing at some point, and that's where it got the
> PROC_SERVICE_IS_OLD handling from.

I was misled by the support for Solaris-only PROC_SERVICE_IS_OLD.  It's
probably worth trying to merge the two now.

> The patch looks good to me.

Thanks.

> I mildly wonder if the adding of sol-thread.o could move
> from gdb/configure.ac to gdb/configure.nat.

Certainly: no point hiding a static addition in configure.ac.  I've also
found that the remaining code in the solaris* section there can go, too:

* 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).

The attached revised patch has been tested on sparcv9-sun-solaris2.10,
sparcv9-sun-solaris2.11.4 (with
https://sourceware.org/ml/gdb-patches/2017-09/msg00787.html applied so
mainline compiles on Solaris/SPARC at all), 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.

Testing is very weird, though: Linux/x86_64 only shows a few failures,
but Solaris is a mess: on Solaris 10, the vast majority of tests time
out (although gdb seems to work reasonably well interactively), while
many more work on Solaris 11.4 until testing runs into what seems an
infinite loop of

FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected (timeout)

Nonetheless, ok for mainline now?

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2017-09-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	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 <i386sol2>: Remove.
	<sol2-64>: Fold into ...
	<sol2>: ... this.
	Move common settings to default section.
	Add sol-thread.o.
	* configure.tgt <i[34567]86-*-solaris2.1[0-9]*,
	x86_64-*-solaris2.1[0-9]*>: Rename to ...
	<i[34567]86-*-solaris2*, x86_64-*-solaris2*>: ... this.
	<i[34567]86-*-solaris*>: Remove.
	<sparc-*-solaris2.[0-6], sparc-*-solaris2.[0-6].*>: Remove.

	* configure.ac: Remove wctype in libw check.
	(_MSE_INT_H): Don't define on Solaris 7-9.
	<solaris*>: 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sol89-remove.patch --]
[-- Type: text/x-patch, Size: 18213 bytes --]

# HG changeset patch
# Parent  5123ae285cd10f18efd6d5db4a75bc4989514ef1
Remove support for Solaris < 10 (PR gdb/22185)

diff --git a/gdb/NEWS b/gdb/NEWS
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -115,6 +115,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/configure.ac b/gdb/configure.ac
--- 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 <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to
-# think that we don't have <curses.h> 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 <widec.h> and <wchar.h> 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
 
 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 <proc_service.h>
-	 # at one point.
-	 AC_MSG_CHECKING(if <proc_service.h> is old)
-	 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
-	    AC_TRY_COMPILE([
-		#include <proc_service.h>
-		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 <proc_service.h> 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
--- 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
--- 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
--- 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
--- a/gdb/proc-service.c
+++ b/gdb/proc-service.c
@@ -34,24 +34,6 @@
 #include "gregset.h"
 \f
 
-/* Fix-up some broken systems.  */
-
-/* The prototypes in <proc_service.h> 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
-\f
-
 /* Helper functions.  */
 
 /* Convert a psaddr_t to a CORE_ADDR.  */
@@ -107,7 +89,7 @@ ps_xfer_memory (const struct ps_prochand
    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 p
    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, psadd
 /* 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, psad
    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, lwp
    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, lwp
    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, l
    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, l
    -- 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
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -700,34 +700,6 @@ sol_thread_alive (struct target_ops *ops
 /* These routines implement the lower half of the thread_db interface,
    i.e. the ps_* routines.  */
 
-/* Various versions of <proc_service.h> 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_
 /* 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, lw
 /* 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 p
 /* 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_
 /* 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_p
 /* 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_
 /* 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_p
 /* 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_
 /* 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, lwp
 /* 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,
 /* 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, lw
 /* 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, lw
 /* 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, l
 /* 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, l
    (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 
    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.  */

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 11:20             ` Rainer Orth
@ 2017-09-26 11:26               ` Pedro Alves
  2017-09-26 13:25                 ` Rainer Orth
  2017-09-26 14:18               ` Pedro Alves
  2017-09-29 11:53               ` Eli Zaretskii
  2 siblings, 1 reply; 18+ messages in thread
From: Pedro Alves @ 2017-09-26 11:26 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb-patches

>> I mildly wonder if the adding of sol-thread.o could move
>> from gdb/configure.ac to gdb/configure.nat.
> 
> Certainly: no point hiding a static addition in configure.ac.  I've also
> found that the remaining code in the solaris* section there can go, too:
> 
> * 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).
> 

Great!

> The attached revised patch has been tested on sparcv9-sun-solaris2.10,
> sparcv9-sun-solaris2.11.4 (with
> https://sourceware.org/ml/gdb-patches/2017-09/msg00787.html applied so
> mainline compiles on Solaris/SPARC at all), 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.
> 
> Testing is very weird, though: Linux/x86_64 only shows a few failures,
> but Solaris is a mess: on Solaris 10, the vast majority of tests time
> out (although gdb seems to work reasonably well interactively), while
> many more work on Solaris 11.4 until testing runs into what seems an
> infinite loop of
> 
> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected (timeout)
> 
> Nonetheless, ok for mainline now?

OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 11:26               ` Pedro Alves
@ 2017-09-26 13:25                 ` Rainer Orth
  2017-09-26 13:45                   ` Pedro Alves
  0 siblings, 1 reply; 18+ messages in thread
From: Rainer Orth @ 2017-09-26 13:25 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Hi Pedro,

>> The attached revised patch has been tested on sparcv9-sun-solaris2.10,
>> sparcv9-sun-solaris2.11.4 (with
>> https://sourceware.org/ml/gdb-patches/2017-09/msg00787.html applied so
>> mainline compiles on Solaris/SPARC at all), 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.
>> 
>> Testing is very weird, though: Linux/x86_64 only shows a few failures,
>> but Solaris is a mess: on Solaris 10, the vast majority of tests time
>> out (although gdb seems to work reasonably well interactively), while
>> many more work on Solaris 11.4 until testing runs into what seems an
>> infinite loop of
>> 
>> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1:
>> run failure detected (timeout)
>> 
>> Nonetheless, ok for mainline now?
>
> OK.

Installed now.  Should I also post post to gdb-annonce or just close the
PR and be done with the removal given the NEWS entry?

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 13:25                 ` Rainer Orth
@ 2017-09-26 13:45                   ` Pedro Alves
  2017-09-26 13:55                     ` Rainer Orth
  0 siblings, 1 reply; 18+ messages in thread
From: Pedro Alves @ 2017-09-26 13:45 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb-patches

On 09/26/2017 02:24 PM, Rainer Orth wrote:
> Hi Pedro,
>> OK.
> 
> Installed now.  Should I also post post to gdb-annonce or just close the
> PR and be done with the removal given the NEWS entry?

If you're up to it, wouldn't hurt to send a short FYI to both
gdb@ + gdb-announce@ for due diligence.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 13:45                   ` Pedro Alves
@ 2017-09-26 13:55                     ` Rainer Orth
  0 siblings, 0 replies; 18+ messages in thread
From: Rainer Orth @ 2017-09-26 13:55 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Hi Pedro,

>> Installed now.  Should I also post post to gdb-annonce or just close the
>> PR and be done with the removal given the NEWS entry?
>
> If you're up to it, wouldn't hurt to send a short FYI to both
> gdb@ + gdb-announce@ for due diligence.

sure, just done.  I'd be very surprised if anyone cared, though ;-)

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 11:20             ` Rainer Orth
  2017-09-26 11:26               ` Pedro Alves
@ 2017-09-26 14:18               ` Pedro Alves
  2017-09-26 14:21                 ` Pedro Alves
  2017-09-29 11:53               ` Eli Zaretskii
  2 siblings, 1 reply; 18+ messages in thread
From: Pedro Alves @ 2017-09-26 14:18 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb-patches


On 09/26/2017 12:20 PM, Rainer Orth wrote:
> 
> Testing is very weird, though: Linux/x86_64 only shows a few failures,
> but Solaris is a mess: on Solaris 10, the vast majority of tests time
> out (although gdb seems to work reasonably well interactively), while
> many more work on Solaris 11.4 until testing runs into what seems an
> infinite loop of
> 
> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected (timeout)

I recall once trying to run the testsuite on OpenSolaris
(several years ago, maybe 2008.11, though I don't really
recall exactly), and running into lots and lots of timeouts.
I think it had something to do with gdb + expect + dejagnu not
agreeing over end lines, \r\n vs \n, etc.  ISTR trying to
work around it with stty settings.  

I'm having trouble finding the email in the archives, though.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 14:18               ` Pedro Alves
@ 2017-09-26 14:21                 ` Pedro Alves
  2017-10-03 13:01                   ` Rainer Orth
  0 siblings, 1 reply; 18+ messages in thread
From: Pedro Alves @ 2017-09-26 14:21 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gdb-patches

On 09/26/2017 03:18 PM, Pedro Alves wrote:
> 
> On 09/26/2017 12:20 PM, Rainer Orth wrote:
>>
>> Testing is very weird, though: Linux/x86_64 only shows a few failures,
>> but Solaris is a mess: on Solaris 10, the vast majority of tests time
>> out (although gdb seems to work reasonably well interactively), while
>> many more work on Solaris 11.4 until testing runs into what seems an
>> infinite loop of
>>
>> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected (timeout)
> 
> I recall once trying to run the testsuite on OpenSolaris
> (several years ago, maybe 2008.11, though I don't really
> recall exactly), and running into lots and lots of timeouts.
> I think it had something to do with gdb + expect + dejagnu not
> agreeing over end lines, \r\n vs \n, etc.  ISTR trying to
> work around it with stty settings.  
> 
> I'm having trouble finding the email in the archives, though.

Bah, I was looking in the wrong list, that's why...

Here it is:
 https://sourceware.org/ml/gdb/2008-07/msg00292.html
and the workaround:
 https://sourceware.org/ml/gdb/2008-08/msg00144.html

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 11:20             ` Rainer Orth
  2017-09-26 11:26               ` Pedro Alves
  2017-09-26 14:18               ` Pedro Alves
@ 2017-09-29 11:53               ` Eli Zaretskii
  2 siblings, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2017-09-29 11:53 UTC (permalink / raw)
  To: Rainer Orth; +Cc: palves, gdb-patches

> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> Cc: gdb-patches@sourceware.org
> Date: Tue, 26 Sep 2017 13:20:05 +0200
> 
> 2017-09-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	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 <i386sol2>: Remove.
> 	<sol2-64>: Fold into ...
> 	<sol2>: ... this.
> 	Move common settings to default section.
> 	Add sol-thread.o.
> 	* configure.tgt <i[34567]86-*-solaris2.1[0-9]*,
> 	x86_64-*-solaris2.1[0-9]*>: Rename to ...
> 	<i[34567]86-*-solaris2*, x86_64-*-solaris2*>: ... this.
> 	<i[34567]86-*-solaris*>: Remove.
> 	<sparc-*-solaris2.[0-6], sparc-*-solaris2.[0-6].*>: Remove.
> 
> 	* configure.ac: Remove wctype in libw check.
> 	(_MSE_INT_H): Don't define on Solaris 7-9.
> 	<solaris*>: 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.

OK for the NEWS part.

Thanks.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation]
  2017-09-26 14:21                 ` Pedro Alves
@ 2017-10-03 13:01                   ` Rainer Orth
  0 siblings, 0 replies; 18+ messages in thread
From: Rainer Orth @ 2017-10-03 13:01 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Hi Pedro,

> On 09/26/2017 03:18 PM, Pedro Alves wrote:
>> 
>> On 09/26/2017 12:20 PM, Rainer Orth wrote:
>>>
>>> Testing is very weird, though: Linux/x86_64 only shows a few failures,
>>> but Solaris is a mess: on Solaris 10, the vast majority of tests time
>>> out (although gdb seems to work reasonably well interactively), while
>>> many more work on Solaris 11.4 until testing runs into what seems an
>>> infinite loop of
>>>
>>> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1:
>>> run failure detected (timeout)
>> 
>> I recall once trying to run the testsuite on OpenSolaris
>> (several years ago, maybe 2008.11, though I don't really
>> recall exactly), and running into lots and lots of timeouts.
>> I think it had something to do with gdb + expect + dejagnu not
>> agreeing over end lines, \r\n vs \n, etc.  ISTR trying to
>> work around it with stty settings.  
>> 
>> I'm having trouble finding the email in the archives, though.
>
> Bah, I was looking in the wrong list, that's why...
>
> Here it is:
>  https://sourceware.org/ml/gdb/2008-07/msg00292.html
> and the workaround:
>  https://sourceware.org/ml/gdb/2008-08/msg00144.html

thanks for looking this up.  However, further digging revealed that the
issue is slightly different for me.  When I run a single testcase
(alias.exp), gdb.log shows

(gdb) ^M^[[K(gdb) alias -a set2=set^M
(gdb) ^M^[[K(gdb) FAIL: gdb.base/alias.exp: alias -a set2=set (timeout)

i.e. I get clr_eol/el (clear to end of line) after the prompt which
confuses the test framework.  I haven't yet found what causes this.
However, I managed to hack around the issue for testing purposes by
configuring with --disable-tui: this way at least a vast majority of the
tests PASS.

The same issue still happens when I use a locally built libncurses 5.7
instead of the native libcurses.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-10-03 13:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-21 13:02 Fix gdb 8.1 Solaris compilation Rainer Orth
2017-09-21 13:17 ` Andreas Schwab
2017-09-21 14:14   ` Rainer Orth
2017-09-21 14:31     ` Obsolete/remove Solaris < 10 [was: Re: Fix gdb 8.1 Solaris compilation] Rainer Orth
2017-09-21 14:39       ` Pedro Alves
2017-09-22 14:45         ` Rainer Orth
2017-09-22 15:40           ` Pedro Alves
2017-09-26 11:20             ` Rainer Orth
2017-09-26 11:26               ` Pedro Alves
2017-09-26 13:25                 ` Rainer Orth
2017-09-26 13:45                   ` Pedro Alves
2017-09-26 13:55                     ` Rainer Orth
2017-09-26 14:18               ` Pedro Alves
2017-09-26 14:21                 ` Pedro Alves
2017-10-03 13:01                   ` Rainer Orth
2017-09-29 11:53               ` Eli Zaretskii
2017-09-21 14:21 ` Fix gdb 8.1 Solaris compilation Pedro Alves
2017-09-21 14:23   ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).