Skip to content

GNAT Stub invocation issue (2026.2). #204

Description

@Blady-Com

Thank you for the latest Gnat Studio improvements and release schedule.

Error with the invocation of GNAT Stub with GS 2026.2:

gnatstub -P/Users/me/Tests/tests_gnat.gpr -XBUILD_MODE=Debugging /Users/me/Tests/2024/test_20241227_abstract_ic.ads /Users/me/Tests/2024/
Traceback (most recent call last):
  File "/Users/me/xnadalib-2026/share/gnatstudio/support/core/gnatstub.py", line 38, in on_exit
    if GPS.current_context().file() == self.file:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
GPS.Unexpected_Exception: unexpected internal exception raised GNATCOLL.SCRIPTS.NO_SUCH_PARAMETER :  2

The actual value of GPS.current_context().file() is None.

A naive workaround is:

--- ./share/gnatstudio/support/core/gnatstub.py@0	2026-04-08 03:21:21
+++ ./share/gnatstudio/support/core/gnatstub.py	2026-06-21 16:45:28
@@ -35,8 +35,11 @@
             # We were not given a location when launching gnatstub:
             # if we are still on the original file, then go to the
             # body of this file.
-            if GPS.current_context().file() == self.file:
-                GPS.execute_action("goto other file")
+            print("GPS:", GPS.current_context().file())
+            print("Self:", self.file)
+            if GPS.current_context().file():
+                if GPS.current_context().file() == self.file:
+                    GPS.execute_action("goto other file")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions