From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 636A73858C33; Thu, 1 Dec 2022 13:55:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 636A73858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669902910; bh=BigkWG2r0oj8rMsYpz47mEc5YAwThiArhgbuwjkose4=; h=From:To:Subject:Date:From; b=cHrUnCZyuBYpAFmrSkyGIncsjC7L/bIdzO8QAC8yo3334LtPjCNPjDCCnVp+3Bra/ /TTKwwb+j6+jNyIGWWlfTGFSZFp5vquXZiGCvfSOGft7w8Hn4oJ4hfpUX98Q+QZjCl kWkuDs4zngj/w2s3/3VEU5WctcZUDhHSUHwxPT14= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4443] ada: Further adjustments to User's Guide for PIE default X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 81fd08ae715f1cd66bb172e77a63dd5efbc39052 X-Git-Newrev: f82d10a5485965788dad8258e8946c34d90953a0 Message-Id: <20221201135510.636A73858C33@sourceware.org> Date: Thu, 1 Dec 2022 13:55:10 +0000 (GMT) List-Id: https://gcc.gnu.org/g:f82d10a5485965788dad8258e8946c34d90953a0 commit r13-4443-gf82d10a5485965788dad8258e8946c34d90953a0 Author: Eric Botcazou Date: Tue Nov 29 18:44:33 2022 +0100 ada: Further adjustments to User's Guide for PIE default gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst (Non-Symbolic Traceback): Add compilation line. (Symbolic Traceback): Remove obsolete stuff. * doc/gnat_ugn/gnat_utility_programs.rst (gnatsymbolize): Adjust. * gnat_ugn.texi: Regenerate. Diff: --- gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst | 15 ++------------- gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst | 16 ++++++++++++++++ gcc/ada/gnat_ugn.texi | 19 +++---------------- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst index 45ecea75416..5dab2d45626 100644 --- a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst +++ b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst @@ -928,10 +928,9 @@ Ada facilities defined in ``Ada.Exceptions``. Here is a simple example: P2; end STB; -This program will output: - :: + $ gnatmake stb -g -bargs -E -largs -no-pie $ stb raised CONSTRAINT_ERROR : stb.adb:12 range check failed @@ -1070,7 +1069,7 @@ Here is an example: :: - $ gnatmake -g .\stb -bargs -E + $ gnatmake -g stb -bargs -E $ stb 0040149F in stb.p1 at stb.adb:8 @@ -1082,16 +1081,6 @@ Here is an example: 004011F1 in mainCRTStartup at crt1.c:222 77E892A4 in ?? at ??:0 -In the above example the ``.\`` syntax in the ``gnatmake`` command -is currently required by ``addr2line`` for files that are in -the current working directory. -Moreover, the exact sequence of linker options may vary from platform -to platform. -The above :switch:`-largs` section is for Windows platforms. By contrast, -under Unix there is no need for the :switch:`-largs` section. -Differences across platforms are due to details of linker implementation. - - .. rubric:: Tracebacks From Anywhere in a Program It is possible to get a symbolic stack traceback diff --git a/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst b/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst index f2d42e96bd4..7df45d518aa 100644 --- a/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst +++ b/gcc/ada/doc/gnat_ugn/gnat_utility_programs.rst @@ -2154,6 +2154,7 @@ building specialized scripts. with GNAT.IO; use GNAT.IO; with GNAT.Traceback; use GNAT.Traceback; with GNAT.Debug_Utilities; + package body Pck is procedure Call_Me_Third is TB : Tracebacks_Array (1 .. 5); @@ -2177,10 +2178,25 @@ building specialized scripts. Call_Me_Second; end Call_Me_First; end Pck; + + with GNAT.IO; use GNAT.IO; + with GNAT.Debug_Utilities; + with GNAT.Traceback; + with System; + with Pck; use Pck; procedure Foo is + LA : constant System.Address := \ + GNAT.Traceback.Executable_Load_Address; + + use type System.Address; + begin + if LA /= System.Null_Address then + Put_Line ("Load address: " & GNAT.Debug_Utilities.Image_C (LA)); + end if; + Global_Val := 123; Call_Me_First; end Foo; diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 5224a1201b8..dfe44b0937c 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -19,7 +19,7 @@ @copying @quotation -GNAT User's Guide for Native Platforms , Nov 28, 2022 +GNAT User's Guide for Native Platforms , Dec 01, 2022 AdaCore @@ -19200,13 +19200,9 @@ begin P2; end STB; @end example -@end quotation - -This program will output: - -@quotation @example +$ gnatmake stb -g -bargs -E -largs -no-pie $ stb raised CONSTRAINT_ERROR : stb.adb:12 range check failed @@ -19350,7 +19346,7 @@ end STB; @end example @example -$ gnatmake -g .\stb -bargs -E +$ gnatmake -g stb -bargs -E $ stb 0040149F in stb.p1 at stb.adb:8 @@ -19364,15 +19360,6 @@ $ stb @end example @end quotation -In the above example the @code{.\} syntax in the @code{gnatmake} command -is currently required by @code{addr2line} for files that are in -the current working directory. -Moreover, the exact sequence of linker options may vary from platform -to platform. -The above @code{-largs} section is for Windows platforms. By contrast, -under Unix there is no need for the @code{-largs} section. -Differences across platforms are due to details of linker implementation. - @subsubheading Tracebacks From Anywhere in a Program