Re: [PATCH] Warn about data-directory when failing to import Python "gdb" module

Khoo Yit Phang
2012-09-18T15:38:10Z

Hi,

On Sep 18, 2012, at 7:58 AM, Jan Kratochvil wrote:

> On Tue, 18 Sep 2012 08:17:29 +0200, Eli Zaretskii wrote:
>> Is it possible to make GDB find its data-directory when it is run from
>> the directory where it was built?
>
> relocate_gdb_directory call could be adjusted to handle data-directory also in
> the GDB build directory.

If I understand relocate_gdb_directory, it already tries to relocate data-directory from /usr/local/share/gdb (GDB_DATADIR on my config) to build-directory/gdb/../share/gdb. Could we move the build-directory/gdb/data-directory there?

Otherwise, do you mean to change relocate_gdb_directory to specially check for GDB_DATADIR and replace it with buiid-directory/gdb/data-directory? That could lead to the odd possibility that an installed GDB would look for data-directory in a stray build directory. I suppose this can be prevented by checking if gdb_program_name is itself located in build-directory.

Yit
September 18, 2012