From patchwork Thu Dec 1 13:55:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 61316 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 588763858C39 for ; Thu, 1 Dec 2022 13:57:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 588763858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669903079; bh=FO7t2GhzpgmquOsnAGJBgmdn9p9KvZQnhffeZ/fKLEE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=gehDzYfF9Ly+F39PN+gNhLD0kzM0XPCCs8ztkDXll5t5bVKBNyUv6FX40aDk09zL9 chpRfzIely7ui6tgAf/VF8jiR1Cw3nwP6N7z+oKArsBkWg6pbrZYbDbg1tWc6MUcYS 5NLbvvd2/XwkWeDAI1qH0BBuYU3Fpiye1CBmg2JY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id C7677385843E for ; Thu, 1 Dec 2022 13:55:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7677385843E Received: by mail-wr1-x42b.google.com with SMTP id x17so2810456wrn.6 for ; Thu, 01 Dec 2022 05:55:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FO7t2GhzpgmquOsnAGJBgmdn9p9KvZQnhffeZ/fKLEE=; b=Ba6gZnH/qu2PpV9KXJyXO62ltAppedEnMTfpCykQc429n9IrUrKJyzalHLFNrGJweo b/R1Vk1bOlaqtH6bRVDVgGHwrSLo1cz0FQGw9nQ2HIQzLP0vamJMcahiSdAzg3iUTBLu Pe7sKrFTll5d+iq2cVQ/aK/qlq3IGoHr8hf09FWzrzFFL9OFbiq9u/GE0rTYXtpufKG4 59a7OonXLSKxc0QRH/D4m6jZWKJBaVMR6twsZopHKXscHLOYlnyuijOiE8DNJsr0mG1W jROYlB9U1nsQLlMU2+sm5PXWAnJD7RPDu1ANnVsmbGpnn9JA4UXBq7JtiUVmsjwU1GUG spVw== X-Gm-Message-State: ANoB5pkT6Zo5VbQH1UAX7BRA2El2lRNdXm0mQNYAPQc3kxkly2vQkXF6 cO6pTVM6NJjP4mHuqBYl8tr3DzOsFF23lA== X-Google-Smtp-Source: AA0mqf7PHE07mgo1ZysPzVoRuQaHuhGyhZnKWU0Bz+lK4JFUdcYxwmWYDgYzlx/AYO72YATQEl/hrQ== X-Received: by 2002:a5d:4f0d:0:b0:242:65d:b750 with SMTP id c13-20020a5d4f0d000000b00242065db750mr20123727wru.367.1669902946620; Thu, 01 Dec 2022 05:55:46 -0800 (PST) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b003c6b7f5567csm9971456wms.0.2022.12.01.05.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 05:55:46 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Further adjustments to User's Guide for PIE default Date: Thu, 1 Dec 2022 14:55:44 +0100 Message-Id: <20221201135544.458168-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Eric Botcazou 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. Tested on x86_64-pc-linux-gnu, committed on master. --- .../gnat_ugn/gnat_and_program_execution.rst | 15 ++------------- .../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