[PATCH] Use USERPROFILE environment variable to resolve home path on Windows

Tom Tromey tom@tromey.com
Mon Jun 15 14:04:05 GMT 2020


>>>>> "Christian" == Christian Biesinger via Gdb-patches <gdb-patches@sourceware.org> writes:

Christian> On Mon, Jun 1, 2020 at 10:50 PM Stephanos Ioannidis <root@stephanos.io> wrote:
>> --- a/gdb/auto-load.c
>> +++ b/gdb/auto-load.c
>> @@ -499,6 +499,10 @@ file_is_auto_load_safe (const char *filename, const char *debug_fmt, ...)
>> if (!advice_printed)
>> {
>> const char *homedir = getenv ("HOME");
>> +#ifdef _WIN32
>> +      if (homedir == NULL)
>> +       homedir = getenv ("USERPROFILE");
>> +#endif

Christian> You're adding this in a lot of places; probably better to add a helper
Christian> function in gdbsupport to return the home/userprofile directory?

Agreed; there's also a use of $HOME in gdbsupport, so presumably this
would have to be fixed as well anyway.

Tom


More information about the Gdb-patches mailing list