Debugging RPC under VAX/VMS

# Hints on debugging

If you want to debug a client program, you can run it with the VAX/VMS debugger, just as you would a normal program.

When you run a VMS image with the debugger, when using FORTRAN in the main program, you get a warning because VMS will initialise the stubs before the main program runs. DEBUG says that it is at the beginning of the initialisation code, and suggests you type "GO" to get to the start of the main program. When you do, the stub initialisation code will run.

This involves the setting up of connections to the other parts of the distributed system, which may fail. If it does, the exit status should tell you why. For more details use the trace ($TRON command) to see what it's trying to do when it fails.

If you want to debug the server and the client at the same time, then you must make (one or the other) declare a decnet object name, and make the other access it. Run the one declaring the DECNET object first, then run the second one. You'll need SYSNAM privilege. The following should work:

    	Terminal A

    		$ define rpc_client_name *xload.decnet
    		$ tron
    		$ run/debug myserver

    	Terminal B

    		$ define xload "vxcern""user pass""::""0=xload""
    		$ tron
    		$ run/debug myclient

## No need to run the server "by hand" on VAXstation

If you have a VAXstation you may do even better. If you make your server command file look like this:

    		$ define rpc_client_name SYS$NET.decnet
    		$ DEFINE DBG$OUTPUT WTA0:
    		$ tron
    		$ run/debug myserver

then the debugger will run in its own window, even if the server is started automatically by a DECnet connect request. This means that you should just run your application as usual.

It works as follows: When the debugger creates its separate window, it writes an Operating System Control string (OSC) to the terminal window which makes the workstation software open the debugger window. (Provided that the system logical UIS$VT_ENABLE_OSC_STRING is equal to "TRUE".) The debugger writes to the file 'DBG$OUTPUT' in order to do this, so you may redirect it to WTA0:. WTA0: on the other hand is a template workstation window, it may pop up if you write a line to it, e.g. with the CREATE command, but if you just write an OSC string to it, it will not pop up, but the workstation software responds to the OSC string and creates the debugger window. Of course the trace goes to the NETSERVER.LOG file when you do it like this.