From 6d523660e9f9f18e6c497d2d882c644e9c1b1c29 Mon Sep 17 00:00:00 2001 From: Torvald Riegel Date: Fri, 20 Jan 2017 14:54:49 +0100 Subject: Fix mutex pretty printer test and pretty printer output. This fixes the mutex pretty printer so that, if the owner ID isn't recorded (such as in the current lock elision implementation), "Owner ID" will be shown as "Unknown" instead of 0. It also changes the mutex printer output so that it says "Acquired" instead of "Locked". The mutex tests are updated accordingly. In addition, this adds a paragraph to the "Known issues" section of the printers README explaining that the printer output isn't guaranteed to cover every detail. 2017-01-14 Martin Galvan * README.pretty-printers (Known issues): Warn about printers not always covering everything. * nptl/nptl-printers.py (MutexPrinter): Change output. * nptl/test-mutex-printers.py: Fix test and adapt to changed output. --- README.pretty-printers | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'README.pretty-printers') diff --git a/README.pretty-printers b/README.pretty-printers index a2536ca..2522cb8 100644 --- a/README.pretty-printers +++ b/README.pretty-printers @@ -29,7 +29,7 @@ However, with a pretty printer gdb will output something like this: (gdb) print mutex $1 = pthread_mutex_t = { Type = Normal, - Status = Unlocked, + Status = Not acquired, Robust = No, Shared = No, Protocol = Priority protect, @@ -145,6 +145,11 @@ any changes to the target code must also update the corresponding printers. On the plus side, the printer code itself may serve as a kind of documentation for the target code. +* There's no guarantee that the information the pretty printers provide is +complete, i.e. some details might be left off. For example, the pthread_mutex_t +printers won't report whether a thread is spin-waiting in an attempt to acquire +the mutex. + * Older versions of the gdb Python API have a bug where gdb.RegexpCollectionPrettyPrinter would not be able to get a value's real type if it was typedef'd. This would cause gdb to ignore the pretty printers for -- cgit v1.1