home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / ultrix / 8260 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  1.5 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!agate!asami
  2. From: asami@cs.Berkeley.EDU (Satoshi ASAMI)
  3. Newsgroups: comp.unix.ultrix
  4. Subject: /usr/include/sys/ptrace.h
  5. Date: 12 Nov 92 02:53:36
  6. Organization: CS Div., Dept. of EECS, UC Berkeley
  7. Lines: 23
  8. Message-ID: <ASAMI.92Nov12025336@anaconda.cs.Berkeley.EDU>
  9. References: <1992Nov11.143423.23743@prl.dec.com>
  10.     <1992Nov12.015127.837@pasteur.Berkeley.EDU>
  11. Reply-To: asami@snake.cs.berkeley.edu
  12. NNTP-Posting-Host: anaconda.cs.berkeley.edu
  13. In-reply-to: asami@cs.berkeley.edu's message of Thu, 12 Nov 1992 01:51:27 GMT
  14.  
  15. By the way, I have another question about ptrace---about the header
  16. file.  It has definitions like
  17.  
  18. #define TRAPCAUSE       SPEC_BASE+6             /* multiplex SIGTRAP cause */
  19.  
  20. which is supposed to be the third argument of
  21.  
  22.      ptrace(request, pid, addr, data)
  23.      int request, pid, *addr, data;
  24. (this copied from the manual verbatim).
  25.  
  26. My compiler (gcc) complained about wrong argument type when I gave
  27. TRAPCAUSE as the argument (SPEC_BASE is an int), and when I casted it
  28. to the right type by saying (int *) TRAPCAUSE, it converted 102 into
  29. 120 and I got "out of bounds" error.  It took me a while to figure
  30. this out!
  31.  
  32. --
  33.                                                    o o   Satoshi Asami
  34.   Form follows Function.                            ^
  35.                                                (asami@CS.Berkeley.EDU)
  36.   Tel: (510)643-2730 (home)       Computer Science Div., Dept. of EECS
  37.        (510)643-6228 (office)     University of California at Berkeley
  38.