Subject: Re: bug!
To: Chuck Cranor <chuck@maria.wustl.edu>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
List: port-sparc
Date: 02/08/1995 18:39:24
> i'm not sure how this is supposed to fit in with sparc hardware which
> doesn't support single instruction stepping in hardware...

It's not.  Have you ever played Paranoia?  "sys_process.c got cleaned
very thoroughly."  8-)

fix below; just checked in.


chris
===================================================================
RCS file: /b/source/CVS/src/sys/kern/sys_process.c,v
retrieving revision 1.45
diff -c -r1.45 sys_process.c
*** 1.45	1995/02/03 11:36:01
--- sys_process.c	1995/02/08 23:36:18
***************
*** 87,93 ****
  	struct proc *t;				/* target process */
  	struct uio uio;
  	struct iovec iov;
! 	int error, write;
  
  	/* "A foolish consistency..." XXX */
  	if (SCARG(uap, req) == PT_TRACE_ME)
--- 87,93 ----
  	struct proc *t;				/* target process */
  	struct uio uio;
  	struct iovec iov;
! 	int error, step, write;
  
  	/* "A foolish consistency..." XXX */
  	if (SCARG(uap, req) == PT_TRACE_ME)
***************
*** 178,184 ****
  	FIX_SSTEP(t);
  
  	/* Now do the operation. */
! 	write = 0;
  	*retval = 0;
  
  	switch (SCARG(uap, req)) {
--- 178,184 ----
  	FIX_SSTEP(t);
  
  	/* Now do the operation. */
! 	step = write = 0;
  	*retval = 0;
  
  	switch (SCARG(uap, req)) {
***************
*** 214,219 ****
--- 214,220 ----
  		 * as soon as possible after execution of at least one
  		 * instruction, execution stops again. [ ... ]"
  		 */
+ 		step = 1;
  #endif
  	case  PT_CONTINUE:
  	case  PT_DETACH:
***************
*** 221,233 ****
  		 * From the 4.4BSD PRM:
  		 * "The data argument is taken as a signal number and the
  		 * child's execution continues at location addr as if it
! 		 * incurred that signal.  Nromally the signal number will
  		 * be either 0 to indicate that the signal that caused the
  		 * stop should be ignored, or that value fetched out of
  		 * the process's image indicating which signal caused
  		 * the stop.  If addr is (int *)1 then execution continues
  		 * from where it stopped."
  		 */
  
  		/* Check that the data is a valid signal number or zero. */
  		if (SCARG(uap, data) < 0 || SCARG(uap, data) >= NSIG)
--- 222,235 ----
  		 * From the 4.4BSD PRM:
  		 * "The data argument is taken as a signal number and the
  		 * child's execution continues at location addr as if it
! 		 * incurred that signal.  Normally the signal number will
  		 * be either 0 to indicate that the signal that caused the
  		 * stop should be ignored, or that value fetched out of
  		 * the process's image indicating which signal caused
  		 * the stop.  If addr is (int *)1 then execution continues
  		 * from where it stopped."
  		 */
+ 		/* step = 0 done above. */
  
  		/* Check that the data is a valid signal number or zero. */
  		if (SCARG(uap, data) < 0 || SCARG(uap, data) >= NSIG)
***************
*** 236,242 ****
  		/*
  		 * Arrange for a single-step, if that's requested and possible.
  		 */
! 		if (error = process_sstep(t, SCARG(uap, req) == PT_STEP))
  			return (error);
  
  		/* If the address paramter is not (int *)1, set the pc. */
--- 238,244 ----
  		/*
  		 * Arrange for a single-step, if that's requested and possible.
  		 */
! 		if (error = process_sstep(t, step))
  			return (error);
  
  		/* If the address paramter is not (int *)1, set the pc. */