Sponsored Content
Top Forums Programming Debugging a program written in two languages Post 302908122 by NiGHTS on Thursday 3rd of July 2014 08:31:39 PM
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
 

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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
OCSIGEN(1)						      General Commands Manual							OCSIGEN(1)

NAME
ocsigen - Web Development framework in OCaml SYNOPSIS
ocsigen [options] DESCRIPTION
ocsigen is a programming framework providing a new way to create dynamic web sites. Its goal is to offer an alternative to Apache/PHP, based on cutting-edge technologies coming from research in programming languages. With ocsigen, you program in a concise and modular way, with a strong type system which helps you to produce valid xhtml. The server handles sessions, URLs, and page parameters automatically. OPTIONS
-c, --config Alternate configuration file. -d, --daemon Daemon mode (detach the process). This is the default when there are more than 1 process. -help, --help Show summary of options. -p, --pidfile Specify a file where to write the PIDs of the servers. -s, --silent Silent mode (error messages go in errors.log only). -v, --verbose Verbose mode. -V , --veryverbose Very verbose mode (debug). -version Show version of program. SEE ALSO
ocamlc(1). AUTHOR
ocsigen was written by Vincent Balat <vincent.balat@pps.jussieu.fr>. This manual page was written by Samuel Mimram <smimram@debian.org>, for the Debian project (but may be used by others). 2006-09-14 OCSIGEN(1)
All times are GMT -4. The time now is 06:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy