public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: Use default gdb_expect timeout in runto
@ 2024-04-20 16:59 Thiago Jung Bauermann
       [not found] ` <87bk61sc9k.fsf@tromey.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Thiago Jung Bauermann @ 2024-04-20 16:59 UTC (permalink / raw)
  To: gdb-patches

runto uses a hard-coded timeout of 30s in its invocation of gdb_expect.
This is normally fine, but for very a slow system (e.g., an emulator) it
may not be enough time for GDB to reach the intended breakpoint.

gdb_expect can obtain a timeout value from user-configurable variables
when it's not given one explicitly, so use that mechanism instead since
the user will have already adjusted the timeout variable to account for
the slow system.
---

Hello,

When running testcases on a slow emulator, they failed while GDB was
starting up the inferior. This patch fixes the problem.

 gdb/testsuite/lib/gdb.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index ddee928d5104..cbd37fd30947 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -768,7 +768,7 @@ proc runto { linespec args } {
     
     # the "at foo.c:36" output we get with -g.
     # the "in func" output we get without -g.
-    gdb_expect 30 {
+    gdb_expect {
 	-re "(?:Break|Temporary break).* at .*:$decimal.*$gdb_prompt $" {
 	    if { $print_pass } {
 		pass $test_name

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

* Re: [PATCH] gdb/testsuite: Use default gdb_expect timeout in runto
       [not found] ` <87bk61sc9k.fsf@tromey.com>
@ 2024-04-22 16:15   ` Thiago Jung Bauermann
  0 siblings, 0 replies; 2+ messages in thread
From: Thiago Jung Bauermann @ 2024-04-22 16:15 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches


Hello Tom,

Tom Tromey <tom@tromey.com> writes:

>>>>>> "Thiago" == Thiago Jung Bauermann <thiago.bauermann@linaro.org> writes:
>
> Thiago> runto uses a hard-coded timeout of 30s in its invocation of gdb_expect.
> Thiago> This is normally fine, but for very a slow system (e.g., an emulator) it
> Thiago> may not be enough time for GDB to reach the intended breakpoint.
>
> Thiago> gdb_expect can obtain a timeout value from user-configurable variables
> Thiago> when it's not given one explicitly, so use that mechanism instead since
> Thiago> the user will have already adjusted the timeout variable to account for
> Thiago> the slow system.
>
> This seems fine to me.
> Approved-By: Tom Tromey <tom@tromey.com>

Thank you! Pushed as commit fdaa4939e502.

--
Thiago

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

end of thread, other threads:[~2024-04-22 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-20 16:59 [PATCH] gdb/testsuite: Use default gdb_expect timeout in runto Thiago Jung Bauermann
     [not found] ` <87bk61sc9k.fsf@tromey.com>
2024-04-22 16:15   ` Thiago Jung Bauermann

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