comp.lang.ada
 help / color / mirror / Atom feed
From: Optikos <ZUERCHER_Andreas@outlook.com>
Subject: Re: Importance of GNAT.Source_Info
Date: Mon, 6 Jan 2020 18:29:28 -0800 (PST)
Date: 2020-01-06T18:29:28-08:00	[thread overview]
Message-ID: <f8930dab-43e8-4ba4-9a65-5cc6705ece7e@googlegroups.com> (raw)
In-Reply-To: <a69d12bc-4cc7-41dd-8307-e17b90777a9a@googlegroups.com>

On Monday, January 6, 2020 at 4:03:56 PM UTC-6, Jere wrote:
> I'm working on a baremetal RTS and while looking at
> https://wiki.osdev.org/Ada_Bare_bones, one of the files
> it suggests is part of the minimum set of RTS files is
> g-souinf.ads which contains the package GNAT.Source_Info.
> 
> Does anyone know what part of the compiler requires this?
> So far I haven't had GNAT barf at me for not having it
> while compiling the files I do have, but I don't want to 
> leave it out if it is indeed necessary for something.  I
> didn't see any info on why it is necessary.  It's definitely
> useful in that it gives a lot of compile time values, but
> not sure why it would be a "required" file.  I'm assuming
> something will break without it, but don't know what.
> 
> Sorry that this isn't a pure "Ada" question and is more
> focused on GNAT specifically, but thought one of yall
> might know why.

https://www.radford.edu/~nokie/classes/320/std_lib_html/gnat-source_info.html

Speaking in general from RTOS knowledge not specific to GNAT or Ada, I observe that GNAT.Source_Info.Enclosing_Entity (utilized transitively to the task's entry point) would provide information useful to knowing the complete call tree for maximum execution-time analysis in static analyzers of static machine code or in empirical analysis tools of a running system or hybrids thereof.  The A#1 goal of hard realtime systems is to definitively know (via mathematical proof of worst-case) the maximum (not typical) execution time of each subroutine invocation—especially this analysis for each  required use-case from system engineering (but in lieu of each use-case, then the absolute maximum execution-time of each subroutine).  Often this analysis starts with a table of all system calls in an RTOS plus all subroutines in a realtime system (including app-domain) that is derived from the map file of each executibile as output at link-time.  It appears that GNAT.Source_Info.Enclosing_Entity provides a dynamic walk with software assist that would otherwise be a manual or semi-manual walk of the map file of subroutine names & their entry points.

Perhaps someone else will have more GNAT-specific meat to put on this general skeleton.

  reply	other threads:[~2020-01-07  2:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06 22:03 Importance of GNAT.Source_Info Jere
2020-01-07  2:29 ` Optikos [this message]
2020-01-07  6:12   ` Niklas Holsti
2020-01-11 15:01     ` Jere
2020-01-08 16:38 ` Simon Wright
2020-01-11 15:02   ` Jere
2020-01-10 10:54 ` charlet
2020-01-11 15:03   ` Jere
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox