You've already forked gnatstudio
mirror of
https://github.com/AdaCore/gnatstudio.git
synced 2026-02-12 12:42:33 -08:00
Most of the complex manual code to encode and decode python parameters is now automatically generated. The API was in fact simplified too, so that even the generated code is much simpler than before. This fixes a number of inconsistencies in our hooks, between the doc that could be missing some parameters, or even in the way some hooks were exported to python. For instance, compilation_finished would export 5 parameters (category, target, mode, status), but expect 7 when GPS.Hook.run() was called from python (which was never done in our own plug-ins). This also removes support for creating custom hook types from python. This was never used in any of our plug-ins (only in tests), and complexifies the implementation significantly. Improve error messages for hooks, since we can more systematically catch Ada and python exceptions. (modules.py): do not support adding to the gps_started hook anymore. The proper alternative is to override setup(). Otherwise, when GPS calls gps_started, the local gps_started callback is added to the end of the callback queue, and will be run after the test's exit() function (in some tests like IA27_014), which might result in exceptions. It seems we had a problem before: running a hook would do a local copy of the list of callbacks, so any callback added during the run was not run; as a result, it is possible that the gps_started() functions from modules.py were not called properly. We no longer make this temporary copy (for efficiency) Kernel.Open_Files is now implemented as a sorted set, instead of an array of Virtual_File. This provides a more efficient Contains operation. But we still need a specific sort order so that GC14_007 passes M109-019 (1/2) Change-Id: I1853c0a82b32c220d19da16e650953261d067630