Debugging a program written in two languages


 
Thread Tools Search this Thread
Top Forums Programming Debugging a program written in two languages
# 1  
Old 07-03-2014
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? Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

How to prevent a C++ program reading a file that is still being written to.?

Hi, Hopefully someone can help. We have a process that writes a file using Connect Direct to our local Solaris server and then our C++ program will pick up the file and process it. Unfortunately, because of the size of the file, the C++ program is processing the file before it has finished... (7 Replies)
Discussion started by: chris01010
7 Replies

2. Programming

Debugging Program during execution

I have made use of 'valgrind' and -finstrument-functions compiler option for debugging / analyzing code. Both the options lets us know the line / file being executed to some extent. Is there a generic way that lets program dump the file:line it is getting executed dumped to a log file during... (3 Replies)
Discussion started by: uunniixx
3 Replies

3. What is on Your Mind?

Programming languages polyglots: how many languages you know?

Post what languages (including scripting) you know, why and where you think that language is most usable. Also include libraries in which you're really good at (libusb, gtk, qt, etc). assembly? C or C++? perl or python? pascal? bash or csh/tcsh? opengl? gtk or qt? mono? (27 Replies)
Discussion started by: redoubtable
27 Replies

4. Shell Programming and Scripting

bash and languages

Hi everyone, First of all, i dont know what id do without this forum its been such a great help:) so a big thankyou to all, anyway i have a simple question, if i wrote a scrpt in english would it work on another machine with a different language, or do i have to put something in the script to say... (9 Replies)
Discussion started by: dave123
9 Replies

5. Programming

How to clear the content of a pipe (STDIN) after it is written to another program?

PROGRAM A <-> PROGRAM B PROGRAM A sends data as STDIN ro PROGRAM B and when PROGRAM B is executed from PROGRAM A, it sends output back to PROGRAM A. This is implemented using 2 pipes (fd1 & fd2). The above process happens in a loop and during the second run, the previous data that had been... (10 Replies)
Discussion started by: vvaidyan
10 Replies

6. Shell Programming and Scripting

output in different languages

hello, i have to change a lot of shell scripts for one reason : the output in a script should be done in different languages. for example: echo "this is a test" and "this is a test" should be printed out in language for an example: german,italian and so. i saw a tool "gettext" ,... (2 Replies)
Discussion started by: bora99
2 Replies

7. UNIX for Advanced & Expert Users

Debugging a c/c++ program

Can anyone tell the commands we use for debugging a programm in dbx with explanation for each? Iam totally new to unix environment (3 Replies)
Discussion started by: bogarams
3 Replies

8. Programming

how to run debugging on c program

Can someone help me debug a c program I am running? It gives me segmentation fault. I want to turn on debugging. Can some one give the command to turn it on? Below is the error I get: Segmentation Fault (core dumped) (3 Replies)
Discussion started by: ibeg
3 Replies
Login or Register to Ask a Question