Re: Getting access to environement variables
vincent Dupaquis <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
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 <
>>>> [email protected]> 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 <http://www.trusted-objects.com>