From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Qt5JISVWHWBaIQAAWB0awg (envelope-from ) for ; Fri, 05 Feb 2021 09:28:53 -0500 Received: by simark.ca (Postfix, from userid 112) id 7B0221EFCB; Fri, 5 Feb 2021 09:28:53 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D6CA21E939 for ; Fri, 5 Feb 2021 09:28:52 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C14039F1C3D; Fri, 5 Feb 2021 14:28:52 +0000 (GMT) Received: from mailex.trusted-objects.com (mailex.trusted-objects.com [149.202.244.204]) by sourceware.org (Postfix) with ESMTPS id 9A13139F1C3B for ; Fri, 5 Feb 2021 14:28:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9A13139F1C3B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=trusted-objects.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=v.dupaquis@trusted-objects.com Received: from [192.170.0.219] (88.127.245.42) by S76918.EX76918.lan (2001:41d0:117:dd00::95ca:f4cc) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P521) id 15.1.2176.2; Fri, 5 Feb 2021 15:28:49 +0100 Subject: Re: Getting access to environement variables To: Paul Koning References: <83736f95-5415-5963-12e7-36466185cef4@trusted-objects.com> <54B2CC51-8AA2-43AE-95F6-80F5B4BA8128@comcast.net> From: vincent Dupaquis Message-ID: <0cb22341-6d2e-5889-d07c-3a00f29fcdd8@trusted-objects.com> Date: Fri, 5 Feb 2021 15:28:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <54B2CC51-8AA2-43AE-95F6-80F5B4BA8128@comcast.net> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: fr-FR X-Originating-IP: [88.127.245.42] X-ClientProxiedBy: S76918.EX76918.lan (2001:41d0:117:dd00::95ca:f4cc) To S76918.EX76918.lan (2001:41d0:117:dd00::95ca:f4cc) X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb@sourceware.org Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" Good point ! That's something I already use when instrumenting gdb, but for some easy and quick scripting, it would have been easier to be able to access the environement variables directly from the gdb commands. Vincent. Le 05/02/2021 à 15:06, Paul Koning a écrit : > >> On Feb 5, 2021, at 4:58 AM, vincent Dupaquis wrote: >> >> Hello, >> >> I would like to point-out a possibly missing feature, which is the >> possibility of accessing ENV variables in GDB commands. > Assuming your GDB is built with Python scripting included, you can do it via Python; "import os" then access environment variables as elements of dictionary "os.environ". > > paul > -- *Vincent Dupaquis* Software security & Cryptography expert 06 24 58 17 05 /Europarc de Pichaury Bâtiment B8 1330 rue Guillibert Gautier de la Lauzière 13290 Aix-en-Provence/ www.trusted-objects.com