Debug,
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Does anyone know hot to debug a c program in Sun OS 5, is a esqlc program. thks, Julio Sanchez
rejmess wrote:
> Does anyone know hot to debug a c program in Sun OS 5, is a esqlc program.
(a) Compile and link the code with the debug flag set by using:
export INFORMIXC="cc -g" # or "gcc -g"(b) Sometimes, it is easier to see the real C file than the ESQL/C file.
Compile the ESQL/C source code to a .c file (esql -c). Then post
process the .c file so that each '#line' directive is converted to
a C comment /* #line 32 "file.ec" */. Then compile the .c file to
object code with the esql script 'esql -o file.c'. Then link as
before.
(c) Use debugger or dbx or gdb or whatever to actually run the debugger.
I tend to make use of embedded print statements at least as much as I do
use a source code debugger.
Note that the environment variable stuff won't work with ESQL/C 5.x
unless you patch the esql script. And the reason for messing with
INFORMIXC in the first place is that the esql script thinks that -g is a
directive to itself, so it does not pass it through to the C compiler.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"