ada-mode-users
[Top][All Lists]
Advanced

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

Re: [Ada-mode-users] ada-gnat-xref, ada-gnat-xref-all with .gpr project


From: Ludovic Brenta
Subject: Re: [Ada-mode-users] ada-gnat-xref, ada-gnat-xref-all with .gpr project files: gnat: 'gnat find -P' is no longer supported;
Date: Tue, 20 Dec 2016 20:11:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Stephen Leake <address@hidden> writes:
> Ludovic Brenta <address@hidden> writes:
>
>> Hello,
>>
>> We're (finally) switching to GPR project files for our build process
>> and, at the same time, trying to switch to them for the editing and
>> navigation in source files.  Unfortunately we're doing this right at
>> the same time as GNAT Pro is dropping support for project files from
>> all utilities except gprbuild; gnat find now says:
>>
>> gnat: 'gnat find -P' is no longer supported;
>>
>> Investigating in ada-mode, I see that the invocation of "gnat find"
>> is hardcoded in ada-gnat-xref and ada-gnat-xref-all.  But I also see
>> that gnatfind still supports project files, with "-p" not "-P":
>>
>> gnatfind -ptact_tacot.gpr -a
>> Count_Location_Editor:reroute_editor.adb:9:6
>> count_location_editor.ads:12:9: (spec) Count_Location_Editor
>>
>> Patch attached; I prepared this against revision
>> 039320f4f3f803d860ec5dbae3f3b760c9debc89; this will get us going until
>> gnatfind also drops project file support.
>
> Ok.
>
> There is also gpr-query, which is the intended replacement for gnat
> find. See the user guide for using it. It requires compiling and
> installing an Ada program - after that, using it is automatic.

In the mean time, strace revealed that gnatfind did read the specified
project file but ignored the Object_Dir in it; then I discovered that
gnatfind -p (and gnatxref -p) do not use GNAT project files but project
files that are very similar to old-style emacs ada-mode project files
(i.e. containing src_dir=, obj_dir= lines; everything else is ignored).
Therefore my patch can be dropped altogether.

A better approach would be to (a) parse GNAT project files as they are
loaded, (b) fill the internal alist with obj_dir as they are selected,
and (c) passing -aO to gnatfind.  Only (b) is currently missing from
ada-mode.  My boss doesn't want me to spend my time implementing (b); he
wants me to pass -aO with a hardcoded path instead.  I think the
long-term plan would be gpr-query indeed, so I'll investigate that next.

--
Ludovic Brenta.



reply via email to

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