Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Damian Carter could not step through ESQL/C .ec files properly in ddd/gdb. Jonathan Leffler said the generated #line directives map several C lines to one .ec line, and he converts them to comments with a sed script so the C is debugged. Art S. Kagel said results depend on the compiler and debugger, and suggested compiling with -G instead of -g to drop the #line pragmas. Dirk Niemeier said gdb worked for him on HP-UX 10.20. No final confirmation.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Damian Carter — — source: Informix-list mailing list archive (1991-1998)
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
↪ replying to Damian Carter
Jonathan Leffler — — source: Informix-list mailing list archive (1991-1998)
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>
↪ replying to Damian Carter
Dirk Niemeier — — source: Informix-list mailing list archive (1991-1998)
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
↪ replying to Damian Carter
Art S. Kagel — — source: Informix-list mailing list archive (1991-1998)
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
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.