RFC 643
Network Debugging Protocol
Network Debugging Protocol π
Okay bestie, the title block first π This is RFC 643, called Network Debugging Protocol, written by Eric Mader and dated July 1974, with NIC #30873 on it. The title block doesn't say what it obsoletes or updates, and it doesn't list a category or status, so I'm not making any up π
The intro is giving pioneer energy π§ This protocol is for a PDP-11 network Bootstrap service and a cross-network debugger. It's built for debugging processes on an operating system that can do the "lower level" debugging stuff, like planting and removing breakpoints and single stepping β¨ If that capability isn't there (a stand-alone program, for example), you can use a subset of it π¦
It's a level 2 protocol, so it skips the ARPANET HOST-HOST protocol entirely π On TENEX it's done with special privileged system calls that send messages straight to the IMP and receive them straight from it π₯ Messages go between the PDP-11 and the remote debugger over one link, which is currently 377 octal. Messages from the remote debugger to the PDP-11 are requests asking it to do something. Messages from the PDP-11 back are either a reply to that request, or an indication that a process has stopped running (it trapped, hit a breakpoint, etc.) π The exact message format is shown in Figure 1 below.
Every command has an 8-bit op-code, an 8-bit process-id, two 16-bit arguments, and an optional string of 8-bit bytes π When the PDP-11 finishes a request successfully, its op-code matches the one the remote host sent. When it fails, it sends that same op-code with the 200 bit set β Op-codes from the PDP-11 with the 100 bit set are asynchronous, meaning a process stopped for a reason other than a request from the remote host (more on those below) β¨ An op-code from the PDP-11 with both the 100 and 200 bits set is meaningless, so don't do that π Basically, the 8-bit op-code field the PDP-11 sends back works as three things: a CAN'T Flag, an Asynchronous STOP Flag, and a 6-bit op-code π
Commands get written out like this, with only the fields that are actually used showing up:
NAME (Process-ID, Argument 1, Argument 2, BYTE STRING)
Op-Code 0 - NOP πΈ
This command checks whether the PDP-11 is operational π«Ά It doesn't affect any process running on the PDP-11. The response is:
NOP
Op-Code 1 - DEBUG (Process) π
This command asks for permission to debug the given process π If no other remote host is debugging it right now, the PDP-11 replies with:
DEBUGGING (process)
(op-code 1)
If another remote host has already been given permission to debug that process, or the process doesn't exist, the reply is:
CAN'T DEBUG (process)
(op-code 201) π
Op-Code 2 - END DEBUG (Process) π
This command gives up the ability to debug a process π¦ The PDP-11 replies:
END DEBUG (Process)
(op-code 2), unless the remote host isn't debugging that process. In that case it replies:
CAN'T END DEBUG (Process)
(op-code 202) π If the process isn't running when END DEBUG is sent, the effect should be the same as doing:
RESUME (PROCESS)
END DEBUG (PROCESS)
Op-Code 3 - STOP (Process) π
This command asks the PDP-11 to stop the given process from running π The PDP-11 replies:
STOPPED (process)
(op-code 3), unless the process isn't being debugged by the remote host. Then it replies:
CAN'T STOP (process)
(op-code 203) π
Op-Code 4 - DEPOSIT (Process, Address, Count, Byte String) π₯
This tells the PDP-11 to deposit the Count bytes from Byte String into the given process's address space, starting at Address β¨ If it works, the PDP-11 replies:
DEPOSITED (Process, Address, Count)
If the deposit doesn't succeed, or the remote host isn't debugging the process, it replies:
CAN'T DEPOSIT (Process, Address, Count)
Op-Code 5 - RESUME (Process) βΆοΈ
This tells the PDP-11 to let the given process keep running π The PDP-11 should reply:
RESUMED (Process)
before it actually starts the process, just in case the process traps right away π If the process wasn't stopped, or the remote host isn't debugging it, the reply is:
CAN'T RESUME (Process)
Op-Code 6 - EXAMINE (Process, Address, Count) π
This tells the PDP-11 to send back Count bytes from the given process's address space, starting at Address π§ If it can supply the bytes, it replies:
CONTENTS (Process, Address, Count, Byte String)
If all of those bytes don't exist in the address space, or the remote host isn't debugging the process, it replies:
CAN'T EXAMINE (Process, Address, Count)
Op-Code 7 - DEPOSIT STATE VECTOR (Process, Index, Byte Count, Byte String) π§©
This tells the PDP-11 to deposit the Byte Count bytes from Byte String into the state vector for the given process, starting at byte Index π See Figure 2 for the format of the state vector. The PDP-11 replies:
DEPOSITED STATE VECTOR (Process, Index, Byte Count)
unless the bytes won't all fit in the state vector, or the remote host isn't debugging the process. In that case the reply is:
CAN'T DEPOSIT STATE VECTOR (Process, Index, Byte Count)
Op-Code 10 - BREAK (Process, Address, Proceed Count) π΄
This tells the PDP-11 to place a breakpoint at Address in the given process's address space, with a proceed count of Proceed Count β¨ You can change the proceed count by sending another BREAK with a different count π If the breakpoint gets planted, the PDP-11 replies:
BROKE (Process, Address, Proceed Count)
If it can't plant the breakpoint, because the breakpoint tables for the process are full, or because the remote host isn't debugging the process, the reply is:
CAN'T BREAK (Proceed, Address, Proceed Count)
The PDP-11 must keep track of where the breakpoints are, the old contents of those locations, and so on. This is a big deal, so don't skip it π«Ά
Op-Code 11 - UNBREAK (Process, Address) π§Ή
This tells the PDP-11 to remove the breakpoint at Address in the process's address space, and to release all the storage tied to it π When the breakpoint is removed, the PDP-11 replies:
UNBROKE (Process, Address)
If the process doesn't have a breakpoint at Address, or the remote host isn't debugging the process, the reply is:
CAN'T UNBREAK (Process, Address)
Op-Code 12 - SINGLE STEP (Process) π£
This tells the PDP-11 to let the given process execute one instruction, using the Trace Trap feature π¦ The PDP-11 replies:
SINGLE STEPPING (Process)
before the process is started. If the process is already running, or the remote host isn't debugging it, the reply is:
CAN'T SINGLE STEP (Process)
Op-Code 13 - PROCEED BPT (Process) βοΈ
This tells the PDP-11 to let the process carry on from a breakpoint trap (BPT, see below) π The PDP-11 replies:
PROCEEDING BPT (Process)
before it lets the process proceed. If the process isn't stopped at a breakpoint, or the remote host isn't debugging it, the reply is:
CAN'T PROCEED BPT (Process)
Op-Code 14 - CREATE PROCESS π±
This tells the PDP-11 to create a process, with its own virtual address space if the system supports that feature β¨ If it can create the process, the PDP-11 replies with the process-id in process:
CREATED PROCESS (Process)
If the process creation fails, or the system can't create processes, the PDP-11 replies:
CAN'T CREATE PROCESS.
Once a remote host has created a process, it's already debugging that process, so there's no need to send:
DEBUG (process)
Op-Code 15 - DESTROY PROCESS (Process) π₯
This tells the PDP-11 to destroy the given process π« Once the process is destroyed, the remote host obviously can't debug it anymore, so there's no need to send:
END DEBUG (Process).
The PDP-11 replies:
DESTROYED PROCESS (Process)
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 replies:
CAN'T DESTROY PROCESS (Process).
Asynchronous Stop Replies β‘
These replies have op-codes between 100 and 177 octal π₯ The PDP-11 sends them whenever a process being debugged stops running for any reason other than a response to:
STOP (Process)
Every one of these replies includes the entire state vector for the process π§
Op-Code 100 - TRAP (Process, Reason, 0, STATE VECTOR) π¨
This tells the remote host that a process has "trapped", or terminated abnormally π± The Reason is a system error code. In the stand-alone case, it could be a trap vector address instead.
Op-Code 101 - HALT (Process, 0,0, STATE VECTOR) π
This tells the remote host that the given process has terminated normally β
Op-Code 102 - BPT (Process, 0, 0, STATE VECTOR) π΄
This tells the remote host that the given process has hit a breakpoint trap π―
Op-Code 103 - TTRAP (Process, 0, 0, STATE VECTOR) π£
This tells the remote host that the given process has hit a trace trap. In other words, it has just executed one instruction in response to:
SINGLE STEP (Process)
command. π okay so this is where the message format shows up, and it's giving organized π
Every debugger message is laid out like this:
Figure 1
FORMAT OF NETWORK DEBUGGER MESSAGES
----------------
| TYPE | HOST |
----------------
| LINK | STYPE |
----------------
| CMD | PID |
----------------
| ARG1 |
----------------
| ARG2 |
----------------
Here's what each field does, bestie π§
TYPEis the HOST-IMP/IMP-HOST message type, and it should always be zero πHOSTis the source host ID πΈLINKis the debugger link πSTYPEis the message subtype, and it's always zero πCMDis the debugger command op-code. Asynchronous replies get the op-code plus an excess of 100, and "can't" replies get it plus an excess of 200. So the reply is literally just the same op-code with a little number on top πβ¨PIDis the process ID of the process being debugged π¦ARG1is the first argument of the command πARG2is the second argument of the command π«Ά
Page 8
And then the state vectors, which are giving "one big snapshot of the process" energy πΈ
Figure 2
FORMAT OF STATE VECTORS
------------
| R0 |
------------
| R1 |
------------
| R2 |
------------
| ... |
------------
| PC |
------------
| PS |
------------
The vector lists R0, R1, R2 and so on, then PC and PS at the end. Those are the registers and the state that get passed around in those TRAP, HALT, BPT and TTRAP replies. Main character energy, fr fr ππ
π¦ where this page comes from
- ietf: rfc643 1974-07
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms