ESQL & Debugger (source level)
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Is it possible to use a source level debugger with ".ec" files? If so, which debugger and how? I am trying to use ddd (a GUI debugger which works on top of gdb). It automatically opens ".ec" source files which I can insert breakpoint into, but things don't work properly: it doesn't break where I tell it to, and single stepping (over one line of source) doesn't work (program just continues). I'm thinking I need to debug the precompiled ".c" instead. But then why does the debugger automatically pick up the ".ec" file? Any help would be greatly appreciated! Damian
Damian Carter wrote: > Is it possible to use a source level debugger with ".ec" files? If so, which > debugger and how? Substantially, No, but... > I am trying to use ddd (a GUI debugger which works on top of gdb). It > automatically opens ".ec" source files which I can insert breakpoint into, but > things don't work properly: it doesn't break where I tell it to, and single > stepping (over one line of source) doesn't work (program just continues). > > I'm thinking I need to debug the precompiled ".c" instead. But then why does the > debugger automatically pick up the ".ec" file? Because the .ec file contains lines like: #line 300 "file.ec" ... #line 300 "file.ec" ... #line 300 "file.ec" And no, it isn't an accident that I used the same line number 3 times in a row! That's why it is so difficult to step through the code; more than one line in the C source corresponds to a single line in the ESQL/C source. The only way I've found of handling this is to convert all those #line directives into comments. By leaving them as comments, you can see which line in the C corresponds to which line in the ESQL/C code, but the debugger does not get completely confused. I even have a (simple) sed script packaged as a command to do this. This way, you debug the C code, but you can see what the ESQL/C is. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN #include <disclaimer.h>
Damian Carter schrieb: > Is it possible to use a source level debugger with ".ec" files? If so, which > debugger and how? > The GNU gdb themselves works fine on hpux10.20 and ".ec" files. Dirk > > I am trying to use ddd (a GUI debugger which works on top of gdb). It > automatically opens ".ec" source files which I can insert breakpoint into, but > things don't work properly: it doesn't break where I tell it to, and single > stepping (over one line of source) doesn't work (program just continues). > > I'm thinking I need to debug the precompiled ".c" instead. But then why does the > debugger automatically pick up the ".ec" file? > > Any help would be greatly appreciated! > > Damian
It depends on the "C" compiler/cpp you are using and your debugger. Sometimes (meaning on some systems) it works, sometimes it does not. On our DG M88K systems debugging the ec file works fine. On our newer DG Intel's it does not (same debugger bit a different compiler. One thing you can try is to compile with -G instead of -g this will remove the #line pragmas so you can debug the .c file directly. The ESQL will still be in the source as comments so you can follow along in an editor but the line numbers will not correspond. Jonathan's suggestion seems reasonable also. Art S. Kagel Damian Carter wrote: > > Is it possible to use a source level debugger with ".ec" files? If so, which > debugger and how? > > I am trying to use ddd (a GUI debugger which works on top of gdb). It > automatically opens ".ec" source files which I can insert breakpoint into, but > things don't work properly: it doesn't break where I tell it to, and single > stepping (over one line of source) doesn't work (program just continues). > > I'm thinking I need to debug the precompiled ".c" instead. But then why does the > debugger automatically pick up the ".ec" file? > > Any help would be greatly appreciated! > > Damian