From: Zack Weinberg <zackw@panix.com>
To: libc-alpha@sourceware.org, gdb@sourceware.org
Cc: joseph@codesourcery.com, fweimer@redhat.com, tom@tromey.com,
siddhesh@gotplt.org
Subject: [RFC PATCH 0/3] Pretty-printing for errno
Date: Thu, 22 Jun 2017 22:45:00 -0000 [thread overview]
Message-ID: <20170622224456.1358-1-zackw@panix.com> (raw)
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
next reply other threads:[~2017-06-22 22:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 22:45 Zack Weinberg [this message]
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
[not found] ` <2432779a-f146-1612-236e-84dde15c5d01@redhat.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170622224456.1358-1-zackw@panix.com \
--to=zackw@panix.com \
--cc=fweimer@redhat.com \
--cc=gdb@sourceware.org \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@gotplt.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox