DEBUGPRINT function (#include "genUtil.h")
Example
If you begin to debug programs,
#define DEBUG
#include "genUtil.h"
................
DEBUGPRINT("This step is OK");
DEBUGPRINT1("This step is OK: %ld \n", mode);
................
DEBUGPRINT6("This step is OK: %ld %ld %ld %ld %ld %ld\n", mode1, mode2, mode3, mode4, mode5, mode6);
................
or
#define DEBUG2
#include "genUtil.h"
................
DEBUG2PRINT("This step is OK");
DEBUG2PRINT1("This step is OK: %ld \n", mode);
................
DEBUG2PRINT6("This step is OK: %ld %ld %ld %ld %ld %ld\n", mode1, mode2, mode3, mode4, mode5, mode6);
................
If you finish to debug programs,
#undef DEBUG or #undef DEBUG2
#include "genUtil.h"
................
DEBUGPRINT("This step is OK");
DEBUGPRINT1("This step is OK: %ld \n", mode);
................
DEBUGPRINT6("This step is OK: %ld %ld %ld %ld %ld %ld\n", mode1, mode2, mode3, mode4, mode5, mode6);
................
2. How to use gdb.
Example (core analysis)
OS: HP, Order: mrcImagePrint -i test -o test2
gdb ~/Eos/bin/HP/mrcImagePrint.HP core
or
gdb ~/Eos/bin/HP/mrcImagePrint.HP
run -i test -o test2
(command list)
where
list
up, down
print
break
next
3. Log print
Example
#define LOGPRINT4(fpt,ID,ID2,x,d1,d2,d3,d4) \
fprintf(fpt, "%-6s %-15s ",ID,ID2); \
fprintf(fpt, x, d1,d2,d3,d4); \
fprintf(fpt, "\n"); fflush(fpt); \
fprintf(stdout, "%-6s %-15s ",ID,ID2); \
fprintf(stdout, x, d1,d2,d3,d4); \
fprintf(stdout, "\n"); fflush(stdout);