Re: Regression for --batch [Re: [RFC] Make python/lib/gdb and submodules proper Python modules]

Khoo Yit Phang
2012-09-14T06:00:32Z

Hi Jan,

On Sep 14, 2012, at 1:47 AM, Jan Kratochvil wrote:

> Hi Yit,
>
> On Thu, 13 Sep 2012 23:51:08 +0200, Khoo Yit Phang wrote:
>> Thanks, I've checked in the patch.
>
> $ ./gdb --batch
> Python Exception <type 'exceptions.NameError'> name 'os' is not defined:
>
> warning: Could not load the Python gdb module from `/usr/share/gdb/python'.
>
> warning: Limited Python support is available from the _gdb module.

Is ./gdb from a GDB build directory? If so, the error is expected; you'd need to run with -data-directory build-directory/gdb/data-directory, since much of the Python initialization has been moved into data-directory/python/gdb/__init__.py, and the old __init__.py is incompatible.

Yit
September 14, 2012