This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/12227] New: -np needed to fix unreliable gdb.python/testsuite results


http://sourceware.org/bugzilla/show_bug.cgi?id=12227

           Summary: -np needed to fix unreliable gdb.python/ testsuite
                    results
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jan.kratochvil@redhat.com


As a reproducer: Fedora 14 x86_64 system with gdb-7.2-23.fc14.x86_64 .
That means
  /usr/share/gdb/python/gdb/__init__.py
exists but
  /usr/share/gdb/python/gdb/command/pretty_printers.py
does not exist.

With FSF GDB HEAD 7.2.50.20101117-cvs on such system:
  ./configure --with-gdb-datadir=/usr/share/gdb
  make
  ./gdb/gdb -nx
  (gdb) set data-directory ./gdb/data-directory
  (gdb) python GdbSetPythonDirectory ('./gdb/data-directory/python')
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "<string>", line 48, in GdbSetPythonDirectory
    File "./gdb/data-directory/python/gdb/__init__.py", line 16, in <module>
      import gdb.command.pretty_printers
  ImportError: No module named pretty_printers
  Error while executing Python code.
  (gdb) q

The function gdb/testsuite/lib/gdb-python.exp gdb_check_python_config cannot
work as after the system Python scripts area already loaded it tries to:
        verbose -log "Installing system config from build tree."
        set gdb_data_dir "[pwd]/../data-directory"
        gdb_test_no_output "set data-directory $gdb_data_dir"
        gdb_test_no_output "python GdbSetPythonDirectory
('$gdb_data_dir/python')"

Even if Python modules can get unloaded this way still incompatible Python
system GDB modules could break a testsuite run for new GDB.

http://sourceware.org/gdb/wiki/2010_GCC_Summit_BoF
 * Testscase that test command completion, might be affected.
   * Do we want a new command-line option -np to deactivate this auto-loading?
   * Or should -nx turn off Python?

(I may have been pushing for -nx.)  But I see I use _always_ GDB with -nx as
packages contain unexpected .gdbinit  while I should normally use the Python
extensions so there should be some different option for it.

IMO the testsuite should always use this system-python-scripts disable and the
testfiles needing initialized python should load it by lib/gdb-python.exp .

I tried to patch it in but I see there more Python initialization decisions
need to be made in such patch.


Currently it causes:
Running gdb/testsuite/gdb.python/py-pp-maint.exp ...
PASS: gdb.python/py-pp-maint.exp: set data-directory
build-i686-redhat-linux-gnu/gdb/testsuite.unix.-m32/../data-directory
FAIL: gdb.python/py-pp-maint.exp: python GdbSetPythonDirectory
('build-i686-redhat-linux-gnu/gdb/testsuite.unix.-m32/../data-directory/python')
PASS: gdb.python/py-pp-maint.exp: b 67
PASS: gdb.python/py-pp-maint.exp: continue
FAIL: gdb.python/py-pp-maint.exp: info pretty-printer
FAIL: gdb.python/py-pp-maint.exp: info pretty-printer global .*function
FAIL: gdb.python/py-pp-maint.exp: info pretty-printer .* pp-test
PASS: gdb.python/py-pp-maint.exp: print flt enabled #1
PASS: gdb.python/py-pp-maint.exp: print ss enabled #1
FAIL: gdb.python/py-pp-maint.exp: disable pretty-printer
FAIL: gdb.python/py-pp-maint.exp: disable pretty-printer global
FAIL: gdb.python/py-pp-maint.exp: disable pretty-printer global
lookup_function_lookup_test
FAIL: gdb.python/py-pp-maint.exp: disable pretty-printer global pp-test:.*
FAIL: gdb.python/py-pp-maint.exp: info pretty-printer global .*function
FAIL: gdb.python/py-pp-maint.exp: info pretty-printer .* pp-test
FAIL: gdb.python/py-pp-maint.exp: print flt disabled
FAIL: gdb.python/py-pp-maint.exp: print ss disabled
FAIL: gdb.python/py-pp-maint.exp: enable pretty-printer global
lookup_function_lookup_test
FAIL: gdb.python/py-pp-maint.exp: enable pretty-printer global pp-test
FAIL: gdb.python/py-pp-maint.exp: enable pretty-printer global pp-test:.*ss.*
FAIL: gdb.python/py-pp-maint.exp: enable pretty-printer global pp-test:.*s.*
FAIL: gdb.python/py-pp-maint.exp: info pretty-printer
PASS: gdb.python/py-pp-maint.exp: print flt re-enabled
PASS: gdb.python/py-pp-maint.exp: print ss re-enabled

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]