Debugging a program written in two languages

Subject: Debugging a program written in two languages
Platform: Linux (Kubuntu)

I am trying to debug a C application with bindings to some simple functions written in Ada using the GNAT Programming Studio IDE (GPS). The main entry point is in C. The debugger is gdb.

I managed to compile both sources in GPS just fine (using gprbuild). I made sure to instruct the respective compilers to export debugging symbols (-g).

When initializing the debugger, it loads the C main symbols correctly. I can set a breakpoint and follow the C code in the GPS IDE. The problem seems to be trying to set a breakpoint in the Ada code. "gdb" complains with the following error:

"No source file named unit1.adb."

NOTE: The file 'unit1' is where I attempted to set a breakpoint.

I have also attempted to use "ddd" and it gives the same error.

In Conclusion

  • How can I configure GPS to step through Ada code from a C code-base with a C main?
  • For those not familiar with GPS, how could I do this directly using the gdb tool?

Thank you

---------- Post updated at 08:31 PM ---------- Previous update was at 07:18 PM ----------

I figured out what I was doing wrong. I was not properly compiling the Ada files using the -g option.

This is due to a confusion with the GPS project properties interface. In the switches -> Ada sub-menu I had to enter "-g" in the untitled field to make it work.

Would it have killed them to put a title on that field? :rolleyes: