gcc/libstdc++-v3
Jonathan Wakely 36100e0e95 libstdc++: Make std::error_code printer more robust
This attempts to implement a partial workaround for the GDB bug
https://sourceware.org/bugzilla/show_bug.cgi?id=28856 which causes GDB
to crash when printing a frame with a std::error_code argument.

By recognising the known error categories defined in the library and
hardcoding their names we do not need to call cat->name() on the
category.  This has the additional benefit of also working when
debugging a core file rather than a running process. For those known
categories we can also cast the int value to the corresponding error
code enum (e.g. future_errc) so that we show an enumerator instead of
just an integer.

For program-defined categories we just use the name of the dynamic type
to identify the category, and print the value as an integer. Once the
GDB bug is fixed and the virtual name() function can be called safely,
that would be preferable. For now it's better to have an imperfect
printer that doesn't crash GDB.

This rewritten StdErrorCodePrinter needs gdb.Value.dynamic_type, so is
only registered if that is supported, which means GDB 7.7 and later.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Replace
	code that call cat->name() on std::error_category objects.
	Identify known categories by symbol name and use a hardcoded
	name. Print error code values as enumerators where appopriate.
	* testsuite/libstdc++-prettyprinters/cxx11.cc: Adjust expected
	name of custom category. Check io_errc and future_errc errors.
2022-02-17 22:22:14 +00:00
..
config libstdc++: Fix stream extraction of IEEE128 long double [PR100912] 2022-02-14 17:19:08 +00:00
doc libstdc++: Update documentation for C++17 deprecations 2022-01-19 00:58:26 +00:00
include libstdc++: Add missing constexpr to uses-allocator construction utilities [PR104542] 2022-02-15 12:49:34 +00:00
libsupc++ libstdc++: Add suggestion to std::uncaught_exception() warning 2022-02-04 15:26:59 +00:00
po libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
python libstdc++: Make std::error_code printer more robust 2022-02-17 22:22:14 +00:00
scripts libstdc++: Only add valid -L paths to testsuite linker options 2022-01-20 12:29:29 +00:00
src libstdc++: Fix std::to_chars for IEEE128 long double 2022-02-14 12:34:21 +00:00
testsuite libstdc++: Make std::error_code printer more robust 2022-02-17 22:22:14 +00:00
acinclude.m4 libstdc++: Add comment to acinclude.m4 2022-02-08 14:15:38 +00:00
aclocal.m4
ChangeLog Daily bump. 2022-02-16 00:16:26 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021
config.h.in libstdc++: Fix filesystem::remove_all races [PR104161] 2022-02-04 19:51:26 +00:00
configure libstdc++: Fix filesystem::remove_all races [PR104161] 2022-02-04 19:51:26 +00:00
configure.ac libstdc++: Remove -gdwarf-4 from flags for debug library 2022-01-19 19:31:00 +00:00
configure.host
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in libstdc++: Define <stacktrace> header for C++23 2022-01-17 12:13:02 +00:00
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.