[PATCH 00/22] Convert ui-out subsystem to C++

Simon Marchi
2016-11-24T15:24:44Z

Hi all,

This patchset converts the various data structures of the ui-out susbsystem to
C++ classes. Except when stated otherwise, the goal is to preserve the same
structure, which was already very class-like, and the same behaviour. There
are also a few cleanup patches here and there.

The patch "Class-ify ui_out" introduces many clang -Wmismatched-tags warnings,
which John aimed to fix in another series. I am preparing a patch that fixes
them, but since it will only be boring and mechanical changes, I didn't want to
delay the submission of this series further.

The series is also available here:

https://github.com/simark/binutils-gdb/tree/cxx-ui-out-v1

Simon

Simon Marchi (22):
Remove unused functions and declarations
Rename ui_out_data to mi_ui_out_data
Remove ui_out_destroy
Fix return value of uo_redirect
Constify wrap_here/wrap_hint code path
Remove verbosity from ui_out_message and friends
Remove stale comments
Use new/delete instead of malloc/free-based functions
Use std::vector for ui_out::levels
Use std::vector for mi_ui_out_data::streams
Use std::vector for cli_ui_out_data::streams
Use std::string in ui_out_table
Replace hand-made linked list of ui_out_hdr by vector and iterator
Use std::string for ui_out_hdr's text fields
Class-ify ui_out_hdr
Class-ify ui_out_level
Simplify ui-out level code
ui_out_table: Replace boolean flag with enum
Class-ify ui_out_impl
Class-ify ui_out_table
Class-ify ui_out
Introduce enum_flag type for ui_out flags

gdb/ada-lang.c | 47 ++-
gdb/ada-tasks.c | 63 ++-
gdb/auto-load.c | 29 +-
gdb/break-catch-sig.c | 16 +-
gdb/break-catch-syscall.c | 40 +-
gdb/break-catch-throw.c | 52 ++-
gdb/breakpoint.c | 592 +++++++++++++--------------
gdb/cli-out.c | 321 +++++----------
gdb/cli-out.h | 77 ++--
gdb/cli/cli-cmds.c | 2 +-
gdb/cli/cli-logging.c | 12 +-
gdb/cli/cli-script.c | 84 ++--
gdb/cli/cli-setshow.c | 14 +-
gdb/cp-abi.c | 22 +-
gdb/darwin-nat-info.c | 48 +--
gdb/disasm.c | 51 ++-
gdb/gdb_bfd.c | 16 +-
gdb/guile/scm-breakpoint.c | 4 +-
gdb/guile/scm-ports.c | 2 +-
gdb/i386-linux-tdep.c | 25 +-
gdb/i386-tdep.c | 32 +-
gdb/infcmd.c | 32 +-
gdb/inferior.c | 37 +-
gdb/infrun.c | 94 +++--
gdb/interps.c | 4 +-
gdb/linespec.c | 2 +-
gdb/linux-thread-db.c | 17 +-
gdb/mi/mi-cmd-env.c | 9 +-
gdb/mi/mi-cmd-file.c | 32 +-
gdb/mi/mi-cmd-info.c | 12 +-
gdb/mi/mi-cmd-stack.c | 12 +-
gdb/mi/mi-cmd-var.c | 77 ++--
gdb/mi/mi-interp.c | 81 ++--
gdb/mi/mi-main.c | 149 ++++---
gdb/mi/mi-out.c | 351 ++++++----------
gdb/mi/mi-out.h | 70 +++-
gdb/mi/mi-symbol-cmds.c | 5 +-
gdb/osdata.c | 10 +-
gdb/probe.c | 67 ++-
gdb/progspace.c | 20 +-
gdb/python/py-breakpoint.c | 6 +-
gdb/python/py-framefilter.c | 88 ++--
gdb/record-btrace.c | 44 +-
gdb/remote.c | 4 +-
gdb/skip.c | 44 +-
gdb/solib.c | 39 +-
gdb/source.c | 31 +-
gdb/spu-tdep.c | 124 +++---
gdb/stack.c | 84 ++--
gdb/symfile.c | 45 +-
gdb/thread.c | 100 ++---
gdb/top.c | 2 +-
gdb/tracepoint.c | 146 +++----
gdb/tui/tui-out.c | 156 +++----
gdb/tui/tui.h | 2 +-
gdb/ui-out.c | 973 +++++++++++++++-----------------------------
gdb/ui-out.h | 320 +++++++--------
gdb/utils.c | 8 +-
gdb/utils.h | 2 +-
59 files changed, 2151 insertions(+), 2697 deletions(-)

--
2.10.0