From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailex.trusted-objects.com (mailex.trusted-objects.com [149.202.244.204]) by sourceware.org (Postfix) with ESMTPS id 8A08A3857020 for ; Fri, 5 Feb 2021 14:51:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8A08A3857020 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:51:31 +0100 Subject: Re: Getting access to environement variables To: References: <83736f95-5415-5963-12e7-36466185cef4@trusted-objects.com> <54B2CC51-8AA2-43AE-95F6-80F5B4BA8128@comcast.net> <0cb22341-6d2e-5889-d07c-3a00f29fcdd8@trusted-objects.com> <6c05f6f35de09330538fbeca5d4c1c68964f108e.camel@fit.cvut.cz> From: vincent Dupaquis Message-ID: Date: Fri, 5 Feb 2021 15:51:30 +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: <6c05f6f35de09330538fbeca5d4c1c68964f108e.camel@fit.cvut.cz> 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-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 05 Feb 2021 14:51:33 -0000 I did not knew this one :) Even better, looks like we are reaching a point where no one will be able to complain about a missing tiny function ;) Vincent. Le 05/02/2021 à 15:34, Jan Vrany a écrit : > On Fri, 2021-02-05 at 15:28 +0100, vincent Dupaquis wrote: >> 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. > I have not tried, but I believe you can implement new convenience > function in Python that would allow you to write something like > > $ENV("MY_ENV_VARIABLE") > > See > https://sourceware.org/gdb/onlinedocs/gdb/Functions-In-Python.html#Functions-In-Python > > HTH, Jan > >> Vincent. >> >> Le 05/02/2021 à 15:06, Paul Koning a écrit : >>>> On Feb 5, 2021, at 4:58 AM, vincent Dupaquis < >>>> v.dupaquis@trusted-objects.com> 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