From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:3094:: with SMTP id v20mr78748674qta.306.1578364169315; Mon, 06 Jan 2020 18:29:29 -0800 (PST) X-Received: by 2002:a9d:6c55:: with SMTP id g21mr18688148otq.312.1578364169048; Mon, 06 Jan 2020 18:29:29 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!g89no7520522qtd.0!news-out.google.com!w29ni67qtc.0!nntp.google.com!g89no7520511qtd.0!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 6 Jan 2020 18:29:28 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=47.185.239.228; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.239.228 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Importance of GNAT.Source_Info From: Optikos Injection-Date: Tue, 07 Jan 2020 02:29:29 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:57798 Date: 2020-01-06T18:29:28-08:00 List-Id: 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. >=20 > 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=20 > 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. >=20 > 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.ht= ml Speaking in general from RTOS knowledge not specific to GNAT or Ada, I obse= rve that GNAT.Source_Info.Enclosing_Entity (utilized transitively to the ta= sk'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 (v= ia mathematical proof of worst-case) the maximum (not typical) execution ti= me of each subroutine invocation=E2=80=94especially this analysis for each = required use-case from system engineering (but in lieu of each use-case, t= hen the absolute maximum execution-time of each subroutine). Often this an= alysis starts with a table of all system calls in an RTOS plus all subrouti= nes in a realtime system (including app-domain) that is derived from the ma= p file of each executibile as output at link-time. It appears that GNAT.So= urce_Info.Enclosing_Entity provides a dynamic walk with software assist tha= t would otherwise be a manual or semi-manual walk of the map file of subrou= tine names & their entry points. Perhaps someone else will have more GNAT-specific meat to put on this gener= al skeleton.