gCAD3D 2.35

../../doc/gcad_doxygen/Debugging.dox

Debug-settings-tools
Debug-functions
Debug-core-function

Debug-settings-tools

Activate debug-switch in deb.mak with: DEB = 1
- results in deb.umak with: CPDEB = -DDEB
Check debug-switch (startup-message "Debug-switch DDEB is ON|OFF")
//----------------------------------------------------------
AP_debug__ ("func xy"); // stop in debugger and display message
// stop in debugger with keycode Alt shift x
//----------------------------------------------------------
// using -DDEB
#ifdef DEB
..
#endif
//----------------------------------------------------------
// Write into file <tempDir>/debug.dat:
// (not active if -DDEB is not ON)
AP_deb_stat (1); // open debugfile
printd .. // print into debugfile
AP_deb_stat (0); // close debugfile

Debug-functions

#include "../xa/xa.h" // printd
// start debugging (following prints -> debug-file)
// print into debug-file
printd (" debugfile = %sdebug.dat\n",OS_get_tmp_dir());
// block of debug-messages
#ifdef DEB
for(i1=0;i1<i1; ++i1)
printd("tab[%d]=%d\n",i1,ia[i1]);
#endif
// stop debugging (following prints -> console)
printd (" this text will be skipped ..\n");
// check debugfile: vi ~/gCAD3D/tmp/debug.dat
AP_debug__ ("func xx"); // stop in debugmode;
// must start with "gdb gCAD3D.exe -x gCAD3D.gdb"

Debug-core-function

  • only for Linux, not MS-Win
  • start gcad with parameter "testdll"
    • this sets AP_stat.tstDllStat to value 1
    • <bindir>/testdll.so will be loaded
  • all funcs in dll will be loaded.
  • BUT CANNOT close,recompile,reOpen this dll !!
Variables:
AP_stat.tstDllStat // 0=normal (OFF); 1=testdll_ON
Functions:
AP_testdll__ // recompile / reload testdll.so DOES NOT WORK !
Files:
../APP/testdll.c
../APP/testdll.mak