XPRMdbg_runmod
| XPRMdbg_runmod | 
  Purpose
 
  Synopsis
 
int XPRMdbg_runmod(XPRMmodel model, int *returned, const char *parlist, int (MM_RTC *dbgcb)(void *dctx, int vmstat, int lndx), void *dbgctx);
 
  Arguments
 
| 
     model 
     | 
     Reference to a model
     | 
| 
     returned 
     | 
     Pointer to an area where the result value is returned
     | 
| 
     parlist 
     | 
     String composed of model parameter initializations separated by commas, may be
     NULL
     | 
| 
     dbgcb 
     | 
     user defined debugger callback
     | 
| 
     dbgctx 
     | 
     debug context: it is used as the first argument of
     dbgcb
     | 
  Return value
 
| 
     XPRM_RT_OK 
     | |
| 
     XPRM_RT_ERROR 
     | |
| 
     XPRM_RT_MATHERR 
     | |
| 
     XPRM_RT_IOERR 
     | |
| 
     XPRM_RT_STOP 
     | 
  Further information
 
 1. The parameter
 parlist may be used to initialize the model parameters of the model/program (
 e.g.
 "PAR1=12,PAR2='tutu'"). The parameter
 returned receives the result of the execution (
 e.g. parameter value of the ``exit'' procedure). The bit
 XPRM_RT_STOP is set if the execution of the model has been interrupted by a call to the function
 XPRMstoprunmod.
 
 2. If the function pointer
 dbgcb if
 NULL
 XPRMdbg_runmod behaves like
 XPRMisrunmod; otherwise function
 dbgcb is called whenever the model is interrupted (breakpoint, error or function
 XPRMstoprunmod called). The first argument,
 dctx, is the value of
 dbgctx; the second,
 vmstat, is the virtual machine status (
 i.e.
 XPRM_RT_*) and the last argument,
 lndx, is the line index corresponding to the statement being executed (asynchronous interruption) or to be executed (breakpoint). In this context the virtual machine status may take value
 XPRM_RT_BREAK
  if interruption is due to a breakpoint and value
 XPRM_RT_NIFCT
  if the program was executing a native function when interruption occurred.
 
 3. If a breakpoint at line
 -1 has been set (see
 XPRMdbg_setbrkp) the debugger callback
 dbgcb is called just before program termination when no error has occurred. In this case the virtual machine status takes value
 XPRM_RT_ENDING
  for a normal termination and value
 XPRM_RT_EXIT
  if the last statement is a call to procedure
 exit.
 
 4. If the program is interrupted because of an error, the return value of
 dbgcb is ignored, otherwise it indicates how to continue execution. If
 vmstat is not
 XPRM_RT_NIFCT, the following values can be returned:
 
  
   
 
| 
      XPRM_DBG_STOP 
      | |
| 
      XPRM_DBG_NEXT 
      | |
| 
      XPRM_DBG_STEP 
      | |
| 
      XPRM_DBG_CONT 
      | |
| 
      j>0 
      | 
      stop before the statement at line index
      j
      | 
 5. If the interruption occurs during the execution of a native function (for instance when the optimizer is solving a problem),
 vmstat is
 XPRM_RT_NIFCT and execution of the function can be canceled (execution continues after the NI call) by returning
 XPRM_DBG_STOP (in this case the debugger callback is called again just after the native function call completes). Other values returned by
 dbgcb imply the continuation of the execution.
 
  Related topics
 
 
