This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

Re: [PING][PATCH v9] Add pretty printers for the NPTL lock types


On 07/11/2016 05:00 PM, Siddhesh Poyarekar wrote:
On Mon, Jul 11, 2016 at 03:16:19PM +0200, Stefan Liebler wrote:
On that machine, I have installed python-pexpect-3.1-1.fc20.noarch.
I've tried python2-pexpect-4.0.1-4.fc23.noarch on another machine and you
are right, the "echo=False" issue does not appear.

But I get fails:
FAIL: pretty-printers/test-condvar-attributes-pp:
Error: Response does not match the expected pattern.
Command: print *attr
Expected pattern: pthread_condattr_t
Response: Python Exception <class 'gdb.error'> No struct type named
pthread_condattr.:

Python Exception <class 'gdb.error'> No struct type named pthread_condattr.:

$3 = {__size = "\000\000\000", __align = 0}
<snip>
The gdb version is gdb-7.10.1-30.fc23.s390x.

That's odd, it looks like the pretty printer is still not registered.
Have you set up your gdbinit to register the printer?

Yes I have setup ~/.gdbinit.
If I start gdb with test-mutex-printer and break at e.g. "return result" in main():

(gdb) info pretty-printer
global pretty-printers:
  builtin
    mpx_bound128
  glibc pthread locks
    pthread_cond_t
    pthread_condattr_t
    pthread_mutex_t
    pthread_mutexattr_t
    pthread_rwlock_t
    pthread_rwlockattr_t

(gdb) p	mutex
$1 = pthread_mutex_t = {Type = Adaptive, Status = Destroyed}

(gdb) p	attr
$2 = Python Exception <class 'gdb.error'> No struct type named pthread_mutexattr.: Python Exception <class 'gdb.error'> No struct type named pthread_mutexattr.:
{__size = "@\000\000\001", __align = 1073741825}

The packages now look like the same as my setup (since it seems we're
both on F23), so it seems to be something else.
I think the tests should also work with older versions of pexpect as e.g. RHEL 7 has an even older pexpect (version 2.3. But I don't tested it!).


Nevertheless is it possible to check the correct versions and warn
at configuring or mark the tests as unsupported if pexpect is not installed
or you have the false version?

Yes, that should be the correct way to do it.  I'm going to revert the
patch because it is not as isolated as I had thought.

Martin, so things for you to work on for the next iteration of the
patch:

1. Redirect test output to a file like other tests

2. Eliminate the need to use a .gdbinit because distributions will
    break without it.  I should have caught that but I was in too much
    of a hurry to get the patch in :/

3. Feature checking during configure to determine things like minimum
    required gdb version, python-pexpect version, etc. to make sure
    that tests work correctly.

You can split this into a series of patches, one with what you have
now (with the output redirection fixed), a second that eliminates
gdbinit use and a third that adds the configure checks.

Siddhesh



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