aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2016-12-01 16:20:02 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2016-12-01 16:20:35 -0500
commit36d18bc526b055be896d8dc319cb3ade42238534 (patch)
treeeb2dea0c1b2051112d8cc8a8c3dd5b1bd6d2174f /gdb/gdb.h
parent77a179e77b38161e461f5e37512f0b3fc3582181 (diff)
downloadgdb-36d18bc526b055be896d8dc319cb3ade42238534.zip
gdb-36d18bc526b055be896d8dc319cb3ade42238534.tar.gz
gdb-36d18bc526b055be896d8dc319cb3ade42238534.tar.bz2
Class-ify ui_out_table
This patch makes a class out of the ui_out_table structure, the structure responsible for managing the generation of an UI table. To simplify the ui_out_table object, I changed it so that it can only be used for generating a single object. Instead of clearing the header list when starting a new table, we an ui_out_table when starting a table and delete it when we're done. Therefore, the checks: if (uiout->table->flag) if (!uiout->table->flag) are respectively replaced with if (uiout->table != nullptr) if (uiout->table == nullptr) Note: I removed the check at the beginning of ui_out_begin, because there is an equivalent check at the beginning of verify_field. New in v2: - use "enum class" for ui_out_table::state and update references. gdb/ChangeLog: * ui-out.c (enum ui_out_table_state): Move to class ui_out_table as ui_out_table::state. (struct ui_out_table): Change to ... (class ui_out_table): ... this. <flag>: Remove. <entry_level>: Rename to ... <m_entry_level>: ... this. <columns>: Rename to ... <m_nr_cols>: ... this. <id>: Rename to ... <m_id>: ... this. <headers>: Rename to ... <m_headers>: ... this. <headers_iterator>: Rename to ... <m_headers_iterator>: ... this. <start_body, append_header, start_row, get_next_header, query_field, current_state, entry_level>: New methods. (struct ui_out) <table>: Change type to unique_ptr to ui_out_table. (append_header_to_list, get_next_header, clear_header_list, clear_table): Remove. (ui_out_table_begin): Instantiate ui_out_table object. Update table check. (ui_out_table_body): Update table check, replace code with call to ui_out_table::start_body. (ui_out_table_end): Update table check, replace manual cleanup with assignment of uiout->table unique_ptr to nullptr. (ui_out_table_header): Update table check, replace call to append_header_to_list with call to append_header method. (ui_out_begin): Remove one table state check, update another. Replace code with call to start_row method. (verify_field): Update table checks. (ui_out_query_field): Update table check, replace code with call to query_field method. (ui_out_new): Remove table initialization code.
Diffstat (limited to 'gdb/gdb.h')
0 files changed, 0 insertions, 0 deletions