1

I am pretty new to Informix and I have a program that I am adding some functionality to. It seems that the program has some existing issues with it though.

When I run make -f makefile.mk I get success and the .4ge gets generated and I am able to run it. However I am trying to get the program to run within informix 4gl interactive debugger but I get the error: Invalid module name [main] specified.

Any assistance would be greatly appreciated. Unfortunately I am unable to share code as the program contains confidential information

  • Umm,.. do you have main()? You get that error if the debugger (fgldb) can't find a main function in your pcode file. Maybe yours only have functions inside – jsagrera Jun 26 '20 at 14:30
  • I do have a main and like I said the program compiles fine when I "make" but I can't seem to debug. – Yusuf Hassim Jun 27 '20 at 09:38
  • Can you run it? and if so, how? In theory, you should only get that error if fgldb can load the pcode binary but can't find an entry point (main function) inside. If the file is not pcode (compiled with fglpc) it will fail to load. and throw something like "...tried to run a file that was not created by the 4GL pcode compiler..." – jsagrera Jun 28 '20 at 08:12
  • Maybe the file you are trying to debug is just one of the modules that ,later on, are joined together to form the main program, the one you run with the runner (e.g. fglgo) – jsagrera Jun 28 '20 at 08:20

1 Answers1

1

The Informix-4GL Interactive Debugger (ID) is for debugging programs compiled with the Informix-4GL Rapid Development System (RDS). The object files created by RDS (fglpc) have the extension .4go (I4GL p-code object file) and the executables are conventionally given the extension .4gi (I4GL p-code interpretable file — run using fglgo or ID's fgldb).

By contrast, the plain Informix-4GL (c-code) system uses an I4GL compiler to generate first ESQL/C code and then C code, and a C compiler to create regular object files (.o) and to create its executables, which are conventionally given the extension .4ge (I4GL c-code executable).

The ID cannot debug c-code executables. It can only debug p-code interpretable files.

On the face of it, therefore, your problem is that you are using the wrong tool for the job. Either you need to compile with RDS and create an interpretable, or you need to use a C code debugger such as GDB. However, be warned that debugging I4GL code with GDB is mainly an exercise in frustration as the bulk of the code is a series of function calls to library functions — or is an incredibly tortuous sequence of goto statements if you're debugging inside an I4GL report function. It is machine-generated C code; it is not intended to be comprehensible to humans.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278