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: 28387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp273505wrr; Thu, 1 Dec 2022 05:58:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7w3/nwGQZav3rM0KwOZENDKJjlPp/cj8iQfTWPeJqs/m9dff3LscOtWlrvsYH96GGZy5Io X-Received: by 2002:a17:906:560c:b0:7ae:5884:81b1 with SMTP id f12-20020a170906560c00b007ae588481b1mr41251233ejq.155.1669903125940; Thu, 01 Dec 2022 05:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669903125; cv=none; d=google.com; s=arc-20160816; b=bYhy4S86N2a2++kJa26VZiS0QOJmik4NsI2eTSTYzpqn7VCQXl4Wx4GJQT/Wdb5hRT xsc4ysfsGTfnmtQWtGCCfZlHT8NQZ+VJa22ji3UHAx674EPI9RHmp3SWFS9PESzwdu1E YupWRHJO/cO612/oinbxvBLKgoSWMpM44Y38Gd0ljAhwUC6Ot4hLK1/xgBkTgX91B3Is QCWPUjhX8ESJ60mx053l1iSnvZiZ5CbQM2S0glRepxrnfsS8o5zbVRCRMDsyk8SUGyL0 sKXjoPmVNpVM3t5wXxRPddmtwAbmXbtxycvQYJ6OezydShNtZ07FCN8III6lCxOE07Ve 0pIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=FO7t2GhzpgmquOsnAGJBgmdn9p9KvZQnhffeZ/fKLEE=; b=vBsHF69I63WdFGfsCSexJpg7xGEa14QbMdMXOR15RffSlULZh7JGM1qpkD95XmbPFb ZmGV38rcjpvESaDWG9M46goF84nxy9CC5DBdM8TPcyoZUctNG2Yr2pKV+yAq1lkBhTZ7 6ztFe66aIxK1s7yhaZnCNPq0qwOiRde0CtwAz/COY3lC4b3AYbv/WMhxmbbdhEtdox/u JW7bK2LleynYmQvgw82KfOVZ445LEU32HYltLJQMcv8X/PK+4XRwgdN26DrQHckoHFQK YDbtS1/RN5Nnj5C6TWSFxY1aoH5L1iWOGhflhTg9241Z0kt9hg5MwZG16MFZjE0e/T2K j11A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Wr6hik6D; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z20-20020aa7cf94000000b0046b55b17f1fsi3715510edx.567.2022.12.01.05.58.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 05:58:45 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Wr6hik6D; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3C60A3854550 for ; Thu, 1 Dec 2022 13:58:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C60A3854550 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669903095; 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=Wr6hik6D1uTmLui277qVw6RwDv9RumyqGEvuyI2gGC5h3fGfT4ZMo1qEUoDpodyxt feFoyD23+KssC+j6BVInTLScIkWBBOlUU2oeNlG3VEbml0vYoVSVAITYoHZYm8aa/A gjOkg12Z1zEE8SU5LDHFC/S80sLh6hdO/uCz6kdQ= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751020340097616585?= X-GMAIL-MSGID: =?utf-8?q?1751020340097616585?= 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