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] |
Hi again everyone, As requested, I've written a series of test cases for the pretty printers. Each lock type (mutex, condvar and rwlock) has two test programs, one for itself and other for its related 'attributes' object. Each test program in turn has a PExpect-based Python script that drives gdb and compares its output to the expected printer's. I'm attaching the test cases so you guys can start reviewing them; in the meanwhile I'll dwell further into the build system stuff. A few things to consider while reviewing this: * I use the 'GCC optimize' pargma to disable compiler optimizations. This is necessary because I rely on the C code structure being preserved when stepping through the programs. Things like aggressive instruction reordering or optimizing variables out will complicate the test scripts beyond my reach. * Each call to the pthread_* functions should be kept on a separate line. This is done so I can easily advance through the programs using the gdb 'next' command. * If you want to run the unit tests, I've included a small Makefile that will compile each program and run its corresponding script. You should have my printers (and its constants file) set to be loaded when gdb starts, e.g. by adding something like the following to .gdbinit: python import sys sys.path.insert(0, '/home/martin') end source /home/martin/nptl-printers.py I've also attached the newest version of the pretty printers and their constants. The last version I sent defined a Printer class which works exactly as gdb.RegexpCollectionPrettyPrinter except it could read through typedefs. I needed this because of a bug in the Python API which is fixed in the latest gdb. I also corrected a couple of mistakes and added the corresponding constants for the condvar's clock ID attribute.
Attachment:
printers.tar.gz
Description: GNU Zip compressed data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |