From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A4537385740E; Thu, 11 Aug 2022 06:26:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4537385740E From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug cli/8822] log commands along with their output (make logging more flexible) Date: Thu, 11 Aug 2022 06:26:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: 6.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppluzhnikov at google dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2022 06:26:31 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D8822 --- Comment #9 from Tom de Vries --- (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=3D0; i < command_nest_depth; i++) - gdb_printf ("+"); + if (0) + { + for (i=3D0; 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 [] ()] (gdb) set prompt (bla)=20 (bla) inferior [Current inferior is 1 [] ()] ... Doesn't take into account annotations though, for that we need top_level_pr= ompt instead. --=20 You are receiving this mail because: You are on the CC list for the bug.=