This module allows an application to use cexpsh() instead of iocsh from 'main'. It also adds entry points to iocsh so that cexpsh may be called from iocsh. Currently relevant and supported on Linux only. To use this module: - add and entry in your application's RELEASE file pointing to this module. - your application's 'main' may look like this: #include #include #include #ifdef HAVE_CEXP #include #endif int main(int argc, char **argv) { #ifdef HAVE_CEXP cexp_main(argc, argv); #else if ( argc >= 2 ) { iocsh(argv[1]); epicsThreadSleep(0.2); } iocsh(NULL); #endif epicsExit(); return 0; } Some makefile magic provided by this module automatically defines HAVE_CEXP on platforms where cexpsh is available. Note that it is not mandatory to start cexpsh from 'main'. cexpsh can also be called from iocsh at run-time. - Your application's Makefile must link the cexp (and dependent) libraries. Again, the makefile magic defines CEXP_LIBS only when applicable: _LIBS += $(CEXP_LIBS) Your application's Makefile must also include this module's 'dbd' file: _DBD += $(CEXP_DBDS) NOTES: 1 No special symbol table is built - hence only symbols defined by the main application and/or shared libraries linked by the main application are 'known' to the shell. Your application's Makefile may enforce linking symbols from non-shared libraries which are not referenced by your app by adding -Wl,-u, to the linker flags. 2 cexp now supports reading symbols from shared libraries. All global symbols exported by any shared libs used by the application are available. 3 This module registers cexpsh with iocsh so that it may be called from the latter: cexpsh() Invokes cexpsh in interactive mode which may be terminated by typing '-D'. You may also supply arguments in which case cexpsh() returns to iocsh immediately after executing: iocsh> cexpsh("-c",'printf("hello\n")') BUILDING THIS MODULE ==================== In order to build this module you must install the CEXP sources in a subdirectory of $(TOP)/cexp/ and define CEXP_VERS= in $(TOP)/configure/CONFIG_SITE accordingly. CONFIG_SITE also defines CEXP_SRCDIR=$(TOP)/cexp/$(CEXP_VERS) which you may modify if you choose to install the CEXP sources elsewhere. If you are working with a CVS checkout of CEXP then the package must be prepared: chdir $(TOP)/cexp/ make prep This requires 'bison' and recent autotools. A released tarball of CEXP does not need this preparation step. If you want disassembler support then you have to install binutils sources (vers. 2.21 works) and create a symlink from the cexp top source directory to the binutils sources. ln -s cexp/$(CEXP_VERS)/binutils After installing the sources, chdir to $(TOP) and issue 'make' as usual (make clean is required if you had already built before installing binutils).