[Top][All Lists]

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

[patch] Add support for Ada (GNAT)

From: Joel Brobecker
Subject: [patch] Add support for Ada (GNAT)
Date: Mon, 29 Mar 2004 11:42:53 -0800
User-agent: Mutt/1.4i


My name is Joel Brobecker, and I am currently trying to add support
for testing GDB against Ada programs. For this, I'd like to add support
in dejagnu for building Ada applications. Here are a couple of patches
that I am suggesting for inclusion.

The first patch adds a new function that locates the "gnatmake" program.
This is the main program that GNAT users use in order to build they
Ada application. As it name implies, it is very similar to "make"
except that dependencies are automatically handled. A short example
of usage would be the following:

        Suppose you have a program which main procedure (the equivalent
        of procedure "main" in C) is named "foo", and that this procedure 
        depends on 2 units: "bar" and "baz". To build his application
        with debug info, the user would typically do:
                % gnatmake -g foo

        This command will automatically trigger the compilation of "bar"
        and "baz", except if a unit have already been compiled and its
        associated object file is still up to date. It will also take
        care of the link.

As in "find_gcc", "find_gnatmake" also tried to see if we have an
in-tree gnatmake. If this is the case, then it returns that gnatmake
along with appropriate options to run it in-tree (for testing of a
combined tree).

The second patch upgrades default_target_compile to support the "ada"
keyword option, as well as the GNATMAKE_FOR_TARGET global.

The two patches have been tested inside the GDB dejagnu framework,
where I defined a procedure gdb_compile_ada that would add the "ada"
keyword for me, and then call "target_compile".

2004-03-29  Joel Brobecker  <address@hidden>

        * lib/libgloss.exp (find_gnatmake): New procedure.
        * lib/target.exp (default_target_compile): Add support for Ada.

Would this patch be acceptable for inclusion?

There is also an administrative detail that may need to be sorted out:
I don't know if the company I work for has an assignment filed that
covers dejagnu. I work for AdaCore (aka Ada Core Technologies, or ACT).
Please let me know.


PS: The commands specified in your dejagnu webpage is slightly
    incorrect. I didn't know much about anonymous CVS acccess,
    so it took me a while to dig out of the CVS documentation
    a way of getting the sources. You might want to fix this.
    I did:

    $ cvs -z3 -d :ext:address@hidden:/cvsroot/dejagnu co dejagnu

    (it looks like all I had to do was to skip the first step which

Attachment: libgloss.exp.diff
Description: Text document

Attachment: target.exp.diff
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]