This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

[5.1] Re: [RFA] kill command does not kill on HPUX


> On HPUX, it seems that the kill command is unable to kill the program
> being debugged. I tried with a simple hello world program, ran it with a
> breakpoint on main, and then issued the "kill" command. The process was
> still there.

I take it it was HP/UX 11.0.

> The cause seems to be in infttrace.c, where we send the TT_PROC_STOP
> request to the inferior. According to the man page, this request just
> stops the process, but does not kill it. Still according to the man
> page, a more appropriate request would be TT_PROC_EXIT. I am therefore
> suggesting the following change:
> 
> 2001-09-08  J. Brobecker <brobecker@gnat.com>
> 
> * infttrace.c (kill_inferior): Issue a TT_PROC_EXIT request rather
>         than a TT_PROC_STOP request to kill the inferior and its child
>         processes. Otherwise, the inferior is not killed on HPUX 11.0.
>         Removed the code that detaches the child processes since we just
>         killed them.

(There is no HP/UX maintainer)  So, this ``obvious'' change is ok for 
both the trunk and (if you think it is worth it) 5.1 branch.

thanks for this,
Andrew

> <<
> Index: infttrace.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/infttrace.c,v
> retrieving revision 1.15
> diff -c -3 -p -r1.15 infttrace.c
> *** infttrace.c	2001/07/28 22:44:53	1.15
> --- infttrace.c	2001/09/08 14:44:15
> *************** kill_inferior (void)
> *** 3853,3879 ****
>   
>         if (t->am_pseudo && (t->pid != PIDGET (inferior_ptid)))
>   	{
> ! 	  /* TT_PROC_STOP doesn't require a subsequent ttrace_wait, as it
> ! 	   * generates no event.
> ! 	   */
> ! 	  call_ttrace (TT_PROC_STOP,
>   		       t->pid,
>   		       TT_NIL,
>   		       TT_NIL,
>   		       TT_NIL);
> - 
> - 	  call_ttrace (TT_PROC_DETACH,
> - 		       t->pid,
> - 		       TT_NIL,
> - 		       (TTRACE_ARG_TYPE) TARGET_SIGNAL_0,
> - 		       TT_NIL);
>   	}
>         t = t->next;
>       }
>   
>     xfree (paranoia);
>   
> !   call_ttrace (TT_PROC_STOP,
>   	       PIDGET (inferior_ptid),
>   	       TT_NIL,
>   	       TT_NIL,
> --- 3853,3870 ----
>   
>         if (t->am_pseudo && (t->pid != PIDGET (inferior_ptid)))
>   	{
> ! 	  call_ttrace (TT_PROC_EXIT,
>   		       t->pid,
>   		       TT_NIL,
>   		       TT_NIL,
>   		       TT_NIL);
>   	}
>         t = t->next;
>       }
>   
>     xfree (paranoia);
>   
> !   call_ttrace (TT_PROC_EXIT,
>   	       PIDGET (inferior_ptid),
>   	       TT_NIL,
>   	       TT_NIL,
> 
>>>
> 
> 
> -- Joel
> 



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