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: [RFC v2] Pretty printers for NPTL lock types


>> Putting newlines into the output seems like it will make the display
>> look strange in gdb in some circumstances.
>> 
>> For example, what happens if the printer triggers during a backtrace?
>> Or if the mutex is nested (perhaps several layers deep) inside other
>> structures (with "set print pretty on")?

Martin> What about adding semicolons instead of newlines? That way the output
Martin> would be something like:

Martin> {Type: Normal; Status: Locked, no waiters; Owner ID: XXXX (dead); The
Martin> state protected by this mutex is inconsistent; Attributes: {Robust;
Martin> Private; Protocol: None} }

In the past, when there is a lot of data, what I've preferred is to make
the toString method return just a summary of some important bits (say,
the type) and then delegate the remaining information to children.  It's
a trade-off of course.  Stuff too much into toString and stack traces
and such become harder to read.  But, don't put enough in there and
ordinary use is a pain.

Tom


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