From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 9-NOV-1989 01:04 To: MRGATE::"ARISIA::EVERHART" Subj: Re: Debugging symbionts Message-Id: <8911090548.AA13040@crdgw1.ge.com> Received: From NSFNET-RELAY.AC.UK by CRVAX.SRI.COM with TCP; Wed, 8 NOV 89 20:13:31 PST Received: from ncdlab.ulcc.ac.uk by vax.NSFnet-Relay.AC.UK via Janet with NIFTP id aa09653; 8 Nov 89 16:50 GMT Date: Wed, 8 Nov 89 16:50 BST From: Nick de Smith <"PSI%JANET.000000000040::NICK%ncdlab.ulcc.ac.uk"@NSFnet-Relay.AC.UK> To: INFO-VAX <@NSFnet-Relay.AC.UK:INFO-VAX@crvax.sri.com> Subject: Re: Debugging symbionts From: "Nick de Smith, Special Systems Group, Applied Telematics" Organization: Applied Telematics Group Ltd. Sender: nick@ncdlab.ulcc.ac.uk I have tried to mail "mil.navy.nwc::fidler.decnet::levine" direct, to no avail. I therefore post this... > I have gotten quite a bit of feed back on how to debug a user modified > print symbiont under VMS 5.2, however none of them help me in getting the > debugger to come up on the designated terminal. Try this... Check: 1) That the DBG$INPUT and DBG$OUTPUT are defined /SYSTEM 2) That you have remembered the ":" on the end of the device name. 3) That the device protection for target terminal for DEBUG has RWLP protection access for the symbiont process. I tend to either give the symbiont BYPASS+LOG_IO+PHY_IO, or to use a $ SET PROTECTION=W:RWLP /DEVICE DBG$INPUT and $ SET PROTECTION=W:RWLP /DEVICE DBG$OUTPUT to ensure access. DEBUG requires the ":" on the device name, else it'll run up on a non-existant file (say, called LTA42.DAT), get an EOF, print "Normal successful completion" to SYS$OUTPUT (which is the Job Controller mailbox), and the Job Controller will, not surprisingly, complain about a bad format message. The PSM routines manual explicitly says that you must not use SYS$INPUT,SYS$OUTPUT,SYS$ERROR or SYS$COMMAND. Note that this can crash the job controller! If you use RMS to write to MBA1: (the JBC mailbox), when you close the file, RMS kindly writes a mailbox EOF for you. The JBC used to crash when this happened, but I haven't tried it recently. Almost anyone could do this. Sigh. 8-< > Is this SPR time? Probably not! > from the interactive terminal, the debugger comes right up on the target > terminal. Probably due to point 3 above (access to the device). Symbionts, by default, have very little (!!) priv. They have SETPRV and TMPMBX (I think). Any others have to be set explicitly in the symbiont initialise routine. If you run up on your terminal, the symbiont will have all your privs, which will (probably in this case) give it access to the DBG$INPUT/DBG$OUTPUT. Ho, hum... I have included an example symbiont initialise routine (in C) at the end of this message. good luck, and rgds, (-: nick :-) Reply to: NICK@NCDLAB.ULCC.AC.UK =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= | Nick de Smith | Voice: +44 892 511000 | | Applied Telematics Group Ltd | PSImail: +234213300154::NICK | | Telematics House | Fax: +44 892 38556 (G3) | | Tunbridge Wells, Kent | Telex: 95398 TELEMA G (UK) | | TN1 1DJ, England | Internet: NICK@NCDLAB.ULCC.AC.UK | | Janet: NICK@UK.AC.ULCC.NCDLAB | (NICK%NCDLAB.ULCC.AC.UK@UKACRL) | | "Though the Moon is smaller than the Earth, it is further away" | =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Example user written symbiont initialise routine... /***************************************************************************************************************** I n i t i a l i z e Initialize the symbiont. Set the required privileges and notify the job controller of our presence. Why do Americans spell "initialise" with a "z" ? *****************************************************************************************************************/ static Initialize() { long structure_level = SMBMSG$K_STRUCTURE_LEVEL; /* Version we compiled against */ void Ast_Routine(); /* AST routine to service requests */ long streams = 1; /* Single stream symbiont */ long mask[ 2 ] = { 0, 0 }; /* Bitmask of privileges to set */ #define setbit( mask, bit ) (mask[ (bit) / 32 ] |= 1 << ((bit) & 31)) /* Set a bit in the specified mask */ setbit( mask, PRV$V_OPER ); /* We want OPER... */ setbit( mask, PRV$V_WORLD ); /* ...and WORLD privileges */ #ifdef TESTING setbit( mask, PRV$V_BYPASS ); /* Allow DEBUG to access a terminal port */ setbit( mask, PRV$V_LOG_IO ); setbit( mask, PRV$V_PHY_IO ); #endif TESTING ss_check( SYS$SETPRV( 1, mask, 1, 0 ) ) /* Try to set privileges */ ss_check( SMB$INITIALIZE( &structure_level, Ast_Routine, &streams ) ) /* Tell the Job Controller we are here */ return SS$_NORMAL; /* Return success */ }