Chapter Contents

Previous

Next
SAS/C Software: Changes and Enhancements, Release 6.50


C Implementation

You can implement the program invocation exit as a C function with the following syntax:

#include <rdbgnvk.h>
int _dynamn (char *rdbg_comm_method, 
             char *rdbg_host_lu,
             char *rdbg_port_tp, 
             struct RDBG_RUNOPTS *rdbg_runopts,
             void *crabusr1_copy, 
             void *crabusr2_copy,
             void *crabusr3_copy, 
             void *crabtusr_copy)
        {
          /* exit code */
 

All arguments are input arguments, and are passed by the remote debugger when it calls the exit. The arguments correspond to the information in the parameter block and RDBGOPTS DSECT described in the previous section. 

The RDBGOPTS DSECT maps the C  struct RDBG_RUNOPTS. This structure is created from the runtime options specified when  SASCDBG is invoked, and provides access to the name of the program to be debugged, its runtime arguments, and the program invocation method (  fork,  oeattach,  ATTACH, manual). 

You can modify the information in the RDBG_RUNOPTS struct to affect later debugger invocation processing. You can also modify the copies of the CRAB user words. When the program invocation exit returns, the new values will be copied into the debugger's CRAB. 

The header file , shown in Remote Debugger Header File , is stored in sasc.MACLIBC, and defines the prototype for the program invocation exit and the  RDBG_RUNOPTS structure. It also defines the return code constants  RDBG_CONTINUE_RC,  RDBG_SUPRESS_MSG_RC,  RDBG_SUPRESS_DBGINVOKE_RC, and  RDBG_FAIL_RC. The program invocation exit must return one of these values, as described in Return Codes .

Remote Debugger Header File

#ifndef _RDBGNVK
#define _RDBGNVK
/*
 * This header file defines the prototypes and options struct passed
 * to the L$UDBNVK remote debugger user exit which can be used to
 * start the application to be debugged by the remote debugger.
 */
/* Prototype for exit function */
int l$udbnvk(char *rdbg_comm_method, char *rdbg_host_lu,
             char *rdbg_port_tp, struct RDBG_RUNOPTS *rdbg_runopts,
             void *crabusr1, void *crabusr2, void *crabusr3,
             void *crabtusr);
/* Define return codes for l$udbnvk */
#define RDBG_CONTINUE_RC 0
#define RDBG_SUPRESS_MSG_RC 4
#define RDBG_SUPRESS_DBGINVOKE_RC 8
#define RDBG_FAIL_RC 12
/* Define options struct passed to l$udbnvk exit */
struct RDBG_RUNOPTS
{
 char *pgm_name;    /* Name of program to be invoked                */
 char **pgm_args;   /* Runtime arguments to be passed to program    */
 char optresv[2];
 char optflag;
#define RDBG_SUPPRESS_D 1 /* Suppress auto. =D option insertion     */
#define RDBG_DBTERM_NO  2 /* Turn off Posix Terminal I/O Intercepts */
 char invoke_method; /* Requested invocation method for program     */
#define RDBG_MANUAL   0
#define RDBG_FORK     1
#define RDBG_OEATTACH 2
#define RDBG_ATTACH   3
;
#endif


Chapter Contents

Previous

Next

Top of Page

Copyright © Mon Mar 9 09:11:22 EST 1998 by SAS Institute Inc., Cary, NC, USA. All rights reserved.