Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org,
	Jie Zhang <jie.zhang@analog.com>
Subject: Re: [PATCH v2] gdb: tests: set remotetimeout to gdb_load_timeout for remote targets
Date: Wed, 29 Jun 2011 16:25:00 -0000	[thread overview]
Message-ID: <20110629162527.GC2407@adacore.com> (raw)
In-Reply-To: <1308510312-5512-1-git-send-email-vapier@gentoo.org>

> Rather than relying on the default remotetimeout value (which might be
> too small for some slower devices), use the existing gdb_load_timeout
> config option to set it.

No one seems to be comfortable looking at this, so I took a look.
I think the idea makes sense.

> +	    if [is_remote target] {
> +		set oldremotetimeout [get_remotetimeout]
> +		set_remotetimeout $loadtimeout
> +	    }

Is there a specific reason you already know about that made you
change the remotetimeout only when the target is remote? If there is,
I think it'd be nice to add a comment to that effect. If it's just
because we don't expect the timeout to have any effect in the non-
remote case, then I guess we can leave it like that. But I'm not
to certain about that. I would consider the idea of making things
simpler by just setting the timeout everytime, since this part of
the code will always result in a "load" command being used.

> +proc get_remotetimeout { } {

This function needs a comment describing what it does. Same for
set_remotetimeout.

> +    send_gdb "show remotetimeout\n"
> +    gdb_expect {

Can you use gdb_test_multiple instead?

> +    # Pick the default that gdb uses
> +    return 300

I think we should at least get a warning when that happens, because
it means that the regexp in the check before failed to match.
If we don't have some kind of visual cue, I think it'll be easy
to not notice that something changed, and the function is now
returning a default value, rather than the real timeout at that
time...

> +    send_gdb "set remotetimeout $timeout\n";
> +    gdb_expect {

Same, can we use gdb_test_multiple?

-- 
Joel


  reply	other threads:[~2011-06-29 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 21:34 [PATCH] gdb: tests/monitor: " Mike Frysinger
2011-06-18 22:31 ` Mike Frysinger
2011-06-19 19:04 ` [PATCH v2] gdb: tests: " Mike Frysinger
2011-06-29 16:25   ` Joel Brobecker [this message]
2011-06-29 17:29     ` Jie Zhang
2011-06-30  8:59     ` Pedro Alves
2011-06-30 13:30       ` [toolchain-devel] " Mike Frysinger
2011-06-30 13:48         ` Pedro Alves
2011-06-29 23:25   ` [PATCH v3] " Mike Frysinger
2011-06-30 22:54     ` Joel Brobecker
2011-07-01  0:19       ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110629162527.GC2407@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jie.zhang@analog.com \
    --cc=toolchain-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox