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

Khoo Yit Phang
2012-09-14T06:26:55Z

Hi Jan,

On Sep 14, 2012, at 2:15 AM, Jan Kratochvil wrote:

> On Fri, 14 Sep 2012 07:59:46 +0200, Khoo Yit Phang wrote:
>> 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.
>
> In such case there is a need to update gdb/contrib/cc-with-tweaks.sh .
>
> runtest CC_FOR_TARGET=/bin/sh\ $PWD/../contrib/cc-with-tweaks.sh\ -i\ gcc gdb.base/display.exp
> [...]
> Running ./gdb.base/display.exp ...
> gdb compile failed, 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.
> === gdb Summary ===
> # of untested testcases 1

How do you run this? I can't seem to figure it out:

% cd build-directory/gdb/testsuite
% runtest CC_FOR_TARGET=/bin/sh\ $PWD/../../../gdb/contrib/cc-with-tweaks.sh\ -i\ gcc gdb.base/display.exp
WARNING: No tool specified
Test Run By khooyp on Fri Sep 14 02:24:12 2012
Native configuration is i686-pc-linux-gnu

=== tests ===

Schedule of variations:
unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
WARNING: Couldn't find tool config file for unix, using default.

=== Summary ===

% cd source-directory/gdb/testsuite
% runtest CC_FOR_TARGET=/bin/sh\ $PWD/../contrib/cc-with-tweaks.sh\ -i\ gcc gdb.base/display.exp
WARNING: No tool specified
Test Run By khooyp on Fri Sep 14 02:22:07 2012
Native configuration is i686-pc-linux-gnu

=== tests ===

Schedule of variations:
unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ./config/unix.exp as tool-and-target-specific interface file.
`site.exp' not found, run `make site.exp'!
% make site.exp
remake: *** No rule to make target `site.exp'. Stop.

Yit
September 14, 2012