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 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 CC: 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-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_05, 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:28:51 -0000 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