binutils-gdb/gdb/common
Tom Tromey d4b0bb186e Remove some ui_out-related cleanups from Python
This patch introduces a bit of infrastructure -- namely, a minimal
std::optional analogue called gdb::optional, and an RAII template
class that works like make_cleanup_ui_out_tuple_begin_end or
make_cleanup_ui_out_list_begin_end -- and then uses these in the
Python code.  This removes a number of cleanups and generally
simplifies this code.

std::optional is only available in C++17.  Normally I would have had
this code check __cplusplus, but my gcc apparently isn't new enough to
find <optional>, even with -std=c++1z; so, because I could not test
it, the patch does not do this.

gdb/ChangeLog
2017-02-10  Tom Tromey  <tom@tromey.com>

	* ui-out.h (ui_out_emit_type): New class.
	(ui_out_emit_tuple, ui_out_emit_list): New typedefs.
	* python/py-framefilter.c (py_print_single_arg): Use gdb::optional
	and ui_out_emit_tuple.
	(enumerate_locals): Likewise.
	(py_mi_print_variables, py_print_locals, py_print_args): Use
	ui_out_emit_list.
	(py_print_frame): Use gdb::optional, ui_out_emit_tuple,
	ui_out_emit_list.
	* common/gdb_optional.h: New file.
2017-02-10 12:24:31 -07:00
..
agent.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
agent.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ax.def update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
break-common.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
btrace-common.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
btrace-common.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
buffer.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
buffer.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cleanups.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
cleanups.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-debug.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-debug.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-defs.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-exceptions.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-exceptions.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-regcache.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-regcache.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-types.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-utils.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common-utils.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common.host update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
common.m4 update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
create-version.sh update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
enum-flags.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
errors.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
errors.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fileio.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
fileio.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
filestuff.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
filestuff.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
format.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
format.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_assert.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_locale.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_optional.h Remove some ui_out-related cleanups from Python 2017-02-10 12:24:31 -07:00
gdb_ref_ptr.h Use class to manage BFD reference counts 2017-01-10 19:14:10 -07:00
gdb_setjmp.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_signals.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_sys_time.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_unique_ptr.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_unlinker.h Introduce and use gdb::unlinker 2017-01-10 19:14:11 -07:00
gdb_vecs.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_vecs.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
gdb_wait.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
host-defs.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
mingw-strerror.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
new-op.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
posix-strerror.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
print-utils.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
print-utils.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ptid.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
ptid.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
queue.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
rsp-low.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
rsp-low.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
run-time-clock.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
run-time-clock.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
scoped_restore.h gdb: make_scoped_restore and types convertible to T 2017-01-31 17:56:35 +00:00
signals-state-save-restore.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signals-state-save-restore.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
signals.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
symbol.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
vec.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
vec.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
version.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
x86-xstate.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
xml-utils.c update copyright year range in GDB files 2017-01-01 10:52:34 +04:00
xml-utils.h update copyright year range in GDB files 2017-01-01 10:52:34 +04:00