public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/8822] log commands along with their output (make logging more flexible)
       [not found] <bug-8822-4717@http.sourceware.org/bugzilla/>
@ 2022-08-10 17:18 ` tromey at sourceware dot org
  2022-08-11  6:26 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2022-08-10 17:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=8822

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
I was going to suggest trace-commands today, but I see it's been done.
I wonder if a new logging mode could print the prompt and the
command instead of the "+".

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug cli/8822] log commands along with their output (make logging more flexible)
       [not found] <bug-8822-4717@http.sourceware.org/bugzilla/>
  2022-08-10 17:18 ` [Bug cli/8822] log commands along with their output (make logging more flexible) tromey at sourceware dot org
@ 2022-08-11  6:26 ` vries at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vries at gcc dot gnu.org @ 2022-08-11  6:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=8822

--- Comment #9 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #8)
> I was going to suggest trace-commands today, but I see it's been done.
> I wonder if a new logging mode could print the prompt and the
> command instead of the "+".

Using this:
...
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 5f81db418bc..6a59607aa47 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -495,8 +495,13 @@ print_command_trace (const char *fmt, ...)
   if (!source_verbose && !trace_commands)
     return;

-  for (i=0; i < command_nest_depth; i++)
-    gdb_printf ("+");
+  if (0)
+    {
+      for (i=0; i < command_nest_depth; i++)
+       gdb_printf ("+");
+    }
+  else
+    gdb_printf ("%s", get_prompt ().c_str ());

   va_list args;

...
I get:
...
$ gdb -q -batch -ex "set trace-commands on" -ex "inferior" -ex "set prompt
(bla) " -ex "inferior"
(gdb) inferior
[Current inferior is 1 [<null>] (<noexec>)]
(gdb) set prompt (bla) 
(bla) inferior
[Current inferior is 1 [<null>] (<noexec>)]
...

Doesn't take into account annotations though, for that we need top_level_prompt
instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug cli/8822] log commands along with their output (make logging more flexible)
       [not found] <20040722184800.8822.lee@bustech.com>
@ 2010-01-22 17:07 ` ppluzhnikov at google dot com
  0 siblings, 0 replies; 3+ messages in thread
From: ppluzhnikov at google dot com @ 2010-01-22 17:07 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|log commands along with     |log commands along with
                   |their output (make logging  |their output (make logging
                   |                            |more flexible)


http://sourceware.org/bugzilla/show_bug.cgi?id=8822

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-11  6:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-8822-4717@http.sourceware.org/bugzilla/>
2022-08-10 17:18 ` [Bug cli/8822] log commands along with their output (make logging more flexible) tromey at sourceware dot org
2022-08-11  6:26 ` vries at gcc dot gnu.org
     [not found] <20040722184800.8822.lee@bustech.com>
2010-01-22 17:07 ` ppluzhnikov at google dot com

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).