Initializing help system before first use

Debugging modules

Since modules are loaded dynamically by Mosel, it may be difficult to use a debugger for analysing the behaviour of the program. A work around consists in compiling the module as part of a simple program (static module) that initialises Mosel then executes a model (using the embeded module to debug). A debugger can be used on this program to trace the operation of the module which is not loaded dynamically any more.

Example: the following program can be used to debug the module `mymodule'.

 #include <stdlib.h>
 #include "xprm_mc.h"

 #include "mymodule.c"              /* Include the source of the module */

 int main()
 {
  int rts;

  XPRMinit();                       /* Declare the module as static */
  XPRMregstatdso("mymodule",mymodule_init);
                                    /* Execute a test model */
  XPRMexecmod("g","mymodule_test",NULL,&rts,NULL);
  return rts;
 }

The program source dsodbg.c provided with the NI examples can be used as a shell for debugging modules.


© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.