From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Jan Kratochvil'" <jan.kratochvil@redhat.com>
Cc: <gdb-patches@sourceware.org>, <drow@false.org>
Subject: RE: PING [RFC] Testsuite: permit simple transformation of gdb_expect code
Date: Wed, 16 Jun 2010 15:34:00 -0000 [thread overview]
Message-ID: <000001cb0d69$55b65150$0122f3f0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <20100616141356.GA32701@host0.dyn.jankratochvil.net>
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Jan Kratochvil
> Envoyé : Wednesday, June 16, 2010 4:14 PM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org; drow@false.org
> Objet : Re: PING [RFC] Testsuite: permit simple transformation of
> gdb_expect code
>
> On Tue, 15 Jun 2010 08:19:30 +0200, Pierre Muller wrote:
> > use only a procedure, but this would mean
> > that there is no way to insert its code inside
> > gdb.exp itself.
>
> I do not understand this part.
Once again, this is due to my lack of knowledge of
expect/tcl.
> > This allows to use either
> > unset transform_gdb_expect_code
> > or
> > set transform_gdb_expect_code ""
> > to disable the transformation at any point
> > in the testsuite.
>
> With the patch proposed below one defines it using:
> proc transform_gdb_expect_code { expcode } {
> verbose -log "code = <$expcode>"
> return $expcode
> }
> and undefines it using:
> rename transform_gdb_expect_code ""
I didn't know about rename builtin command,
this means that we could define
proc gdb_allow_dos_type_readline { expcode} {
which would translate the expcode to cope with the extra \n appearing in
that case,
and insert later
if { [istarget "*-*-mingw*"] || [istarget "*-*-*djgpp*"] } {
rename gdb_allow_dos_type_readline transform_gdb_expect_code
}
This is perfect for me!
> Thanks,
Thank you for this new simpler proposal!
> 2010-06-16 Pierre Muller <muller@ics.u-strasbg.fr>
> Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * lib/gdb.exp (gdb_expect): Call transform_gdb_expect_code
> procedure
> if it exists.
>
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -2178,6 +2178,13 @@ proc gdb_expect { args } {
> }
> }
>
> + # The global procedure transform_gdb_expect_code can transform the
> code
> + # parameter of gdb_expect call in order to cope for some target
> dependant
> + # problems.
> + if { "[info procs transform_gdb_expect_code]" != "" } {
> + set expcode [transform_gdb_expect_code $expcode]
> + }
> +
> global suppress_flag;
> global remote_suppress_flag;
> if [info exists remote_suppress_flag] {
prev parent reply other threads:[~2010-06-16 15:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-15 6:20 Pierre Muller
2010-06-16 14:14 ` Jan Kratochvil
2010-06-16 15:34 ` Pierre Muller [this message]
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='000001cb0d69$55b65150$0122f3f0$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.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