home *** CD-ROM | disk | FTP | other *** search
/ Handbook of Infosec Terms 2.0 / Handbook_of_Infosec_Terms_Version_2.0_ISSO.iso / text / rfcs / rfc0643.txt < prev    next >
Text File  |  1996-05-07  |  13KB  |  257 lines

  1.  
  2.  
  3.  Network Debugging Protocol                          Eric Mader RFC: 643                                             July 1974 NIC #30873 
  4.  
  5.       This document describes a proposed protocol  to  be  used  in  an implementation   of   a   PDP-11   network  Bootstrap  service  and  a cross-network  debugger.   The  protocol  is  designed  for  debugging processes  running under an operating system which can perform some of the "lower level" debugging  tasks,  such  as  planting  and  removing breakpoints  and  single  stepping.  A subset of the protocol could be used if such a capability does not exist (a  stand-alone  program  for example). 
  6.  
  7.      The protocol is a level 2 protocol, which  bypasses  the  ARPANET HOST-HOST  protocol.   (This  is  implemented  on  TENEX using special privileged system calls which allow messages to be  sent  directly  to and  received  directly  from the IMP).  Messages are sent between the PDP-11 and the remote debugger on  one  link  (currently  377  octal). Each  message from the remote debugger to the PDP-ll is a request that the PDP-11 perform some action, and each message from  the  PDP-11  to the remote debugger is either a reply to that request or an indication that  a  process  has  stopped  running  (i.e.   has  trapped,  hit  a breakpoint, etc).  The exact format of the messages is shown in Figure 1 below. 
  8.  
  9.      Each  command  consists  of  an  8-bit  op-code,  and  an   8-bit process-id,  two  16-bit  arguments,  and  an optional string of 8-bit bytes.  The op-code field from the PDP-11 should be the same  as  that sent  by  the  remote  host  to  indicate successful completion of the request or be the same as that set by the remote host with the 200 bit set  to  indicate  failure to complete the request.  Op-codes from the PDP-11 which have the 100 bit set are asynchronous indication  that  a process  has stopped for a reason other than a request from the remote host.  (See description of asynchronous replies  below).   An  op-code from  the  PDP-11  with  both  the 100 and 200 bit set is meaningless. Thus, the 8-bit op-code field sent by the PDP-11 can be thought of  as a CAN'T Flag, an Asynchronous STOP Flag, and a 6-bit op-code. 
  10.  
  11.      In the description that follows the commands will be given as 
  12.  
  13.    NAME (Process-ID, Argument 1, Argument 2, BYTE STRING) with only as many of the fields present as are used. 
  14.  
  15. Op-Code 0 - NOP_______ _ _ ___ 
  16.  
  17.      This command is intended to be used to determine if the PDP-11 is operational.   It  has no effect on any process running in the PDP-11. The response is NOP. 
  18.  
  19. Op-Code 1 - DEBUG (Process)_______ _ _ _____ _________ 
  20.  
  21.      This command requests the ability to  debug  the  given  process. The PDP-11 should respond with 
  22.                                                      Page   2 
  23.  
  24.  
  25.  
  26.                      DEBUGGING (process) 
  27.  
  28. (op-code 1) if no other remote host is currently doing so, and 
  29.  
  30.                     CAN'T DEBUG (process) 
  31.  
  32. (op-code 201) if another remote host  has  been  given  permission  to debug the process, or the process doesn't exist. 
  33.  
  34. Op-Code 2 - END DEBUG (Process)_______ _ _ ___ _____ _________ 
  35.  
  36.      This command relinquishes the ability to debug  a  process.   The PDP-11 should reply 
  37.  
  38.                      END DEBUG (Process) 
  39.  
  40. (op-code 2) unless the remote host isn't  debugging  the  process,  in which case it should respond  
  41.  
  42.                   CAN'T END DEBUG (Process) 
  43.  
  44. (op-code 202).  If the process isn't running when  the  END  DEBUG  is done, then the effect should be the same as 
  45.  
  46.                       RESUME (PROCESS)                     END DEBUG (PROCESS) 
  47.  
  48. Op-Code 3 - STOP (Process)_______ _ _ ____ _________ 
  49.  
  50.      This command requests the PDP-11 to stop the given  process  from running.  The PDP-11 should respond 
  51.  
  52.                       STOPPED (process) 
  53.  
  54. (op-code 3) unless the process isn't  being  debugged  by  the  remote host.  In this case it should reply 
  55.  
  56.                     CAN'T STOP (process) 
  57.  
  58.   (op-code 203). 
  59.  
  60. Op-Code 4 - DEPOSIT (Process, Address, Count, Byte String)_______ _ _ _______ _________ ________ ______ ____ _______ 
  61.  
  62.      This instructs the PDP-11 to deposit  the  Count  bytes  in  Byte String  into  the  given process's address space beginning at Address. The PDP-11 should reply 
  63.  
  64.              DEPOSITED (Process, Address, Count) 
  65.  
  66. if successful or 
  67.  
  68.            CAN'T DEPOSIT (Process, Address, Count) 
  69.                                                      Page   3 
  70.  
  71.  
  72.  
  73. if the deposit doesn't succeed, or the remote host isn't debugging the process. 
  74.  
  75. Op-Code 5 - RESUME (Process)_______ _ _ ______ _________ 
  76.  
  77.      This instructs the PDP-11 to allow the given  process  to  resume running.  The PDP-11 should reply 
  78.  
  79.                      RESUMED (Process) 
  80.  
  81. before it starts the process (in case it traps right away), or 
  82.  
  83.                    CAN'T RESUME (Process) 
  84.  
  85. if the process wasn't stopped, or the remote host isn't debugging  the process. 
  86.  
  87. Op-Code 6 - EXAMINE (Process, Address, Count)_______ _ _ _______ _________ ________ ______ 
  88.  
  89.      This instructs the PDP-11 to return Count bytes  from  the  given process address space starting at Address.  The PDP-11 should reply 
  90.  
  91.        CONTENTS (Process, Address, Count, Byte String) 
  92.  
  93. if it can supply the bytes, or 
  94.  
  95.            CAN'T EXAMINE (Process, Address, Count) 
  96.  
  97. if all the bytes don't exist in the address space, or the remote  host isn't debugging the process. 
  98.  
  99. Op-Code 7 - DEPOSIT STATE VECTOR (Process, Index, Byte Count,_______ _ _ _______ _____ ______ _________ ______ ____ ______             Byte String)            ____ _______ 
  100.  
  101.      This instructs the PDP-11 to deposit the Byte Count bytes in Byte String  into the state vector for the given process starting with byte Index.  See Figure 2 for the format of the state vector.   The  PDP-11 should reply 
  102.  
  103.      DEPOSITED STATE VECTOR (Process, Index, Byte Count) 
  104.  
  105. unless the bytes won't all fit in the state vector or the remote  host isn't debugging the process.  In this case the reply should be 
  106.  
  107.   CAN'T DEPOSIT STATE VECTOR (Process, Index, Byte Count) 
  108.  
  109. Op-Code 10 - BREAK (Process, Address, Proceed Count)_______ __ _ _____ _________ ________ _______ ______ 
  110.  
  111.      This instructs the PDP-11 to place a breakpoint at Address in the given  process's address space, with a proceed count of Proceed Count. The proceed count can be changed by issuing another BREAK with a different count.  The PDP-11 should reply 
  112.                                                      Page   4  
  113.  
  114.             BROKE (Process, Address, Proceed Count) 
  115.  
  116. if it was able to plant the breakpoint and 
  117.  
  118.         CAN'T BREAK (Proceed, Address, Proceed Count) 
  119.  
  120. if it was unable to plant the breakpoint because the breakpoint tables for  the  process are full, or because the remote host isn't debugging the process.  Note that the  PDP-11  must  keep  track  of  where  the breakpoints are, the old contents of these locations etc. 
  121.  
  122. Op-Code 11 - UNBREAK (Process, Address)_______ __ _ _______ _________ ________ 
  123.  
  124.      This instructs the PDP-11 to remove the breakpoint  from  Address in the process's address space and release all storage associated with it.  The PDP-11 should reply 
  125.  
  126.                  UNBROKE (Process, Address) 
  127.  
  128. when the breakpoint is removed, or 
  129.  
  130.               CAN'T UNBREAK (Process, Address) 
  131.  
  132. if the process doens't have a breakpoint at Address or the remote host isn't debugging the process. 
  133.  
  134. Op-Code 12 - SINGLE STEP (Process)_______ __ _ ______ ____ _________ 
  135.  
  136.      This instructs the PDP-11 to let the given  process  execute  one instruction, using the Trace Trap feature.  The PDP-11 should reply 
  137.  
  138.                   SINGLE STEPPING (Process) 
  139.  
  140. before the process is started, or 
  141.  
  142.                  CAN'T SINGLE STEP (Process) 
  143.  
  144. if the process is already running or the remote host  isn't  debugging the process. 
  145.  
  146. Op-Code 13 - PROCEED BPT (Process)_______ __ _ _______ ___ _________ 
  147.  
  148.      This instructs the PDP-11 to allow the process to proceed from  a break point trap (BPT, see below).  The PDP-11 should reply 
  149.  
  150.                   PROCEEDING BPT (Process) 
  151.  
  152. before allowing the process to proceed, or 
  153.  
  154.                  CAN'T PROCEED BPT (Process) 
  155.  
  156. if the process isn't stopped at a breakpoint or the remote host  isn't debugging the process. 
  157.                                                      Page   5 
  158.  
  159.  
  160.  
  161. Op-Code 14 - CREATE PROCESS_______ __ _ ______ _______ 
  162.  
  163.      This instructs the PDP-11 to  create  a  process  (with  its  own virtual address space if the system will support such a feature).  The PDP-11 should reply 
  164.  
  165.                   CREATED PROCESS (Process) 
  166.  
  167. if it could create a process, with the process-id in process.  If  the process  creation  failed  or  the system cannot create processes, the PDP-11 should reply 
  168.  
  169.                     CAN'T CREATE PROCESS. 
  170.  
  171. Once a remote host has created a process it is debugging it, that is a 
  172.  
  173.                        DEBUG (process) 
  174.  
  175. need not be done. 
  176.  
  177. Op-Code 15 - DESTROY PROCESS (Process)_______ __ _ _______ _______ _________ 
  178.  
  179.      This instructs the PDP-11 to destroy the  given  process.   After the  process  is destroyed the remote host cannot, of course, debug it so there is no need to do an 
  180.  
  181.                     END DEBUG (Process). 
  182.  
  183. The PDP-11 should reply 
  184.  
  185.                  DESTROYED PROCESS (Process) 
  186.  
  187. if the process has been destroyed.  If the system  doesn't  support  a multi-process structure or the remote host isn't debugging the process the PDP-11 should reply 
  188.  
  189.               CAN'T DESTROY PROCESS (Process). 
  190.  
  191.  
  192.  
  193.                   Asynchronous Stop Replies                 ____________ ____ _______ 
  194.  
  195.      These replies (op-code between 100 and 177 octal) are sent by the PDP-11  wherever a process being debugged stops running for any reason other than in response to the 
  196.  
  197.                        STOP (Process) 
  198.  
  199. command.  Each of these replies includes the entire state  vector  for the process. 
  200.                                                      Page   6 
  201.  
  202.  
  203.  
  204. Op-Code 100 - TRAP (Process, Reason, 0, STATE VECTOR)_______ ___ _ ____ _________ _______ __ _____ _______ 
  205.  
  206.      This informs the remote host that a  process  has  "trapped",  or terminated abnormally.  The reason is a system error code, or could be a trap vector address in the stand-alone case. 
  207.  
  208. Op-Code 101 - HALT (Process, 0,0, STATE VECTOR)_______ ___ _ ____ _________ ____ _____ _______ 
  209.  
  210.      This  informs  the  remote  host  that  the  given  process   has terminated normally.   
  211.  
  212. Op-Code 102 - BPT (Process, 0, 0, STATE VECTOR)_______ ___ _ ___ _________ __ __ _____ _______ 
  213.  
  214.      This informs the remote host that the given  process  has  hit  a breakpoint trap. 
  215.  
  216. Op-Code 103 - TTRAP (Process, 0, 0, STATE VECTOR)_______ ___ _ _____ _________ __ __ _____ _______ 
  217.  
  218.      This informs the remote host that the given  process  has  hit  a trace trap, i.e.  has just executed one instruction in response to the 
  219.  
  220.                     SINGLE STEP (Process) 
  221.  
  222. command. 
  223.                                                      Page   7 
  224.  
  225.                            Figure 1 
  226.  
  227.              FORMAT OF NETWORK DEBUGGER MESSAGES 
  228.  
  229.                      ----------------                    | TYPE | HOST    |                     ----------------                    | LINK | STYPE   |                     ----------------                    | CMD  |  PID    |                     ----------------                    |    ARG1        |                     ----------------                    |    ARG2        |                     ---------------- 
  230.  
  231.      TYPE -- The HOST-IMP/IMP-HOST message type, should              always be zero. 
  232.  
  233.      HOST -- The source host ID. 
  234.  
  235.      LINK -- The debugger link. 
  236.  
  237.     STYPE -- The message subtype, always zero. 
  238.  
  239.       CMD -- The debugger command op-code, excess 100 for              asynchronous reply's, excess 200 for "can't"              reply's. 
  240.  
  241.       PID -- Process ID of process being debugged. 
  242.  
  243.      ARG1 -- The first argument of the command. 
  244.  
  245.      ARG2 -- The second argument of the command. 
  246.  
  247.  
  248.                                                   Page 8 
  249.  
  250.  
  251.  
  252.                            Figure 2 
  253.  
  254.                   FORMAT OF STATE VECTORS 
  255.  
  256.                       ------------                      |    R0      |                       ------------                      |    R1      |                       ------------                      |    R2      |                       ------------                      |   ...      |                       ------------                      |    PC      |                       ------------                      |    PS      |                       ------------ 
  257.