aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
AgeCommit message (Collapse)AuthorFilesLines
2019-09-20Change TUI window commands to be case-sensitiveTom Tromey2-95/+67
The TUI window-related commands like "focus" are case insensitive. This is not the norm in gdb, and I don't see a good reason to have it here. This patch changes the TUI to be case sensitive, like the rest of gdb. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * NEWS: Mention case-sensitivity of TUI commands. * tui/tui-win.c (tui_set_focus_command): Now case-sensitive. (tui_set_win_height_command, parse_scrolling_args): Likewise. * tui/tui-layout.c (tui_layout_command): Now case-sensitive.
2019-09-20Use make_unique_xstrdup in TUITom Tromey2-2/+2
This changes a couple of spots in the TUI to use make_unique_xstrdup. This simplifies the code slightly. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-source.c (tui_source_window::set_contents): Use make_unique_xstrdup. * tui/tui-disasm.c (tui_disasm_window::set_contents): Use make_unique_xstrdup.
2019-09-20Remove separator comments from TUITom Tromey4-55/+0
This removes various separator comments from the TUI. These aren't used elsewhere in gdb, and they were incorrect in some cases as well. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-data.c: Remove separator comments. * tui/tui-layout.c: Remove separator comments. * tui/tui-win.c: Remove separator comments. * tui/tui-wingeneral.c: Remove separator comments.
2019-09-20Remove strcat_to_bufTom Tromey2-15/+0
An earlier patch in the series removed the last call to strcat_to_buf, so this patch removes the function entirely. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui.h (strcat_to_buf): Don't declare. * tui/tui.c (strcat_to_buf): Remove.
2019-09-20Rename a private data member in tui_source_windowTom Tromey2-4/+4
This renames tui_source_window::fullname to add the "m_" prefix, as it is a private data member. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-source.h (struct tui_source_window) <m_fullname>: Rename from "fullname". * tui/tui-source.c (tui_source_window::set_contents) (tui_source_window::location_matches_p) (tui_source_window::maybe_update): Update.
2019-09-20Rename private data members of tui_data_windowTom Tromey2-36/+36
As Pedro suggested, this patch renames the private data members of tui_data_window to use the "m_" prefix. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <get_current_group>: Update. <m_regs_content, m_regs_column_count, m_current_group>: Add "m_" prefix. * tui/tui-regs.c (tui_data_window::last_regs_line_no) (tui_data_window::line_from_reg_element_no) (tui_data_window::first_reg_element_no_inline) (tui_data_window::show_registers) (tui_data_window::show_register_group) (tui_data_window::display_registers_from) (tui_data_window::display_registers_from_line) (tui_data_window::first_data_item_displayed) (tui_data_window::delete_data_content_windows) (tui_data_window::erase_data_content) (tui_data_window::do_scroll_vertical) (tui_data_window::refresh_window) (tui_data_window::check_register_values): Update.
2019-09-20Change members of tui_locator_window to std::stringTom Tromey3-21/+11
This changes two members of tui_locator_window to have type std::string. This removes a static limit. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN): Remove define. (struct tui_locator_window) <full_name, proc_name>: Now std::string. * tui/tui-stack.c (tui_locator_window::make_status_line) (tui_locator_window::set_locator_fullname) (tui_locator_window::set_locator_info): Update. * tui/tui-source.c (tui_source_window::set_contents) (tui_source_window::showing_source_p): Update.
2019-09-20Remove a call to tui_locator_win_info_ptrTom Tromey1-4/+2
Commit e594a5d1 ("Turn two locator functions into methods") turned set_locator_fullname into a method on tui_locator_window. I missed it at the time, but this change allows for the removal of a call to tui_locator_win_info_ptr. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_locator_window::set_locator_fullname): Don't call tui_locator_win_info_ptr.
2019-09-20Don't call refresh in tui_resize_allTom Tromey1-1/+0
There's no reason to call refresh in tui_resize_all. This call flushes the curses window contents to the terminal -- but, because we're about the resize all the windows, we're going to be sending more data to the terminal momentarily. This patch removes the call. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_resize_all): Don't call refresh.
2019-09-20Set TUI locator height to 1Tom Tromey3-17/+11
The TUI has long had code to resize the locator, using 2 as the height. However the code has "1" in a comment, like: locator->resize (2 /* 1 */ , This patch fixes the resizing code to set the height to 1. Doing this revealed what was probably the reason for setting the height to 2 in the first place: this caused the locator window to scroll. However, this is easily handled by calling scrollok on the locator window. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use 1 as height for locator. * tui/tui-stack.c (tui_locator_window::rerender): Call scrollok. * tui/tui-layout.c (show_source_disasm_command, show_data) (show_source_or_disasm_and_command): Use 1 as height for locator.
2019-09-20Change "win_resized" to boolTom Tromey4-9/+9
This changes the "win_resized" global to be a bool and then updates the uses. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_enable): Update. * tui/tui-win.c (tui_sigwinch_handler, tui_async_resize_screen): Update. * tui/tui-data.h (tui_win_resized, tui_set_win_resized_to): Update. * tui/tui-data.c (win_resized): Now bool. (tui_win_resized): Return bool. (tui_set_win_resized_to): Accept a bool.
2019-09-20Use "bool" in tui_data_window::show_register_groupTom Tromey2-3/+3
This changes tui_data_window::show_register_group to use "bool" rather than "int". gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <show_register_group>: Change type of "refresh_values_only". * tui/tui-regs.c (tui_data_window::show_register_group): Change type of "refresh_values_only".
2019-09-20Simplify TUI disassemblyTom Tromey1-45/+26
This simplifies TUI disassembly somewhat, by removing manual memory management. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-disasm.c (struct tui_asm_line) <addr_string, insn>: Now std::string. (tui_disassemble): Add "pos" parameter. (tui_disasm_window::set_contents): Simplify.
2019-09-20Simplify tui_source_window_base::show_source_contentTom Tromey2-10/+6
tui_source_window_base::show_source_content is not used outside the class any more, so this makes it private. Examining the callers shows that it can't be called without source contents, so it can be simplified as well. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <show_source_content>: Now private. * tui/tui-winsource.c (tui_source_window_base::show_source_content): Don't handle empty content case.
2019-09-20Remove some explicit re-rendering from the TUITom Tromey1-4/+0
A couple of spots in tui-layout.c still call the show_source_content method. However, now that re-rendering is done by the resize method, these calls are no longer needed. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_source_disasm_command) (show_source_or_disasm_and_command): Don't call show_source_content.
2019-09-20Change tui_make_status_line to be a methodTom Tromey2-18/+20
This changes tui_make_status_line to be a method on tui_locator_window. This is a minor cleanup. This also changes the new method to use the locator's width, rather than the terminal width. This is important if we ever want to allow windows to be made more narrow. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (struct tui_locator_window) <make_status_line>: Declare. * tui/tui-stack.c (tui_locator_window::make_status_line): Rename from tui_make_status_line. (tui_locator_window::rerender): Update.
2019-09-20Change tui_make_status_line to return std::stringTom Tromey1-44/+25
This changes tui_make_status_line to return std::string. This cleans it up a bit, and removes some explicit memory management. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_make_status_line): Return std::string. (tui_locator_window::rerender): Update.
2019-09-20Move "fullname" to tui_source_windowTom Tromey4-13/+7
The "fullname" field in tui_source_window_base is only used by one subclass. This patch moves the field to that subclass, and changes it to be a unique_xmalloc_ptr. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <~tui_source_window_base>: Don't declare. <fullname>: Remove. * tui/tui-winsource.c (~tui_source_window_base): Remove. * tui/tui-source.h (struct tui_source_window) <fullname>: New member. * tui/tui-source.c (tui_source_window::set_contents): Update. (tui_source_window::location_matches_p) (tui_source_window::maybe_update): Update.
2019-09-20Change tui_source_element::line to be a unique_xmalloc_ptrTom Tromey4-16/+6
This changes tui_source_element::line to be a unique_xmalloc_ptr, removing some manual memory management. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (~tui_source_element): Remove. (tui_source_element): Update. (struct tui_source_element) <line>: Now a unique_xmalloc_ptr. * tui/tui-winsource.c (tui_show_source_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * tui/tui-disasm.c (tui_disasm_window::set_contents): Update.
2019-09-20Remove tui_clear_source_windows_detailTom Tromey5-25/+0
The calls to tui_clear_source_windows_detail in tui_add_win_to_layout aren't needed, because (after the resize unification) resizing will update the window contents. Removing these calls lets us remove several other things as well. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-data.h (tui_clear_source_windows_detail): Don't declare. * tui/tui-layout.c (tui_add_win_to_layout): Don't call tui_clear_source_windows_detail. * tui/tui-winsource.h (struct tui_source_window_base) <clear_detail>: Don't declare. * tui/tui-winsource.c (tui_source_window_base::clear_detail): Remove. * tui/tui-data.c (tui_clear_source_windows_detail): Remove.
2019-09-18Give a name to the TUI SingleKey keymapTom Tromey1-3/+6
Readline 8.0 has a feature that lets an application name a keymap. This in turn makes it simpler for users to bind keys in keymaps in their .inputrc. This patch gives a name to the TUI SingleKey keymap, so that additional bindings can be made there. For example: $if gdb set keymap SingleKey "X": "echo hello\\n\n" $endif The call to rl_initialize, in tui_initialize_readline, had to be removed so that .inputrc was not read too early. Note that Readline explicitly documents that this call is not needed. gdb/ChangeLog 2019-09-18 Tom Tromey <tom@tromey.com> * NEWS: Add entry. * tui/tui.c (tui_initialize_readline): Set name of keymap. Do not call rl_initialize. (tui_enable): Do not call rl_initialize. gdb/doc/ChangeLog 2019-09-18 Tom Tromey <tom@tromey.com> * gdb.texinfo (Editing): Document readline application name. (TUI Single Key Mode): Document TUI SingleKey keymap name.
2019-09-09Use ui_out for "info win"Tom Tromey1-6/+14
This changes the "info win" command to use ui-out. This yields somewhat nicer table output. gdb/ChangeLog 2019-09-09 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_all_windows_info): Use ui_out.
2019-09-08Truncate long TUI window titlesTom Tromey1-1/+15
If a TUI window has a long title, it can overflow the title line. This changes the TUI to use just the tail part of the title in this case. gdb/ChangeLog 2019-09-08 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Truncate long window titles. gdb/testsuite/ChangeLog 2019-09-08 Tom Tromey <tom@tromey.com> * gdb.tui/resize.exp: Remove setup_xfail. * gdb.tui/regs.exp: Remove setup_xfail. * gdb.tui/basic.exp: Remove setup_xfail.
2019-08-30Remove tui_win_info::refresh_allTom Tromey6-49/+0
The TUI has two duplicate "re-render this window" methods, "rerender" and "refresh_all". They differ only slightly in semantics, so I wanted to see if they could be unified. After looking into this, I decided that refresh_all was not needed. There are 4 calls to tui_refresh_all_win (the only caller of this method): 1. tui_enable. This sets the layout, which renders the windows. 2. tui_cont_sig. Here, I think it's sufficient to simply redraw the current window contents from the curses backing store, because gdb state didn't change while it was suspended 3. tui_dispatch_ctrl_char. This is the C-l handler, and here it's explicitly enough to just refresh the screen (as above). 4. tui_refresh_all_command. This is the command equivalent of C-l. So, this patch removes this method entirely and simplifies tui_refresh_all_win. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <refresh_all>: Don't declare. * tui/tui-winsource.c (tui_source_window_base::refresh_all): Remove. * tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or tui_show_locator_content. * tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't declare. * tui/tui-regs.c (tui_data_window::refresh_all): Remove. * tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't declare.
2019-08-30Don't call wrefresh from tui_cont_sigTom Tromey1-2/+0
tui_cont_sig does not need to call wrefresh, because this is already done by tui_refresh_all_win. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-io.c (tui_cont_sig): Don't call wrefresh.
2019-08-30Minor rearrangement of tui-stack.cTom Tromey1-13/+7
This move _initialize_tui_stack to the end of tui-stack.c, per the gdb style; and then removes two unnecessary forward declarations. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (_initialize_tui_stack): Move later. Remove unnecessary forward declarations.
2019-08-30Make tui_locator_window::set_locator_fullname re-renderTom Tromey1-3/+1
This changes tui_locator_window::set_locator_fullname to re-render the locator window, so that the callers don't need to do this. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_locator_window::set_locator_fullname): Call rerender. (tui_update_locator_fullname, tui_show_frame_info): Don't call tui_show_locator_content.
2019-08-30Swap tui_show_locator_content and tui_locator_window::rerenderTom Tromey1-21/+17
This swaps the bodies ot tui_show_locator_content and tui_locator_window::rerender, so that the latter does the work, and the former is now just an exported convenience wrapper. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_show_locator_content): Move lower. Rewrite. (tui_locator_window::rerender): Rewrite using body of previous tui_show_locator_content.
2019-08-30Turn two locator functions into methodsTom Tromey2-47/+49
This changes tui_set_locator_fullname and tui_set_locator_info to be methods on tui_locator_window. This enables some subsequent cleannups. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (struct tui_locator_window) <set_locator_info, set_locator_fullname>: New methods. * tui/tui-stack.c (tui_locator_window::set_locator_fullname): Rename from tui_set_locator_fullname. (tui_locator_window::set_locator_info): Rename from tui_set_locator_info. Return bool. (tui_update_locator_fullname, tui_show_frame_info): Update.
2019-08-30Don't call tui_refresh_all from show_layoutTom Tromey1-1/+0
show_layout calls tui_refresh_all in one case. However, it doesn't need to any more, because the resize method on each window will also update the contents. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_layout): Don't call tui_refresh_all.
2019-08-30Don't call touchwin in tui_gen_win_info::refresh_windowTom Tromey1-4/+1
The call to touchwin in tui_gen_win_info::refresh_window was an artifact of some earlier refactorings. Testing shows it isn't needed any more -- I believe it was only ever needed for the data item window display problem; but that's been solved more locally. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Don't call touchwin.
2019-08-30Remove NULL checks from box_winTom Tromey1-19/+16
box_win can't be called with a NULL window, or with an invisible window. So, the NULL checks in that function can be removed. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Assume win_info and win_info->handle cannot be NULL.
2019-08-30Simplify register displayTom Tromey3-58/+51
This patch starts with the observation that the code in tui_data_window::display_registers_from can all be replaced with a call to resize. To make this work propertly, it also changes tui_display_register to be the "rerender" method on tui_data_item_window. The refresh_window method is needed due to the use of nested windows here. The ncurses man page makes it sound like this is not very well supported; and experience bears this out: negelecting the touchwin call in this path will cause the register window to blank when switching focus. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_item_window) <rerender, refresh_window>: Declare. * tui/tui-regs.c (tui_data_window::display_registers_from): Call resize. (tui_data_item_window::rerender): Rename from tui_display_register. (tui_data_item_window::refresh_window): New method. * tui/tui-layout.c (tui_gen_win_info::resize): Do nothing on no-op.
2019-08-30Private data members in tui_data_windowTom Tromey3-7/+12
This changes tui_data_window so that the data members are private. This required the addition of a simple accessor method in one case. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <regs_content, regs_column_count, current_group>: Move later. Now private. <get_current_group>: New method. * tui/tui-regs.c (tui_reg_command): Update. * tui/tui-layout.c (tui_set_layout): Update.
2019-08-30Remove some calls in tui_data_windowTom Tromey1-7/+1
This patch removes a call to erase_data_content in refresh_all and then removes some other calls that are more clearly unnecessary once one follows calls from that point. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::display_registers_from_line) (tui_data_window::rerender): Don't call check_and_display_highlight_if_needed. (tui_data_window::refresh_all): Remove call to erase_data_content.
2019-08-30Remove some checks of .empty()Tom Tromey1-111/+96
A few methods in tui_data_window check whether the contents are empty; but all the callers already check this, so these calls can be removed. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::last_regs_line_no) (tui_data_window::display_registers_from) (tui_data_window::display_reg_element_at_line) (tui_data_window::display_registers_from_line): Remove checks of "empty".
2019-08-30Remove tui_data_window::display_all_dataTom Tromey2-20/+2
tui_data_window::rerender clears the data item windows, and then calls display_all_data. However, that method only does anything if the contents are not empty. So, display_all_data can be renamed and the wrapper removed. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <display_all_data>: Don't declare. * tui/tui-regs.c (tui_data_window::show_registers): Call rerender. (tui_data_window::rerender): Rename from display_all_data. (tui_data_window::rerender): Remove old implementation.
2019-08-30Remove NO_DATA_STRINGTom Tromey2-2/+1
NO_DATA_STRING shouldn't be used. It's referenced in a single spot, in tui_data_window::display_all_data. This patch removes the use and replaces it with the more correct text. A later patch (though not in this series) will remove this call entirely, when it's more obviously correct to do so. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::display_all_data): Change text. * tui/tui-data.h (NO_DATA_STRING): Remove define.
2019-08-21Fix g++ 9.1 build breakageChristian Biesinger1-0/+1
gdb/ChangeLog: 2019-08-21 Christian Biesinger <cbiesinger@google.com> * tui/tui-data.h (tui_gen_win_info): Add an =default move constructor, required by some GCC versions.
2019-08-20Change some tui_data_window methods to be privateTom Tromey1-30/+32
Turning various calls into methods has made it possible to now change some tui_data_window methods to be private. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <last_regs_line_no, line_from_reg_element_no, first_reg_element_no_inline, display_all_data, delete_data_content_windows, erase_data_content>: Now private.
2019-08-20Remove some defines from tui-data.hTom Tromey2-7/+5
This removes the HILITE and NO_HILITE defines from tui-data.h, in favor of simply passing a bool to box_win. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Change type of highlight_flag. (tui_unhighlight_win, tui_highlight_win) (tui_win_info::make_window): Update. * tui/tui-data.h (HILITE, NO_HILITE): Remove.
2019-08-20Move some defines to tui-stack.cTom Tromey2-11/+12
Some #defines in tui-data.h are only used in tui-stack.c, so move them there. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-data.h (PROC_PREFIX, LINE_PREFIX, PC_PREFIX) (MIN_LINE_WIDTH, MIN_PROC_WIDTH, MAX_TARGET_WIDTH) (MAX_PID_WIDTH): Move to tui-stack.c. * tui/tui-stack.c (PROC_PREFIX, LINE_PREFIX, PC_PREFIX) (MIN_LINE_WIDTH, MIN_PROC_WIDTH, MAX_TARGET_WIDTH) (MAX_PID_WIDTH): Move from tui-data.h.
2019-08-20Change tui_make_window to be a methodTom Tromey8-35/+27
I combined several small changes into one patch here. I believe I started by noticing that the "title" is not needed by tui_gen_win_info and could be self-managing (i.e. std::string). Moving this revealed that "can_box" is also a property of tui_win_info and not tui_gen_win_info; and this in turn caused the changes to tui_make_window and box_win. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.h (tui_make_window): Don't declare. * tui/tui-wingeneral.c (box_win): Change type of win_info. (box_win): Update. (tui_gen_win_info::make_window): Rename from tui_make_window. (tui_win_info::make_window): New method. (tui_gen_win_info::make_visible): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * tui/tui-regs.c (tui_data_window::show_register_group): Update. (tui_data_window::display_registers_from): Update. * tui/tui-layout.c (tui_gen_win_info::resize): Update. * tui/tui-data.h (struct tui_gen_win_info) <make_window>: Declare. <can_box>: Remove. <title>: Remove. (struct tui_win_info) <make_window>: Declare. <can_box>: Now virtual. <title>: New member. * tui/tui-data.c (~tui_gen_win_info): Don't free title. * tui/tui-command.c (tui_cmd_window::resize): Update.
2019-08-20Remove tui_data_window::display_regsTom Tromey2-7/+1
There's no need for tui_data_window::display_regs any more (if there ever was). All the paths through data window construction will end up setting this to true. This patch removes the member. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <display_regs>: Remove. * tui/tui-regs.c (tui_data_window::show_registers): Update. (tui_data_window::check_register_values): Update.
2019-08-20Remove indirection from tui_data_window::regs_contentTom Tromey2-34/+23
tui_data_window::regs_content is currently a vector of unique_ptr. However, due to the way this is managed now, there is no need to keep the pointers -- it can simply be a vector of the objects themselves. This patch removes this extra layer of indirection. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window): Use DISABLE_COPY_AND_ASSIGN. <regs_content>: Change type, removing unique_ptr. <tui_data_window>: Add move constructor. * tui/tui-regs.c (tui_data_window::show_registers) (tui_data_window::show_register_group) (tui_data_window::display_registers_from) (tui_data_window::display_registers_from) (tui_data_window::first_data_item_displayed) (tui_data_window::delete_data_content_windows) (tui_data_window::rerender, tui_data_window::refresh_window) (tui_data_window::check_register_values): Update.
2019-08-20Add two methods to tui_data_windowTom Tromey3-35/+30
This changes tui_show_registers and tui_show_register_group to be methods on tui_data_window. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <show_registers, show_register_group>: Declare. (tui_show_register_group): Don't declare. * tui/tui-regs.c (tui_data_window::show_registers): Rename from tui_show_registers. (tui_data_window::show_register_group): Rename from tui_show_register_group. (tui_data_window::check_register_values, tui_reg_command): Update. * tui/tui-layout.c (tui_set_layout): Update.
2019-08-20Change tui_check_register_values to be a methodTom Tromey3-20/+19
This changes tui_check_register_values to be a method on tui_data_window. An additional check in tui_register_changed is needed, because TUI_DATA_WIN could be NULL at this point. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <check_register_values>: Declare. (tui_check_register_values): Don't declare. * tui/tui-regs.c (tui_data_window::check_register_values): Rename from tui_check_register_values. * tui/tui-hooks.c (tui_register_changed): Update.
2019-08-20Rearrange tui-regs.c some moreTom Tromey1-23/+15
This moves tui_reg_layout later in tui-regs.c, closer to where it is used. It also changes tui_show_registers not to enable the TUI or change the layout -- this is already done by this point by all the callers. 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_reg_layout): Move later. (tui_show_registers): Don't enable TUI mode or change layout.
2019-08-20Change tui_data_item_window::content to be a unique_xmalloc_ptrTom Tromey4-36/+18
This changes tui_data_item_window::content to be a unique_xmalloc_ptr and fixes up the fallout. It also removes a parameter from tui_expand_tabs, as it was only ever given one value. This also removes some tab-handling code from tui_data_window::display_registers_from. Because the content can only be set by tui_register_format, and because that calls tui_expand_tabs, it's not possible to see a tab here. gdb/ChangeLog 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_item_window) <~tui_data_item_window>: Remove. <content>: Now a unique_xmalloc_ptr. * tui/tui-regs.c (tui_register_format): Return a unique_xmalloc_ptr. (tui_get_register): Update. (~tui_data_item_window): Remove. (tui_data_window::display_registers_from, tui_display_register): Update. * tui/tui-io.h (tui_expand_tabs): Update. * tui/tui-io.c (tui_expand_tabs): Return a unique_xmalloc_ptr. Remove "col" parameter.
2019-08-20Remove tui_data_item_window::valueTom Tromey2-2/+0
The field tui_data_item_window::value is not used, so remove it. gdb/ChangeLog 2019-08-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_item_window) <value>: Remove field. * tui/tui-regs.c (~tui_data_item_window): Update.