This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[jkj@sco.com: patches & questions]


Forwarded so it is recorded in the gdb-patches log.

-----Forwarded message from "J. Kean Johnston" <jkj@sco.com>-----

Received: from hyperion.pdev.sco.com (hyperion.pdev.sco.COM [132.147.65.44])
	by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id PAA27755;
	Thu, 9 Apr 1998 15:21:46 -0700 (PDT)
Received: from localhost (26566 bytes) by hyperion.pdev.sco.com
	via sendmail with P:stdio/R:inet_hosts/T:smtp
	(sender: <jkj>) (ident <jkj> using unix)
	id <m0yNPgz-000B5lC@hyperion.pdev.sco.com>
	for <jsm@cygnus.com>; Thu, 9 Apr 1998 15:21:09 -0700 (PDT)
	(Smail-3.2.0.101 1997-Dec-17 #1 built 1998-Feb-2)
Message-ID: <19980409152109.54169@sco.com>
Date: Thu, 9 Apr 1998 15:21:09 -0700
From: "J. Kean Johnston" <jkj@sco.com>
To: jsm@cygnus.com, fnf@cygnus.com
Subject: patches & questions
Mime-Version: 1.0
X-Mailer: Mutt 0.89.1
Organization: The Santa Cruz Operation, Inc.
Content-Type: text/plain; charset=us-ascii

Hello Jason / Fred.

I am hoping that between the two of you this would be the right place
to send these patches. I tried to send them to gdb-patches but never
got my own mail back, so I dont think it made it.

I have some questions which I could really use some help on. Can you
either answer questions about GDB internals for me (specifically the
SOLIB stuff) or can you point me at the correct forum to do this?
We are REALLY close to having GDB be perfect on SCO Open Server except
for one little bug which I would like very much to see addressed before
4.17 ships.  GDB has been broken on this host due to a tiny typo since
4.15, so many people are howling for it.

Any help would be appreciated.

Kean Johnston.

diff -rcN gdb-4.16.97/ChangeLog newgdb/ChangeLog
*** gdb-4.16.97/ChangeLog	Wed Feb  4 14:26:30 1998
--- newgdb/ChangeLog	Thu Apr  9 15:13:53 1998
***************
*** 1,3 ****
--- 1,14 ----
+ 1998-04-09  J. Kean Johnston  <jkj@sco.com>
+ 
+ 	* aclocal.m4: for SCO Open Server, use -belf for native cc and -melf 
+ 	for gcc, not -belf for both.
+ 
+ 	* configure.in: Recognise i[3456]96-*-sysv5* as a valid host, and
+ 	use mh-sysv5 if specified.  Support gprof on SCO Open Server.
+ 
+ 	* ltconfig: fixed soname_spec for SCO Open Server and added correct
+ 	-h and -z text flags to the linker command line.
+ 
  Mon Feb  2 19:38:19 1998  Ian Lance Taylor  <ian@cygnus.com>
  
  	* config.sub: Add tic30 cases, and map c30 to tic30.
diff -rcN gdb-4.16.97/bfd/ChangeLog newgdb/bfd/ChangeLog
*** gdb-4.16.97/bfd/ChangeLog	Mon Mar  2 15:25:07 1998
--- newgdb/bfd/ChangeLog	Thu Apr  9 14:57:05 1998
***************
*** 1,3 ****
--- 1,11 ----
+ 1998-04-09  J. Kean Johnston  <jkj@sco.com>
+ 
+ 	* config.bfd: for SCO, in COFF mode, support ELF too.  Also add
+ 	support for SCO UnixWare 7.
+ 
+ 	* configure.host: For SVR4 and SVR5, use -shared when using gcc,
+ 	but use ld -G whenusing native tools.
+ 
  Mon Mar  2 15:23:44 1998   Richard Henderson  <rth@cygnus.com>
  
          * configure.in (COREFILE selection): Remove sparc-*-linux*.  They
diff -rcN gdb-4.16.97/bfd/aclocal.m4 newgdb/bfd/aclocal.m4
*** gdb-4.16.97/bfd/aclocal.m4	Thu Feb  5 18:13:59 1998
--- newgdb/bfd/aclocal.m4	Fri Apr  3 18:15:37 1998
***************
*** 241,247 ****
  
  *-*-sco3.2v5*)
    # On SCO OpenServer 5, we need -belf to get full-featured binaries.
!   CFLAGS="$CFLAGS -belf"
    ;;
  esac]
  
--- 241,250 ----
  
  *-*-sco3.2v5*)
    # On SCO OpenServer 5, we need -belf to get full-featured binaries.
!   case "$CC" in
!     cc*) CFLAGS="$CFLAGS -belf" ;;
!     gcc*) CFLAGS="$CFLAGS -melf" ;;
!   esac
    ;;
  esac]
  
diff -rcN gdb-4.16.97/bfd/config.bfd newgdb/bfd/config.bfd
*** gdb-4.16.97/bfd/config.bfd	Wed Feb  4 14:29:23 1998
--- newgdb/bfd/config.bfd	Mon Apr  6 08:02:28 1998
***************
*** 156,165 ****
  
    i[3456]86-*-sco3.2v5*coff)
      targ_defvec=i386coff_vec
      ;;
    i[3456]86-*-sysv4* | i[3456]86-*-unixware | i[3456]86-*-solaris2* | \
    i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | i[3456]86-*-freebsdelf* | \
!   i[3456]86-*-dgux*)
      targ_defvec=bfd_elf32_i386_vec
      targ_selvecs=i386coff_vec
      ;;
--- 156,166 ----
  
    i[3456]86-*-sco3.2v5*coff)
      targ_defvec=i386coff_vec
+     targ_selvecs=bfd_elf32_i386_vec
      ;;
    i[3456]86-*-sysv4* | i[3456]86-*-unixware | i[3456]86-*-solaris2* | \
    i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | i[3456]86-*-freebsdelf* | \
!   i[3456]86-*-dgux* | i[3456]86-*-sysv5* | i[3456]86-UnixWare*-*)
      targ_defvec=bfd_elf32_i386_vec
      targ_selvecs=i386coff_vec
      ;;
diff -rcN gdb-4.16.97/bfd/configure.host newgdb/bfd/configure.host
*** gdb-4.16.97/bfd/configure.host	Fri Oct  3 14:06:22 1997
--- newgdb/bfd/configure.host	Mon Apr  6 09:48:17 1998
***************
*** 137,144 ****
      SHLIB_CFLAGS='-shared -h $(SONAME)'
      HLDFLAGS='-R $(libdir)'
      ;;
!   *-*-sysv4*)
!     SHLIB_CFLAGS='-shared -h $(SONAME)'
      HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
      ;;
    *-*-sunos*)
--- 137,147 ----
      SHLIB_CFLAGS='-shared -h $(SONAME)'
      HLDFLAGS='-R $(libdir)'
      ;;
!   *-*-sysv4* | *-*-sysv5*)
!     case "$(CC)" in
!       gcc*) SHLIB_CFLAGS='-shared -h $(SONAME)' ;;
!       *) SHLIB_CFLAGS='-G -h $(SONAME)' ;;
!     esac
      HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
      ;;
    *-*-sunos*)
diff -rcN gdb-4.16.97/config/ChangeLog newgdb/config/ChangeLog
*** gdb-4.16.97/config/ChangeLog	Wed Feb  4 14:31:18 1998
--- newgdb/config/ChangeLog	Thu Apr  9 14:58:34 1998
***************
*** 1,3 ****
--- 1,7 ----
+ 1998-04-09  J. Kean Johnston  <jkj@sco.com>
+ 
+ 	* mh-svsv5: New file - support for SCO UnixWare 7 / SVR5.
+ 
  Thu Sep 11 16:43:27 1997  Jim Wilson  <wilson@cygnus.com>
  
  	* mh-elfalphapic, mt-elfalphapic: New files.
diff -rcN gdb-4.16.97/config/mh-sysv5 newgdb/config/mh-sysv5
*** gdb-4.16.97/config/mh-sysv5	Wed Dec 31 16:00:00 1969
--- newgdb/config/mh-sysv5	Mon Apr  6 06:59:09 1998
***************
*** 0 ****
--- 1,8 ----
+ # Define SYSV as -DSYSV if you are using a System V operating system.
+ SYSV = -DSYSV -DSVR4 -DSVR5
+ RANLIB = true
+ 
+ # The l flag generates a warning from the SVR4 archiver, remove it.
+ AR_FLAGS = cr
+ 
+ X11_EXTRA_LIBS = -lnsl
diff -rcN gdb-4.16.97/configure.in newgdb/configure.in
*** gdb-4.16.97/configure.in	Wed Feb  4 14:27:07 1998
--- newgdb/configure.in	Mon Apr  6 06:57:56 1998
***************
*** 149,154 ****
--- 149,157 ----
    mips*-*-sysv*)
      host_makefile_frag="${host_makefile_frag} config/mh-riscos"
      ;;
+   i[3456]86-*-sysv5*)
+     host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
+     ;;
    i[3456]86-*-dgux*)
      host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
      ;;
***************
*** 598,604 ****
    i[3456]86-*-sco3.2v5*)
      # The linker does not yet know about weak symbols in COFF,
      # and is not configured to handle mixed ELF and COFF.
!     noconfigdirs="$noconfigdirs gprof ld target-libgloss"
      ;;
    i[3456]86-*-sco*)
      noconfigdirs="$noconfigdirs gprof target-libgloss"
--- 601,607 ----
    i[3456]86-*-sco3.2v5*)
      # The linker does not yet know about weak symbols in COFF,
      # and is not configured to handle mixed ELF and COFF.
!     noconfigdirs="$noconfigdirs ld target-libgloss"
      ;;
    i[3456]86-*-sco*)
      noconfigdirs="$noconfigdirs gprof target-libgloss"
diff -rcN gdb-4.16.97/gdb/ChangeLog newgdb/gdb/ChangeLog
*** gdb-4.16.97/gdb/ChangeLog	Thu Apr  2 17:01:12 1998
--- newgdb/gdb/ChangeLog	Thu Apr  9 15:12:03 1998
***************
*** 1,3 ****
--- 1,17 ----
+ 1998-04-09  J. Kean Johnston  <jkj@sco.com>
+ 
+ 	* configure.host, configure.tgt: Recognise SVR5 and UnixWare 7.
+ 
+ 	* procfs.c: Added replacement macros for LWP stuff.  Fixed support 
+ 	for UnixWare / SVR4.2MP targets and any targets which use
+ 	multi-file /proc entries.
+ 
+ 	* config/i386/nm-i386sco5.h: Correct attributions.  Undefine
+ 	SOLIB_CREATE_INFERIOR_HOOK, as it causes GDB to malfunction
+ 	currently.  Add macros to enable hardware watchpoints, which are
+ 	supported on this target.  Include tm-sysv4.h to get definitions
+ 	for shared library stuff.
+ 
  Thu Apr  2 17:00:53 1998  Jason Molenda  (crash@bugshack.cygnus.com)
  
  	* Makefile.in (VERSION): Bump to 4.16.97.
diff -rcN gdb-4.16.97/gdb/config/i386/i386sco5.mh newgdb/gdb/config/i386/i386sco5.mh
*** gdb-4.16.97/gdb/config/i386/i386sco5.mh	Sun Apr  7 14:04:20 1996
--- newgdb/gdb/config/i386/i386sco5.mh	Thu Apr  9 15:04:45 1998
***************
*** 12,17 ****
  XM_CLIBS= -lPW -lsocket
  
  NAT_FILE= nm-i386sco5.h
! NATDEPFILES= infptrace.o inftarg.o fork-child.o corefile.o core-aout.o corelow.o \
! 	i386v-nat.o solib.o
  
--- 12,17 ----
  XM_CLIBS= -lPW -lsocket
  
  NAT_FILE= nm-i386sco5.h
! NATDEPFILES= infptrace.o inftarg.o fork-child.o corefile.o core-aout.o \
! 	corelow.o i386v-nat.o solib.o
  
diff -rcN gdb-4.16.97/gdb/config/i386/nm-i386sco5.h newgdb/gdb/config/i386/nm-i386sco5.h
*** gdb-4.16.97/gdb/config/i386/nm-i386sco5.h	Fri Jan 30 12:33:47 1998
--- newgdb/gdb/config/i386/nm-i386sco5.h	Thu Apr  9 14:48:26 1998
***************
*** 1,8 ****
  /* Native support for SCO OpenServer 5
     Copyright 1996, 1998 Free Software Foundation, Inc.
!    By Robert Lipe <robertl@dgii.com>. Based on 
!    work by Ian Lance Taylor <ian@cygnus.com. and 
!    Martin Walker <maw@netcom.com>.
  
  This file is part of GDB.
  
--- 1,7 ----
  /* Native support for SCO OpenServer 5
     Copyright 1996, 1998 Free Software Foundation, Inc.
!    By Robert Lipe <robertl@dgii.com>, and J. Kean Johnston <jkj@sco.com>.
!    Based on work by Ian Lance Taylor <ian@cygnus.com>.
  
  This file is part of GDB.
  
***************
*** 32,37 ****
--- 31,40 ----
  #define SVR4_SHARED_LIBS
  #include "solib.h" /* Pick up shared library support */
  
+ /* Currently we need to #undef this, as it breaks GDB in ELF mode.
+    As soon as I have figured out why this will go. */
+ #undef SOLIB_CREATE_INFERIOR_HOOK
+ 
  #define ATTACH_DETACH
  
  /* SCO, does not provide <sys/ptrace.h>.  infptrace.c does not 
***************
*** 39,41 ****
--- 42,61 ----
  
  #define PTRACE_ATTACH 10
  #define PTRACE_DETACH 11
+ 
+ /* We can also do hardware watchpoints */
+ #define TARGET_HAS_HARDWARE_WATCHPOINTS
+ #define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
+ 
+ #define HAVE_NONSTEPPABLE_WATCHPOINT
+ 
+ #define STOPPED_BY_WATCHPOINT(W)  \
+   i386_stopped_by_watchpoint (inferior_pid)
+ 
+ #define target_insert_watchpoint(addr, len, type)  \
+   i386_insert_watchpoint (inferior_pid, addr, len, 2)
+ 
+ #define target_remove_watchpoint(addr, len, type)  \
+   i386_remove_watchpoint (inferior_pid, addr, len)
+ 
+ #include "tm-sysv4.h"
diff -rcN gdb-4.16.97/gdb/configure.host newgdb/gdb/configure.host
*** gdb-4.16.97/gdb/configure.host	Mon Mar  2 15:19:06 1998
--- newgdb/gdb/configure.host	Mon Apr  6 11:31:23 1998
***************
*** 67,73 ****
  i[3456]86-*-sunos*)	gdb_host=sun386 ;;
  i[3456]86-*-sysv3.2*)	gdb_host=i386v32 ;;
  i[3456]86-*-sysv32*)	gdb_host=i386v32 ;;
! i[3456]86-*-sysv4.2MP)	gdb_host=i386v42mp ;;
  i[3456]86-*-sysv4*)	gdb_host=i386v4 ;;
  i[3456]86-*-unixware2*)	gdb_host=i386v42mp ;;
  i[3456]86-*-unixware*)	gdb_host=i386v4 ;;
--- 67,75 ----
  i[3456]86-*-sunos*)	gdb_host=sun386 ;;
  i[3456]86-*-sysv3.2*)	gdb_host=i386v32 ;;
  i[3456]86-*-sysv32*)	gdb_host=i386v32 ;;
! i[3456]86-UnixWare*-*)	gdb_host=i386v42mp ;;
! i[3456]86-*-sysv5*)	gdb_host=i386v42mp ;;
! i[3456]86-*-sysv4.2*)	gdb_host=i386v42mp ;;
  i[3456]86-*-sysv4*)	gdb_host=i386v4 ;;
  i[3456]86-*-unixware2*)	gdb_host=i386v42mp ;;
  i[3456]86-*-unixware*)	gdb_host=i386v4 ;;
diff -rcN gdb-4.16.97/gdb/configure.tgt newgdb/gdb/configure.tgt
*** gdb-4.16.97/gdb/configure.tgt	Mon Mar  2 15:19:07 1998
--- newgdb/gdb/configure.tgt	Mon Apr  6 11:31:37 1998
***************
*** 92,98 ****
  		configdirs="${configdirs} gdbserver" ;;
  i[3456]86-*-solaris*)	gdb_target=i386sol2 ;;
  i[3456]86-*-sunos*)	gdb_target=sun386 ;;
! i[3456]86-*-sysv4.2MP)	gdb_target=i386v42mp ;;
  i[3456]86-*-sysv4*)	gdb_target=i386v4 ;;
  i[3456]86-*-unixware2*)	gdb_target=i386v42mp ;;
  i[3456]86-*-unixware*)	gdb_target=i386v4 ;;
--- 92,100 ----
  		configdirs="${configdirs} gdbserver" ;;
  i[3456]86-*-solaris*)	gdb_target=i386sol2 ;;
  i[3456]86-*-sunos*)	gdb_target=sun386 ;;
! i[3456]86-UnixWare*-*)	gdb_target=i386v42mp ;;
! i[3456]86-*-sysv5*)	gdb_target=i386v42mp ;;
! i[3456]86-*-sysv4.2*)	gdb_target=i386v42mp ;;
  i[3456]86-*-sysv4*)	gdb_target=i386v4 ;;
  i[3456]86-*-unixware2*)	gdb_target=i386v42mp ;;
  i[3456]86-*-unixware*)	gdb_target=i386v4 ;;
diff -rcN gdb-4.16.97/gdb/procfs.c newgdb/gdb/procfs.c
*** gdb-4.16.97/gdb/procfs.c	Mon Jul 14 18:05:10 1997
--- newgdb/gdb/procfs.c	Mon Apr  6 09:30:04 1998
***************
*** 54,59 ****
--- 54,95 ----
  #include "gdbcore.h"
  #include "gdbthread.h"
  
+ #if !defined(SYS_lwp_create) && defined(SYS_lwpcreate)
+ # define SYS_lwp_create SYS_lwpcreate
+ #endif
+ 
+ #if !defined(SYS_lwp_exit) && defined(SYS_lwpexit)
+ # define SYS_lwp_exit SYS_lwpexit
+ #endif
+ 
+ #if !defined(SYS_lwp_wait) && defined(SYS_lwpwait)
+ # define SYS_lwp_wait SYS_lwpwait
+ #endif
+ 
+ #if !defined(SYS_lwp_self) && defined(SYS_lwpself)
+ # define SYS_lwp_self SYS_lwpself
+ #endif
+ 
+ #if !defined(SYS_lwp_info) && defined(SYS_lwpinfo)
+ # define SYS_lwp_info SYS_lwpinfo
+ #endif
+ 
+ #if !defined(SYS_lwp_private) && defined(SYS_lwpprivate)
+ # define SYS_lwp_private SYS_lwpprivate
+ #endif
+ 
+ #if !defined(SYS_lwp_kill) && defined(SYS_lwpkill)
+ # define SYS_lwp_kill SYS_lwpkill
+ #endif
+ 
+ #if !defined(SYS_lwp_suspend) && defined(SYS_lwpsuspend)
+ # define SYS_lwp_suspend SYS_lwpsuspend
+ #endif
+ 
+ #if !defined(SYS_lwp_continue) && defined(SYS_lwpcontinue)
+ # define SYS_lwp_continue SYS_lwpcontinue
+ #endif
+ 
  /* the name of the proc status struct depends on the implementation */
  #ifdef HAVE_PSTATUS_T
    typedef pstatus_t gdb_prstatus_t;
***************
*** 1689,1694 ****
--- 1725,1784 ----
  #if defined (SYS_lwp_sema_trywait)
    syscall_table[SYS_lwp_sema_trywait] = "lwp_sema_trywait";
  #endif
+ #if defined(SYS_fstatvfs64)
+   syscall_table[SYS_fstatvfs64] = "fstatvfs64";
+ #endif
+ #if defined(SYS_statvfs64)
+   syscall_table[SYS_statvfs64] = "statvfs64";
+ #endif
+ #if defined(SYS_ftruncate64)
+   syscall_table[SYS_ftruncate64] = "ftruncate64";
+ #endif
+ #if defined(SYS_truncate64)
+   syscall_table[SYS_truncate64] = "truncate64";
+ #endif
+ #if defined(SYS_getrlimit64)
+   syscall_table[SYS_getrlimit64] = "getrlimit64";
+ #endif
+ #if defined(SYS_setrlimit64)
+   syscall_table[SYS_setrlimit64] = "setrlimit64";
+ #endif
+ #if defined(SYS_lseek64)
+   syscall_table[SYS_lseek64] = "lseek64";
+ #endif
+ #if defined(SYS_mmap64)
+   syscall_table[SYS_mmap64] = "mmap64";
+ #endif
+ #if defined(SYS_pread64)
+   syscall_table[SYS_pread64] = "pread64";
+ #endif
+ #if defined(SYS_creat64)
+   syscall_table[SYS_creat64] = "creat64";
+ #endif
+ #if defined(SYS_dshmsys)
+   syscall_table[SYS_dshmsys] = "dshmsys";
+ #endif
+ #if defined(SYS_invlpg)
+   syscall_table[SYS_invlpg] = "invlpg";
+ #endif
+ #if defined(SYS_cg_ids)
+   syscall_table[SYS_cg_ids] = "cg_ids";
+ #endif
+ #if defined(SYS_cg_processors)
+   syscall_table[SYS_cg_processors] = "cg_processors";
+ #endif
+ #if defined(SYS_cg_info)
+   syscall_table[SYS_cg_info] = "cg_info";
+ #endif
+ #if defined(SYS_cg_bind)
+   syscall_table[SYS_cg_bind] = "cg_bind";
+ #endif
+ #if defined(SYS_cg_current)
+   syscall_table[SYS_cg_current] = "cg_current";
+ #endif
+ #if defined(SYS_cg_memloc)
+   syscall_table[SYS_cg_memloc] = "cg_memloc";
+ #endif
  }
  
  /*
***************
*** 1924,1930 ****
  #ifdef PROCFS_USE_READ_WRITE
    if (regno != -1)
      {
!       procfs_read_status (pi);
        memcpy ((char *) &fpreg.fpregset,
            (char *) &pi->prstatus.pr_lwp.pr_context.uc_mcontext.fpregs,
            sizeof (fpregset_t));
--- 2014,2020 ----
  #ifdef PROCFS_USE_READ_WRITE
    if (regno != -1)
      {
!       /* JKJ CHECKME procfs_read_status (pi); */
        memcpy ((char *) &fpreg.fpregset,
            (char *) &pi->prstatus.pr_lwp.pr_context.uc_mcontext.fpregs,
            sizeof (fpregset_t));
***************
*** 1975,1980 ****
--- 2065,2072 ----
  {
    struct procinfo *pi = (struct procinfo *) 
      xmalloc (sizeof (struct procinfo));
+   struct sig_ctl  sctl;
+   struct flt_ctl  fctl;
  
    memset ((char *) pi, 0, sizeof (*pi));
    if (!open_proc_file (pid, pi, O_RDWR, 1))
***************
*** 2123,2132 ****
--- 2215,2234 ----
       int *statvalp;
  {
    struct procinfo *temp_pi, *next_pi;
+   struct proc_ctl pctl;
  
+ #ifdef UNIXWARE
+   pctl.cmd = PCRUN;
+   pctl.data = PRCFAULT;
+ #else
    pi->prrun.pr_flags = PRCFAULT;
+ #endif
  
+ #ifdef PROCFS_USE_READ_WRITE
+   if (write (pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+ #else
    if (ioctl (pi->ctl_fd, PIOCRUN, &pi->prrun) != 0)
+ #endif
      perror_with_name (pi->pathname);
  
    if (attach_flag)
***************
*** 2809,2814 ****
--- 2911,2917 ----
  
  #endif	/* 0 */
  
+ #ifndef UNIXWARE
  /*
  
  LOCAL FUNCTION
***************
*** 2847,2853 ****
      }
    return (fd);
  }
! 
  
  /* Attach to process PID, then initialize for debugging it
     and wait for the trace-trap that results from attaching.  */
--- 2950,2956 ----
      }
    return (fd);
  }
! #endif
  
  /* Attach to process PID, then initialize for debugging it
     and wait for the trace-trap that results from attaching.  */
***************
*** 3065,3072 ****
  	}
        add_thread (pi->pid);
        procfs_set_inferior_syscall_traps (pi);
-     }
  #endif /* PROCFS_USE_READ_WRITE */
    attach_flag = 1;
    return (pi->pid);
  }
--- 3168,3175 ----
  	}
        add_thread (pi->pid);
        procfs_set_inferior_syscall_traps (pi);
  #endif /* PROCFS_USE_READ_WRITE */
+     }
    attach_flag = 1;
    return (pi->pid);
  }
***************
*** 3247,3253 ****
    struct procinfo *pi;
    struct proc_ctl pctl;
  
- #ifndef UNIXWARE
    if (pid != -1)		/* Non-specific process? */
      pi = NULL;
    else
--- 3350,3355 ----
***************
*** 3269,3275 ****
      for (pi = procinfo_list; pi; pi = pi->next)
        if (pi->pid == pid && pi->had_event)
  	break;
- #endif
  
    if (!pi && !checkerr)
      goto wait_again;
--- 3371,3376 ----
***************
*** 3305,3311 ****
--- 3406,3416 ----
  	  /* NOTREACHED */
  	}
      }
+ #ifdef UNIXWARE
+   else if (pi->prstatus.pr_lwp.pr_flags & (PR_STOPPED | PR_ISTOP))
+ #else
    else if (pi->prstatus.pr_flags & (PR_STOPPED | PR_ISTOP))
+ #endif
      {
  #ifdef UNIXWARE
        rtnval = pi->prstatus.pr_pid;
***************
*** 3414,3420 ****
  	    if (!procinfo->had_event)
  	      {
  #ifdef PROCFS_USE_READ_WRITE
! 		cmd = PCSTOP;
  		if (write (pi->ctl_fd, (char *) &cmd, sizeof (long)) < 0)
  		  {
  		    print_sys_errmsg (procinfo->pathname, errno);
--- 3519,3525 ----
  	    if (!procinfo->had_event)
  	      {
  #ifdef PROCFS_USE_READ_WRITE
! 		long cmd = PCSTOP;
  		if (write (pi->ctl_fd, (char *) &cmd, sizeof (long)) < 0)
  		  {
  		    print_sys_errmsg (procinfo->pathname, errno);
***************
*** 3449,3455 ****
--- 3554,3564 ----
    else
      {
        error ("PIOCWSTOP, stopped for unknown/unhandled reason, flags %#x", 
+ #ifdef UNIXWARE
+              pi->prstatus.pr_lwp.pr_flags);
+ #else
  	     pi->prstatus.pr_flags);
+ #endif
      }
  
    store_waitstatus (ourstatus, statval);
***************
*** 3725,3731 ****
  		  print_sys_errmsg (procinfo->pathname, errno);
  		  error ("PCRUN failed");
  		}
- 	      procfs_read_status (procinfo);
  #else
  	      procinfo->prrun.pr_flags &= PRSTEP;
  	      procinfo->prrun.pr_flags |= PRCFAULT | PRCSIG;
--- 3834,3839 ----
***************
*** 3752,3760 ****
  		  print_sys_errmsg (procinfo->pathname, errno);
  		  warning ("PIOCRUN failed");
  		}
  	    }
  	procfs_read_status (procinfo);
- #endif
        }
  }
  
--- 3860,3868 ----
  		  print_sys_errmsg (procinfo->pathname, errno);
  		  warning ("PIOCRUN failed");
  		}
+ #endif
  	    }
  	procfs_read_status (procinfo);
        }
  }
  
***************
*** 4794,4800 ****
--- 4902,4912 ----
        if (summary || all)
  	{
  	  info_proc_stop (pip, summary);
+ #ifdef UNIXWARE
+ 	  supply_gregset (&pip->prstatus.pr_lwp.pr_context.uc_mcontext.gregs);
+ #else
  	  supply_gregset (&pip->prstatus.pr_reg);
+ #endif
  	  printf_filtered ("PC: ");
  	  print_address (read_pc (), gdb_stdout);
  	  printf_filtered ("\n");
***************
*** 5002,5008 ****
  {
    sysset_t sysset;
    int goterr, i;
!   
    goterr = ioctl (pi->ctl_fd, PIOCGENTRY, &sysset) < 0;
  
    if (goterr && !errok)
--- 5114,5121 ----
  {
    sysset_t sysset;
    int goterr, i;
! 
! #ifndef UNIXWARE
    goterr = ioctl (pi->ctl_fd, PIOCGENTRY, &sysset) < 0;
  
    if (goterr && !errok)
***************
*** 5042,5047 ****
--- 5155,5161 ----
  	  error ("PIOCSEXIT failed");
  	}
      }
+ #endif
  
    if (!pi->syscall_handlers)
      {
***************
*** 5106,5111 ****
--- 5220,5226 ----
  {
    sysset_t sysset;
  
+ #ifndef UNIXWARE
    if (flags & PROCFS_SYSCALL_ENTRY)
      {
        if (ioctl (pi->ctl_fd, PIOCGENTRY, &sysset) < 0)
***************
*** 5141,5146 ****
--- 5256,5262 ----
  	  error ("PIOCSEXIT failed");
  	}
      }
+ #endif
  
    if (!pi->syscall_handlers)
      {
***************
*** 5210,5215 ****
--- 5326,5332 ----
  {
    int lwp_id;
    struct procinfo *childpi;
+   struct proc_ctl pctl;
  
    /* We've just detected the completion of an lwp_create system call.  Now we
       need to setup a procinfo struct for this thread, and notify the thread
***************
*** 5218,5223 ****
--- 5335,5353 ----
    /* If lwp_create failed, then nothing interesting happened.  Continue the
       process and go back to sleep. */
  
+ #ifdef UNIXWARE
+   /* Joel ... can you check this logic out please? JKJ */
+   if (pi->prstatus.pr_lwp.pr_context.uc_mcontext.gregs[R_EFL] & 1)
+     { /* _lwp_create failed */
+       pctl.cmd = PCRUN;
+       pctl.data = PRCFAULT;
+ 
+       if (write(pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+ 	perror_with_name (pi->pathname);
+ 
+       return 0;
+     }
+ #else /* UNIXWARE */
    if (pi->prstatus.pr_reg[R_PSR] & PS_FLAG_CARRY)
      {				/* _lwp_create failed */
        pi->prrun.pr_flags &= PRSTEP;
***************
*** 5228,5244 ****
--- 5358,5382 ----
  
        return 0;
      }
+ #endif
  
    /* At this point, the new thread is stopped at it's first instruction, and
       the parent is stopped at the exit from lwp_create.  */
  
    if (pi->new_child)		/* Child? */
      {				/* Yes, just continue it */
+ #ifdef UNIXWARE
+       pctl.cmd = PCRUN;
+       pctl.data = PRCFAULT;
+ 
+       if (write(pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+ #else /* UNIXWARE */
        pi->prrun.pr_flags &= PRSTEP;
        pi->prrun.pr_flags |= PRCFAULT;
  
        if ((pi->prstatus.pr_flags & PR_ISTOP)
  	  && ioctl (pi->ctl_fd, PIOCRUN, &pi->prrun) != 0)
+ #endif /* !UNIXWARE */
  	perror_with_name (pi->pathname);
  
        pi->new_child = 0;	/* No longer new */
***************
*** 5250,5256 ****
--- 5388,5398 ----
       in the child and continue the parent.  */
  
    /* Third arg is pointer to new thread id. */
+ #ifdef UNIXWARE
+   lwp_id = read_memory_integer (pi->prstatus.pr_lwp.pr_sysarg[2], sizeof (int));
+ #else
    lwp_id = read_memory_integer (pi->prstatus.pr_sysarg[2], sizeof (int));
+ #endif
  
    lwp_id = (lwp_id << 16) | PIDGET (pi->pid);
  
***************
*** 5265,5289 ****
--- 5407,5448 ----
    printf_filtered ("[New %s]\n", target_pid_to_str (lwp_id));
  
    /* Continue the parent */
+ #ifdef UNIXWARE
+   pctl.cmd = PCRUN;
+   pctl.data = PRCFAULT;
  
+   if (write(pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+ #else
    pi->prrun.pr_flags &= PRSTEP;
    pi->prrun.pr_flags |= PRCFAULT;
    if (ioctl (pi->ctl_fd, PIOCRUN, &pi->prrun) != 0)
+ #endif
      perror_with_name (pi->pathname);
  
    /* The new child may have been created in one of two states: 
       SUSPENDED or RUNNABLE.  If runnable, we will simply signal it to run.
       If suspended, we flag it to be continued later, when it has an event.  */
  
+ #ifdef UNIXWARE
+   if (childpi->prstatus.pr_lwp.pr_why == PR_SUSPENDED)
+ #else
    if (childpi->prstatus.pr_why == PR_SUSPENDED)
+ #endif
      childpi->new_child = 1;	/* Flag this as an unseen child process */
    else
      {
        /* Continue the child */
+ #ifdef UNIXWARE
+       pctl.cmd = PCRUN;
+       pctl.data = PRCFAULT;
+ 
+       if (write(pi->ctl_fd, (char *)&pctl, sizeof (struct proc_ctl)) < 0)
+ #else
        childpi->prrun.pr_flags &= PRSTEP;
        childpi->prrun.pr_flags |= PRCFAULT;
  
        if (ioctl (childpi->ctl_fd, PIOCRUN, &childpi->prrun) != 0)
+ #endif
  	perror_with_name (childpi->pathname);
      }
    return 0;
diff -rcN gdb-4.16.97/ltconfig newgdb/ltconfig
*** gdb-4.16.97/ltconfig	Wed Sep  3 12:22:03 1997
--- newgdb/ltconfig	Fri Apr  3 18:13:54 1998
***************
*** 431,436 ****
--- 431,437 ----
      pic_flag='-Kpic'
      link_static_flag='-dn'
      special_shlib_compile_flags='-belf'
+     wl="-Wl,"
      ;;
  
    solaris2*)
***************
*** 682,688 ****
      ;;
  
    sco3.2v5*)
!     archive_cmds='$LD -G -o $lib$libobjs$deplibs'
      hardcode_direct=yes
      ;;
  
--- 683,689 ----
      ;;
  
    sco3.2v5*)
!     archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
      hardcode_direct=yes
      ;;
  
***************
*** 838,844 ****
  
  sco3.2v5*)
    version_type=osf
!   soname_spec='$libname.so.$major'
    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
    shlibpath_var=LD_LIBRARY_PATH
    ;;
--- 839,845 ----
  
  sco3.2v5*)
    version_type=osf
!   soname_spec='$libdir/$libname.so.$major'
    library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
    shlibpath_var=LD_LIBRARY_PATH
    ;;
diff -rcN gdb-4.16.97/opcodes/ChangeLog newgdb/opcodes/ChangeLog
*** gdb-4.16.97/opcodes/ChangeLog	Wed Apr  1 16:23:35 1998
--- newgdb/opcodes/ChangeLog	Thu Apr  9 15:14:53 1998
***************
*** 1,3 ****
--- 1,7 ----
+ 1998-04-09  J. Kean Johnston  <jkj@sco.com>
+ 
+ 	* aclocal.m4: Only use -belf for native CC, not gcc.
+ 
  Wed Apr  1 16:20:27 1998  Ian Dall  <Ian.Dall@dsto.defence.gov.au>
  
          * ns32k-dis.c (bit_extract_simple): New function to extract bits
diff -rcN gdb-4.16.97/opcodes/aclocal.m4 newgdb/opcodes/aclocal.m4
*** gdb-4.16.97/opcodes/aclocal.m4	Thu Feb  5 18:19:16 1998
--- newgdb/opcodes/aclocal.m4	Fri Apr  3 18:30:03 1998
***************
*** 175,181 ****
  
  *-*-sco3.2v5*)
    # On SCO OpenServer 5, we need -belf to get full-featured binaries.
!   CFLAGS="$CFLAGS -belf"
    ;;
  esac]
  
--- 175,184 ----
  
  *-*-sco3.2v5*)
    # On SCO OpenServer 5, we need -belf to get full-featured binaries.
!   case "$CC" in
!     cc*) CFLAGS="$CFLAGS -belf" ;;
!     gcc*) CFLAGS="$CFLAGS -melf" ;;
!   esac
    ;;
  esac]
  

-----End of forwarded message-----