public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/22454] logging sometimes prints prompt
[not found] <bug-22454-4717@http.sourceware.org/bugzilla/>
@ 2020-06-26 22:17 ` sandra at codesourcery dot com
2023-03-29 15:19 ` vries at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: sandra at codesourcery dot com @ 2020-06-26 22:17 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=22454
sandra at codesourcery dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sandra at codesourcery dot com
--- Comment #2 from sandra at codesourcery dot com ---
I'm seeing these FAILs in testing on a remote host that can't support readline
because stdin isn't a tty:
FAIL: gdb.base/ui-redirect.exp: redirect: set logging on (timeout)
FAIL: gdb.base/ui-redirect.exp: redirect: save breakpoints cmds.txt (timeout)
FAIL: gdb.base/ui-redirect.exp: redirect: userdefined (timeout)
They're timing out because the prompt is appearing in the log file instead of
stdout, causing gdb_test to wait indefinitely for output that never arrives.
Surely this is a bug somewhere else and not an inherent dependency on readline
features?
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug cli/22454] logging sometimes prints prompt
[not found] <bug-22454-4717@http.sourceware.org/bugzilla/>
2020-06-26 22:17 ` [Bug cli/22454] logging sometimes prints prompt sandra at codesourcery dot com
@ 2023-03-29 15:19 ` vries at gcc dot gnu.org
2023-03-29 16:53 ` vries at gcc dot gnu.org
2024-05-10 18:16 ` tromey at sourceware dot org
3 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-03-29 15:19 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=22454
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vries at gcc dot gnu.org
--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
I ran into this as well with gdb.ada/access_to_packed_array.exp, and a target
board that defaults to "set editing off".
This fixed it for me:
...
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 53ddd515be7..e5838bafc33 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -447,8 +447,8 @@ display_gdb_prompt (const char *new_prompt)
/* Don't use a _filtered function here. It causes the assumed
character position to be off, since the newline we read from
the user is not accounted for. */
- printf_unfiltered ("%s", actual_gdb_prompt.c_str ());
- gdb_flush (gdb_stdout);
+ printf ("%s", actual_gdb_prompt.c_str ());
+ fflush (stdout);
}
}
...
which I suppose mimics what readline would otherwise do.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug cli/22454] logging sometimes prints prompt
[not found] <bug-22454-4717@http.sourceware.org/bugzilla/>
2020-06-26 22:17 ` [Bug cli/22454] logging sometimes prints prompt sandra at codesourcery dot com
2023-03-29 15:19 ` vries at gcc dot gnu.org
@ 2023-03-29 16:53 ` vries at gcc dot gnu.org
2024-05-10 18:16 ` tromey at sourceware dot org
3 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2023-03-29 16:53 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=22454
--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #3)
> I ran into this as well with gdb.ada/access_to_packed_array.exp, and a
> target board that defaults to "set editing off".
>
> This fixed it for me:
> ...
> diff --git a/gdb/event-top.c b/gdb/event-top.c
> index 53ddd515be7..e5838bafc33 100644
> --- a/gdb/event-top.c
> +++ b/gdb/event-top.c
> @@ -447,8 +447,8 @@ display_gdb_prompt (const char *new_prompt)
> /* Don't use a _filtered function here. It causes the assumed
> character position to be off, since the newline we read from
> the user is not accounted for. */
> - printf_unfiltered ("%s", actual_gdb_prompt.c_str ());
> - gdb_flush (gdb_stdout);
> + printf ("%s", actual_gdb_prompt.c_str ());
> + fflush (stdout);
> }
> }
>
> ...
> which I suppose mimics what readline would otherwise do.
With this patch, I'm running into trouble in gdb.base/new-ui*.exp because I
get:
...
(gdb) PASS: gdb.base/new-ui.exp: do_test: new-ui does not repeat
builtin_spawn -pty^M
new-ui console /dev/pts/10^M
(gdb) New UI allocated^M
(gdb) FAIL: gdb.base/new-ui.exp: do_test: initial prompt on extra console
(timeout)
...
instead of:
...
(gdb) PASS: gdb.base/new-ui.exp: do_test: new-ui does not repeat
builtin_spawn -pty^M
new-ui console /dev/pts/10^M
New UI allocated^M
(gdb) (gdb) PASS: gdb.base/new-ui.exp: do_test: initial prompt on extra console
...
I don't know whether this is a testsuite problem or that it means that the
patch is wrong.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug cli/22454] logging sometimes prints prompt
[not found] <bug-22454-4717@http.sourceware.org/bugzilla/>
` (2 preceding siblings ...)
2023-03-29 16:53 ` vries at gcc dot gnu.org
@ 2024-05-10 18:16 ` tromey at sourceware dot org
3 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2024-05-10 18:16 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=22454
--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
I think using printf here means the console window in the TUI
won't work properly. Basically gdb cannot use printf -- it has
to use its own streams.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-10 18:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-22454-4717@http.sourceware.org/bugzilla/>
2020-06-26 22:17 ` [Bug cli/22454] logging sometimes prints prompt sandra at codesourcery dot com
2023-03-29 15:19 ` vries at gcc dot gnu.org
2023-03-29 16:53 ` vries at gcc dot gnu.org
2024-05-10 18:16 ` tromey at sourceware dot org
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).