[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debugging ADA-C-OS interface?



Svante Signell wrote:
I have problems how to debug the C-ADA-OS interface for the GNU/Hurd
port of Gnat. I get a segfault for both dynamically and statically
linked files for the music123 prokgram, utilizing tasking. The problems
are in the real-time part of gnat: libgnarl.{a,-4.6.so.1}. Backtraces
are shown below. How are the object file symbol names built up in ADA
and how are they related to the .adb and .ads procedures and functions?

An entity such as a function, procedure or variable has a fully-qualified
name of the form

Pak.Sub_Pak.Object  (where Pak and Sub_Pak are packages)

which GNAT mangles into pak__sub_pak__object. The name mangling is quite
simple: dots become double underscores and everything is lower-cased.
Because subprogram names can be overloaded, GNAT adds parameter type
information at the end of their mangled names. (Note that in Ada, the
return type of a function also participates in overloading and is therefore also mangled; i.e you can have two functions with the same name returning
different types).

All entities have a declaration.  A subset of those also have a body;
these are subprograms that are not imported from other languages.  Most
entities are grouped into packages.  You should really learn the basics
of packages, declarations and bodies[1], this will allow you to understand
GNAT's file naming rules[2].

[1] http://en.wikibooks.org/wiki/Ada_Programming/Packages
[2] http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gnat_ugn_unw/File-Naming-Rules.html#File-Naming-Rules

Lastly, libgnat-4.6.so contains the Ada run-time library and it uses
libgnarl-4.6.so to implement [multi-]tasking. Conceptually, libgnarl-4.6.so
is invisible to the programmer and to be used only by libgnat-4.6.so.

As for debugging your particular problem, I'm afraid I lack the time and expertise to be of much help. Perhaps the upstream authors can better help;
they are on gcc@gcc.gnu.org.

HTH

--
Ludovic Brenta.


Reply to: