Subject: Re: gdb is broken
To: Arthur Hoffmann <hoffmann@it.ntu.edu.au>
From: Andy Heffernan <ahh@netcom.com>
List: amiga-dev
Date: 09/02/1994 20:54:37
> root@atze(6)$ gdb hoffmann1         
> (gdb) break main
> Breakpoint 1 at 0x28a0: file hoffmann1.c, line 36.
> (gdb) run
> Starting program: /home/hoffmann/vogle/ass1/hoffmann-ass1/hoffmann1 
> reading register pc (#17): Invalid argument.

This is due to some bogus checks in ptrace():

*** sys_process.c-orig	Mon Aug 15 10:25:35 1994
--- sys_process.c	Tue Aug 23 17:36:22 1994
***************
*** 211,217 ****
--- 211,221 ----
  		 * that the address be int-aligned.
  		 */
  		if ((u_long)uap->addr > (ctob(UPAGES) - sizeof(int)) ||
+ #ifdef STUPID_RESTRICTION
  		    ((u_long)uap->addr & (sizeof(int) - 1)) != 0)
+ #else
+ 		    0)
+ #endif
  			return (EINVAL);
  
  		/*
***************
*** 232,238 ****
--- 236,246 ----
  		 * it won't be used for anything anyway.
  		 */
  		if ((u_long)uap->addr > (ctob(UPAGES) - sizeof(int)) ||
+ #ifdef STUPID_RESTRICTION
  		    ((u_long)uap->addr & (sizeof(int) - 1)) != 0)
+ #else
+ 		    0)
+ #endif
  			return (EINVAL);
  
  		/* And write the data. */


------------------------------------------------------------------------------