For Eos System Developers

From EosPedia
Jump to: navigation, search

Eos System Developers

Eos Enviroment Setting

Eos default setting

   EOS_HOME
       Eos home directory 
   EOS_HOST
       Eos working station type
       When you want to create a new tool on another Eos,
       EOS_ANOTHER_HOME
           Anonther Eos home directory 

When you create a new tool,

Rule

create new directories and proto-type source codes

$ maketool classname toolname new

change a working directory.

$ cd $EOS_HOME/src/Tools/classname/toolname/src

When you want to add new arguments, you need to modify a file of ../Config/OptionControlFile. Now we are creating a interactive tool, makeOptionControlFile. Wait a moment please. If you modify a file of OptionControlFile, you must update your new source codes.

$ make update

modify toolname.c (a main-source file) This step is essential but cannot be auto-made.

Check file-dependency.

$ make depend

build a new tool

$ make

fix bugs in a main-source file. This step is essential, too. It may take many hours to fix bugs. Eos supplies some techniques for the purpose of quick bug-fix, while the bug-fix step cannot be auto.

install a new tool

$ make install 

When you create a new object

$ protoObjectMethodCreate 


Control File Format

This control file is used to generate prototype-source code.

Main Source File

   Main source file
       Default: Tool.c 
   ToolInfo
       This struct includes the information of argmunets (argv) of main function 
   init0 (init.c)
       Assign default values to ToolInfo 
   argCheck (argCheck.c)
       Assign values to ToolInfo using the information of arguments (argv) 
   init1 (init.c)
       Initialize ToolInfo following the information of arguments (ToolInfo). 

Some Techiniques for Quick Bug-fix

DEBUGPRINT function

DEBUGPRINT is a print function for DEBUG. The tool is defined in 'genUtil.h'.

   #include "genUtil.h"

If you begin to debug programs,

Example:

   #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,

Example:

   #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);
   ................

How to use gdb.

core analysis


Example: OS: HP, Order: mrcImagePrint -i test -o test2

$ gdb ~/Eos/bin/HP/mrcImagePrint.HP core

or

$ gdb ~/Eos/bin/HP/mrcImagePrint.HP
$ gdb> run -i test -o test2

gdb command list

gdb> where
gdb> list 
gdb> up, down
gdb> print
gdb> break
gdb> next

Log print

Print logs to both stdout and fpt for file 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);