public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Pretty-printing for errno
@ 2017-06-22 22:45 Zack Weinberg
  2017-06-22 22:45 ` [PATCH 1/3] Improve testing of GDB pretty-printers Zack Weinberg
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: Zack Weinberg @ 2017-06-22 22:45 UTC (permalink / raw)
  To: libc-alpha, gdb; +Cc: joseph, fweimer, tom, siddhesh

My 'headers cleanups' patch series included an attempt to generalize
the Hurd's error_t to all supported host environments.  It was
suggested that the job it does is maybe better suited to a GDB
pretty-printer.  This patch series attempts to do that.

I say 'attempts' because it only _almost_ works, but the remaining
problems appear to be GDB bugs.  The most important of these is that
if error_t is a typedef name for int,

(gdb) p (error_t) 1

will _not_ invoke the pretty-printer for error_t.  Bizarrely, the same
pretty-printer _does_ get invoked when you print an _array_ of error_t
quantities.

Also, GDB 7.12 and 8.0 as packaged for Debian on amd64 cannot access
thread-local variables (which I find very surprising, but there it is)
and this sometimes, but not always, interferes with access to errno.

I have written this patchset so that it can go in in advance of these
bugs being fixed in GDB -- specifically, the test for the
pretty-printer checks for both bugs and marks itself as UNSUPPORTED if
they manifest.  It might make sense to wait at least for the bugs to
be fixed in GDB trunk, so we can make sure the test _does_ pass when a
fixed GDB is available; but I could also see putting it in now and
fixing it up later if necessary.

The patch series has been tested on x86-64-linux.  It touches a
nontrivial amount of Hurd-specific code but has _not_ been tested
there, even in cross-compilation (I am happy to attempt this if
someone can point me at step-by-step instructions); but I did make
sure that both errnos.awk and hurd-add-errno-constants.awk do the
right thing when run manually.

Siddhesh, given the short remaining time before the freeze I would like
to ask you to quickly decide whether you think this is worth trying to
get into 2.26 or if it should wait for the next release.

zw

Zack Weinberg (3):
  Improve testing of GDB pretty-printers.
  Make error_t always int; make __errno_location return an __error_t.
  Add pretty-printer for errno.

 Rules                                          |   4 +
 bits/errno.h                                   |  13 +-
 csu/errno-loc.c                                |   2 +-
 csu/errno.c                                    |   4 +-
 include/errno.h                                |   6 +-
 scripts/test_printers_common.py                |  84 +++--
 stdlib/Makefile                                |  38 ++
 stdlib/errno-printer.py                        | 105 ++++++
 stdlib/errno.h                                 |  12 +-
 stdlib/make-errno-constants.awk                |  66 ++++
 stdlib/test-errno-constants.py                 |  58 ++++
 stdlib/test-errno-printer.c                    |  43 +++
 stdlib/test-errno-printer.py                   |  71 ++++
 sysdeps/mach/hurd/Makefile                     |  10 +
 sysdeps/mach/hurd/bits/errno.h                 | 457 +++++++------------------
 sysdeps/mach/hurd/dl-sysdep.c                  |   3 +-
 sysdeps/mach/hurd/errno-loc.c                  |   2 +-
 sysdeps/mach/hurd/errno.c                      |   1 -
 sysdeps/mach/hurd/errnos.awk                   | 109 ++----
 sysdeps/mach/hurd/hurd-add-errno-constants.awk |  80 +++++
 20 files changed, 696 insertions(+), 472 deletions(-)
 create mode 100644 stdlib/errno-printer.py
 create mode 100644 stdlib/make-errno-constants.awk
 create mode 100644 stdlib/test-errno-constants.py
 create mode 100644 stdlib/test-errno-printer.c
 create mode 100644 stdlib/test-errno-printer.py
 delete mode 100644 sysdeps/mach/hurd/errno.c
 create mode 100644 sysdeps/mach/hurd/hurd-add-errno-constants.awk

-- 
2.11.0

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2017-09-18 14:28 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-22 22:45 [RFC PATCH 0/3] Pretty-printing for errno Zack Weinberg
2017-06-22 22:45 ` [PATCH 1/3] Improve testing of GDB pretty-printers Zack Weinberg
2017-06-22 22:46 ` [PATCH 2/3] Make error_t always int; make __errno_location return an __error_t Zack Weinberg
2017-06-22 22:46 ` [PATCH 3/3] Add pretty-printer for errno Zack Weinberg
2017-06-29 15:48 ` [RFC PATCH 0/3] Pretty-printing " Phil Muldoon
2017-06-29 16:53   ` Pedro Alves
2017-06-29 17:02     ` Pedro Alves
2017-06-29 17:28       ` Pedro Alves
2017-06-30  0:28         ` Zack Weinberg
2017-06-30 16:38           ` Pedro Alves
2017-06-30 16:47             ` Pedro Alves
2017-06-30 17:27             ` Zack Weinberg
2017-06-30 18:11               ` Pedro Alves
2017-07-01 11:56                 ` Pedro Alves
2017-07-13  2:30                 ` Pedro Alves
2017-09-04 21:25                   ` Pedro Alves
2017-09-05 21:15                     ` Zack Weinberg
2017-09-05 22:32                       ` Pedro Alves
2017-09-06 13:05                         ` Zack Weinberg
2017-09-06 13:32                           ` Pedro Alves
2017-09-06 21:03                             ` Zack Weinberg
2017-09-07 11:34                               ` Pedro Alves
2017-09-13 11:22                                 ` Using libthread_db.so with single-threaded programs, for TLS access (was: Re: [RFC PATCH 0/3] Pretty-printing for errno) Pedro Alves
2017-09-13 19:27                                   ` Philippe Waroquiers
2017-09-14  0:02                                   ` Using libthread_db.so with single-threaded programs, for TLS access Pedro Alves
2017-09-18 13:17                                     ` Carlos O'Donell
2017-09-18 14:28                                       ` Pedro Alves
2017-07-01 14:35               ` [RFC PATCH 0/3] Pretty-printing for errno Siddhesh Poyarekar
2017-07-04 15:54                 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).