views:

422

answers:

1

I am using emacs + gdb to debug a bunch of .c files in unix -- and it always worked well. But some of the projects I work in also have a bunch of .pc (Pro*C/C++) files. These files generate .c and .i related files after compilation. But during runtime I am able only to see the .i files in gdb -- which are not useful for debugging and are always out of sync. In other words, gdb will not load the .c files which I need.

One of the guys who work with me suggested opening the .c files in another editor and try to find the source of the lines which gdb shows as for the .i files.

Is there another way? How do I load the .c files in gdb? How to debug this .pc files?

+2  A: 

First off compile with full debugging and link with debugging.

For ProC options use LINES=YES so the code that the ProC preprocessor inserts is hidden so you don't have to step though it.

Those are the three significant steps we use in our environment.

Here is a link to the Pro*C users guide where you can find other useful information.

EvilTeach