This was triggered by the way that C-c C-d on, say, Ada.Real_Time.Clock would 
land you a few lines away from the definition in your native RTS rather than 
the proper definition in your target RTS.

It turns out that you can't say

   gnat list -v -P project.gpr

but you need to say e.g.

   arm-eabi-gnat list -v -P project.gpr --RTS=ravenscar-sfp-stm32f4

arm-eabi-gnat find differs from list in that it doesn't know the special trick 
to finding the RTS (it should look in $prefix/arm-eabi/lib/gnat as well as ); 
but it doesn't need to, it works just find without the RTS setting. Clearly 
list and find use the project info differently.

While working on this, I kept on finding that exec-path had lost the setting I 
gave it in ~/.emacs; so I've used

         (target-gnat-exec (locate-file
                            target-gnat
                            (split-string (getenv "PATH") path-separator)))

before call-process.

Eventually, this can be put into gpr_query, I think, but I got lost in there so 
used .prj file settings: e.g.

gpr_file=io_expander.gpr
target=arm-eabi-
runtime=ravenscar-sfp-stm32f4

Patch attached. Let us know how you get on!

PS - is there a mode for editing .prj/.adp files?

Attachment: cross-compilation.diff
Description: Binary data

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://stephe-leake.org/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to