public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Rearrange tui-regs.c some more Date: Tue, 20 Aug 2019 22:49:00 -0000 [thread overview] Message-ID: <20190820224944.60313.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=42cc14a753e6edbcd43cdaa2dc2ee614a27aeeb2 commit 42cc14a753e6edbcd43cdaa2dc2ee614a27aeeb2 Author: Tom Tromey <tom@tromey.com> Date: Sat Jul 13 16:08:33 2019 -0600 Rearrange tui-regs.c some more 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. Diff: --- gdb/ChangeLog | 5 +++++ gdb/tui/tui-regs.c | 38 +++++++++++++++----------------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fd3c848..27fcb35 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 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-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. diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index a899b1d..147f57a 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -149,34 +149,11 @@ tui_data_window::first_reg_element_no_inline (int line_no) const return (-1); } -/* A helper function to display the register window in the appropriate - way. */ - -static void -tui_reg_layout () -{ - enum tui_layout_type cur_layout = tui_current_layout (); - enum tui_layout_type new_layout; - if (cur_layout == SRC_COMMAND || cur_layout == SRC_DATA_COMMAND) - new_layout = SRC_DATA_COMMAND; - else - new_layout = DISASSEM_DATA_COMMAND; - tui_set_layout (new_layout); -} - /* Show the registers of the given group in the data window and refresh the window. */ void tui_show_registers (struct reggroup *group) { - /* Make sure the curses mode is enabled. */ - tui_enable (); - - /* Make sure the register window is visible. If not, select an - appropriate layout. */ - if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->is_visible ()) - tui_reg_layout (); - if (group == 0) group = general_reggroup; @@ -676,6 +653,21 @@ tui_reg_prev (struct reggroup *current_group, struct gdbarch *gdbarch) return group; } +/* A helper function to display the register window in the appropriate + way. */ + +static void +tui_reg_layout () +{ + enum tui_layout_type cur_layout = tui_current_layout (); + enum tui_layout_type new_layout; + if (cur_layout == SRC_COMMAND || cur_layout == SRC_DATA_COMMAND) + new_layout = SRC_DATA_COMMAND; + else + new_layout = DISASSEM_DATA_COMMAND; + tui_set_layout (new_layout); +} + /* Implement the 'tui reg' command. Changes the register group displayed in the tui register window. Displays the tui register window if it is not already on display. */
reply other threads:[~2019-08-20 22:49 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190820224944.60313.qmail@sourceware.org \ --to=tromey@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).