This is the mail archive of the gdb-testers@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]

Re: gdb4-17.86 build issues on HP-UX 10.20 and 11.0


Ah-hah, now it works better :-).

My last patch *is* appropriate, although if you prefer you could
just ifdef out everything past the "if(!is_pa_2)" branch in
pa_register_look_aside().

The additional patch needed to make startup happen on HPUX 9.*
is to correct an oversight in hppah-nat.c: there is a semaphore
arrangement that (partially) synchronizes inferior-process startup.
The child half of it is ifdef'd out on HPUX 9 ... but the parent
half was not :-(.  Patch attached.

			regards, tom lane

*** hppah-nat.c.orig	Fri Mar 12 10:02:14 1999
--- hppah-nat.c	Sun Mar 14 23:50:34 1999
***************
*** 363,375 ****
  /* The following code is a substitute for the infttrace.c versions used
     with ttrace() in HPUX 11.  */
  
! /* This value is an arbitrary integer. */
! #define PT_VERSION 123456
  
  /* This semaphore is used to coordinate the child and parent processes
     after a fork(), and before an exec() by the child.  See
     parent_attach_all for details.  */
  
  typedef struct {
      int parent_channel[2];  /* Parent "talks" to [1], child "listens" to [0] */
      int child_channel[2];   /* Child "talks" to [1], parent "listens" to [0] */
--- 363,382 ----
  /* The following code is a substitute for the infttrace.c versions used
     with ttrace() in HPUX 11.  */
  
! /* The startup semaphore is only useful for HPUX 10.0 and later,
!    as it has no other purpose than to make the world safe for
!    require_notification_of_exec_events().  We assume we need it
!    if PT_SET_EVENT_MASK is defined. */
! #if defined(PT_SET_EVENT_MASK)
! #define USE_STARTUP_SEMAPHORE
! #endif
  
  /* This semaphore is used to coordinate the child and parent processes
     after a fork(), and before an exec() by the child.  See
     parent_attach_all for details.  */
  
+ #if defined(USE_STARTUP_SEMAPHORE)
+ 
  typedef struct {
      int parent_channel[2];  /* Parent "talks" to [1], child "listens" to [0] */
      int child_channel[2];   /* Child "talks" to [1], parent "listens" to [0] */
***************
*** 378,385 ****
--- 385,397 ----
  #define SEM_TALK (1)
  #define SEM_LISTEN (0)
  
+ /* This value is an arbitrary integer. */
+ #define PT_VERSION 123456
+ 
  static startup_semaphore_t  startup_semaphore;
  
+ #endif
+ 
  extern int parent_attach_all PARAMS ((int, PTRACE_ARG3_TYPE, int));
  
  #ifdef PT_SETTRC
***************
*** 408,424 ****
       PTRACE_ARG3_TYPE addr;
       int data;
  {
!   int pt_status = 0;
! 
    /* We need a memory home for a constant.  */
    int tc_magic_child = PT_VERSION;
    int tc_magic_parent = 0;
  
-   /* The remainder of this function is only useful for HPUX 10.0 and
-      later, as it depends upon the ability to request notification
-      of specific kinds of events by the kernel.  */
- #if defined(PT_SET_EVENT_MASK)
- 
    /* Notify the parent that we're potentially ready to exec(). */
    write (startup_semaphore.child_channel[SEM_TALK],
           &tc_magic_child,
--- 420,430 ----
       PTRACE_ARG3_TYPE addr;
       int data;
  {
! #if defined(USE_STARTUP_SEMAPHORE)
    /* We need a memory home for a constant.  */
    int tc_magic_child = PT_VERSION;
    int tc_magic_parent = 0;
  
    /* Notify the parent that we're potentially ready to exec(). */
    write (startup_semaphore.child_channel[SEM_TALK],
           &tc_magic_child,
***************
*** 671,676 ****
--- 677,683 ----
  child_acknowledge_created_inferior (pid)
      int pid;
  {
+ #if defined(USE_STARTUP_SEMAPHORE)
    /* We need a memory home for a constant.  */
    int tc_magic_parent = PT_VERSION;
    int tc_magic_child = 0;
***************
*** 711,716 ****
--- 718,724 ----
    (void) close (startup_semaphore.parent_channel[SEM_TALK]);
    (void) close (startup_semaphore.child_channel[SEM_LISTEN]);
    (void) close (startup_semaphore.child_channel[SEM_TALK]);
+ #endif
  }
  
  void
***************
*** 1026,1031 ****
--- 1034,1040 ----
  void
  pre_fork_inferior ()
  {
+ #if defined(USE_STARTUP_SEMAPHORE)
    int status;
  
    status = pipe (startup_semaphore.parent_channel);
***************
*** 1041,1046 ****
--- 1050,1056 ----
        warning ("error getting child pipe for startup semaphore");
        return;
      }
+ #endif
  }