public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] GDB/testsuite: Add a way to send multiple init commands
Date: Tue, 10 Jun 2014 18:52:00 -0000	[thread overview]
Message-ID: <539753F2.8080406@redhat.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1406091614210.3047@tp.orcam.me.uk>

On 06/10/2014 11:22 AM, Maciej W. Rozycki wrote:
> Index: gdb-fsf-trunk-quilt/gdb/testsuite/lib/gdb.exp
> ===================================================================
> --- gdb-fsf-trunk-quilt.orig/gdb/testsuite/lib/gdb.exp	2014-06-06 15:04:15.000000000 +0100
> +++ gdb-fsf-trunk-quilt/gdb/testsuite/lib/gdb.exp	2014-06-06 15:05:05.867648960 +0100
> @@ -219,6 +219,19 @@ proc gdb_run_cmd {args} {
>   	    }
>   	}
>       }
> +    if [target_info exists gdb_init_commands] {
> +	set commands [target_info gdb_init_commands];
> +	for { set x 0; } { $x < [llength $commands] } { incr x } {
> +	    send_gdb "[lindex $commands $x]\n";

The "normal" Tcl idiom for this is foreach:

    foreach cmd $commands {
      send_gdb $cmd
      # ...

> +	    gdb_expect 30 {
> +		-re "$gdb_prompt $" { }
> +		default {
> +		    perror "gdb_init_command for target failed";
> +		    return;
> +		}
> +	    }
> +	}
> +    }

Keith

  reply	other threads:[~2014-06-10 18:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 18:24 Maciej W. Rozycki
2014-06-10 18:52 ` Keith Seitz [this message]
2014-06-11 15:39 ` Tom Tromey
2014-06-11 18:41   ` Maciej W. Rozycki
2014-06-19 23:39     ` [PING][PATCH] " Maciej W. Rozycki
2014-06-20  7:14       ` Eli Zaretskii
2014-06-20 22:53         ` Maciej W. Rozycki
2014-06-21  7:14           ` Eli Zaretskii
2014-06-23 14:03             ` Joel Brobecker
2014-06-20  8:50     ` [PATCH] " Pedro Alves
2014-07-10  0:17       ` [PATCH v2] " Maciej W. Rozycki
2014-07-10 16:15         ` Pedro Alves
2014-07-12  4:38           ` Maciej W. Rozycki

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=539753F2.8080406@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@codesourcery.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).