* Re: [PATCH] gdb: Add new 'layout cli' command.
[not found] <cdefb1cb466c17bb9668b60f04fb1ea3b7bfe028.1432245947.git.andrew.burgess@embecosm.com>
@ 2015-05-22 0:29 ` Pedro Alves
2015-05-22 8:19 ` Andrew Burgess
2015-05-22 7:14 ` Eli Zaretskii
1 sibling, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2015-05-22 0:29 UTC (permalink / raw)
To: Andrew Burgess, gdb-patches
On 05/21/2015 11:06 PM, Andrew Burgess wrote:
> It always seemed a little strange to me that it's possible to enter
> TUI mode by typing commands at the CLI, but to leave TUI mode you need
> to know the readline bindings.
Agreed.
>
> This commit adds a new 'layout cli' command to leave tui mode, which
> is in addition to the readline bindings.
IIUC, "layout prev/next" doesn't cycle this layout. That seems odd.
I think it either should, or this should be a separate command.
A "layout cli" layout could reasonably be a layout that (with tui enabled)
only showed the console window, with status line at the top, similar to
"layout src; winheight src 3" (3 just because one can't go lower
than 3). I supposed we could leave room for adding that later by calling
this one e.g., "layout off".
I notice that we have no blessed way to go back to the same layout that
was current when the tui was last active. "layout current" would be odd,
given that the current is "cli"... Hmm, "layout last" (like "cd -")?
Not sure...
A separate command ("tui enable/disable"? "set tui enabled on/off"?)
would be a more direct mapping to the readline bindings.
What do you think?
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb: Add new 'layout cli' command.
2015-05-22 0:29 ` [PATCH] gdb: Add new 'layout cli' command Pedro Alves
@ 2015-05-22 8:19 ` Andrew Burgess
2015-05-22 8:38 ` Eli Zaretskii
2015-05-22 10:04 ` Pedro Alves
0 siblings, 2 replies; 5+ messages in thread
From: Andrew Burgess @ 2015-05-22 8:19 UTC (permalink / raw)
To: gdb-patches; +Cc: Pedro Alves, Eli Zaretskii
* Pedro Alves <palves@redhat.com> [2015-05-22 01:29:17 +0100]:
> I notice that we have no blessed way to go back to the same layout that
> was current when the tui was last active. "layout current" would be odd,
> given that the current is "cli"... Hmm, "layout last" (like "cd -")?
> Not sure...
>
> A separate command ("tui enable/disable"? "set tui enabled on/off"?)
> would be a more direct mapping to the readline bindings.
I'm happy with that. As a bonus this solves the above problem too, so
'tui enable' returns to the last active layout.
Eli, sorry, this revision renders your last doc review redundant.
Thanks,
Andrew
--
Add new commands to specifically enable and disable tui mode. This is
in addition to the readline bindings, but might be easier for a user to
discover if they accidentally end up in tui mode.
gdb/ChangeLog:
* NEWS: Mention 'tui enable' and 'tui disable'.
* tui/tui.c (tui_enable_command): New function.
(tui_disable_command): New function.
(_initialize_tui): New function.
gdb/doc/ChangeLog:
* gdb.texinfo (TUI): Include 'tui enable' in the introduction.
(TUI Commands): Add 'tui enable' and 'tui disable' details.
---
gdb/ChangeLog | 7 +++++++
gdb/NEWS | 4 ++++
gdb/doc/ChangeLog | 5 +++++
gdb/doc/gdb.texinfo | 15 +++++++++++++--
gdb/tui/tui.c | 34 ++++++++++++++++++++++++++++++++++
5 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 42ef67d..f55b9c4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2015-05-22 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * NEWS: Mention 'tui enable' and 'tui disable'.
+ * tui/tui.c (tui_enable_command): New function.
+ (tui_disable_command): New function.
+ (_initialize_tui): New function.
+
2015-05-21 Andrew Burgess <andrew.burgess@embecosm.com>
* tui/tui-regs.c (tui_reg_next_command): Use NULL not 0.
diff --git a/gdb/NEWS b/gdb/NEWS
index e08dd0d..745444b 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -82,6 +82,10 @@ record bts
compile print
Evaluate expression by using the compiler and print result.
+tui enable
+tui disable
+ Explicit commands for enabling and disabling tui mode.
+
* New options
set max-completions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index f8b0487..445f64d 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-22 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.texinfo (TUI): Include 'tui enable' in the introduction.
+ (TUI Commands): Add 'tui enable' and 'tui disable' details.
+
2015-05-16 Doug Evans <xdje42@gmail.com>
* guile.texi (Memory Ports in Guile): Document support for unbuffered
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 1665372..e38fd31 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -24669,8 +24669,9 @@ is available.
The TUI mode is enabled by default when you invoke @value{GDBN} as
@samp{@value{GDBP} -tui}.
You can also switch in and out of TUI mode while @value{GDBN} runs by
-using various TUI commands and key bindings, such as @kbd{C-x C-a}.
-@xref{TUI Keys, ,TUI Key Bindings}.
+using various TUI commands and key bindings, such as @command{tui
+enable} or @kbd{C-x C-a}. @xref{TUI Commands, ,TUI Commands} and
+@ref{TUI Keys, ,TUI Key Bindings}.
@node TUI Overview
@section TUI Overview
@@ -24944,6 +24945,16 @@ these commands will fail with an error, because it would not be
possible or desirable to enable curses window management.
@table @code
+@item tui enable
+@kindex tui enable
+Activate TUI mode. The last active TUI window layout will be used if
+TUI mode has prevsiouly been used in the current debugging session,
+otherwise a default layout is used.
+
+@item tui disable
+@kindex tui disable
+Disable TUI mode, returning to the console interpreter.
+
@item info win
@kindex info win
List and give the size of all displayed windows.
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 308e7ae..838471d 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -540,6 +540,22 @@ tui_disable (void)
tui_update_gdb_sizes ();
}
+/* Command wrapper for enabling tui mode. */
+
+static void
+tui_enable_command (char *args, int from_tty)
+{
+ tui_enable ();
+}
+
+/* Command wrapper for leaving tui mode. */
+
+static void
+tui_disable_command (char *args, int from_tty)
+{
+ tui_disable ();
+}
+
void
strcat_to_buf (char *buf, int buflen,
const char *item_to_add)
@@ -652,3 +668,21 @@ tui_get_command_dimension (unsigned int *width,
*height = TUI_CMD_WIN->generic.height;
return 1;
}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+extern initialize_file_ftype _initialize_tui;
+
+void
+_initialize_tui (void)
+{
+ struct cmd_list_element **tuicmd;
+
+ tuicmd = tui_get_cmd_list ();
+
+ add_cmd ("enable", class_tui, tui_enable_command,
+ _("Enable TUI display mode."),
+ tuicmd);
+ add_cmd ("disable", class_tui, tui_disable_command,
+ _("Disable TUI display mode."),
+ tuicmd);
+}
--
2.4.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb: Add new 'layout cli' command.
2015-05-22 8:19 ` Andrew Burgess
@ 2015-05-22 8:38 ` Eli Zaretskii
2015-05-22 10:04 ` Pedro Alves
1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2015-05-22 8:38 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches, palves
> Date: Fri, 22 May 2015 10:19:15 +0200
> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Cc: Pedro Alves <palves@redhat.com>, Eli Zaretskii <eliz@gnu.org>
>
> * Pedro Alves <palves@redhat.com> [2015-05-22 01:29:17 +0100]:
>
> > I notice that we have no blessed way to go back to the same layout that
> > was current when the tui was last active. "layout current" would be odd,
> > given that the current is "cli"... Hmm, "layout last" (like "cd -")?
> > Not sure...
> >
> > A separate command ("tui enable/disable"? "set tui enabled on/off"?)
> > would be a more direct mapping to the readline bindings.
>
> I'm happy with that. As a bonus this solves the above problem too, so
> 'tui enable' returns to the last active layout.
>
> Eli, sorry, this revision renders your last doc review redundant.
This one is also OK, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb: Add new 'layout cli' command.
2015-05-22 8:19 ` Andrew Burgess
2015-05-22 8:38 ` Eli Zaretskii
@ 2015-05-22 10:04 ` Pedro Alves
1 sibling, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2015-05-22 10:04 UTC (permalink / raw)
To: Andrew Burgess, gdb-patches; +Cc: Eli Zaretskii
On 05/22/2015 09:19 AM, Andrew Burgess wrote:
> * Pedro Alves <palves@redhat.com> [2015-05-22 01:29:17 +0100]:
>
>> I notice that we have no blessed way to go back to the same layout that
>> was current when the tui was last active. "layout current" would be odd,
>> given that the current is "cli"... Hmm, "layout last" (like "cd -")?
>> Not sure...
>>
>> A separate command ("tui enable/disable"? "set tui enabled on/off"?)
>> would be a more direct mapping to the readline bindings.
>
> I'm happy with that. As a bonus this solves the above problem too, so
> 'tui enable' returns to the last active layout.
>
> Eli, sorry, this revision renders your last doc review redundant.
>
Looks good. Thanks.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gdb: Add new 'layout cli' command.
[not found] <cdefb1cb466c17bb9668b60f04fb1ea3b7bfe028.1432245947.git.andrew.burgess@embecosm.com>
2015-05-22 0:29 ` [PATCH] gdb: Add new 'layout cli' command Pedro Alves
@ 2015-05-22 7:14 ` Eli Zaretskii
1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2015-05-22 7:14 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches, andrew.burgess
> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Cc: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Fri, 22 May 2015 00:06:25 +0200
>
> It always seemed a little strange to me that it's possible to enter
> TUI mode by typing commands at the CLI, but to leave TUI mode you need
> to know the readline bindings.
>
> This commit adds a new 'layout cli' command to leave tui mode, which
> is in addition to the readline bindings.
OK for the documentation parts.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-22 10:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <cdefb1cb466c17bb9668b60f04fb1ea3b7bfe028.1432245947.git.andrew.burgess@embecosm.com>
2015-05-22 0:29 ` [PATCH] gdb: Add new 'layout cli' command Pedro Alves
2015-05-22 8:19 ` Andrew Burgess
2015-05-22 8:38 ` Eli Zaretskii
2015-05-22 10:04 ` Pedro Alves
2015-05-22 7:14 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox