From: Pedro Alves <palves@redhat.com>
To: Jerome Guitton <guitton@adacore.com>
Cc: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [RFA] completion in command definition
Date: Tue, 31 Jan 2017 15:53:00 -0000 [thread overview]
Message-ID: <b09f45a2-aac8-54bf-7ebf-07ab2c80fe9f@redhat.com> (raw)
In-Reply-To: <20170131152907.GM6665@adacore.com>
On 01/31/2017 03:29 PM, Jerome Guitton wrote:
> Pedro Alves (palves@redhat.com):
>
>> A few minor comments below.
>
> Thanks again! Comments integrated. I'm just not sure about this one:
>
>>> +
>>> + gdb_test "info break \$bpnum" \
>>> + "Num Type\[ \]+Disp Enb Address\[ \]+What.*
>>> +\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*
>>> +\[\t \]+echo.*"
>>
>> I think we need to use use multi_line, to avoid problems with
>> "\n" vs "\r" vs "\r\n".
>
> I've used the same code pattern as in break.exp; is that OK?
>
ISTR that on some hosts (maybe native Windows testing, but not
Cygwin), we can end up with tcl/expect seeing different end lines
from what we normally get on Unix, due to different levels
of \n -> \r\n -> \n translation going on. Might have been on
macOS, due \r being preferred there. I think tcl translates end lines to \n
from files by default for input, and uses native eol for output. I think
the way it's written above makes the end lines in the regexp's depend
on how tcl reads eol out of the script file. So if gdb actually
outputs "\r" only, the regexp won't match. Or something like that. It may
be working as is due to each line ending with ".*".
It's messy, and a might be a bit of cargo-culting is in place (not
sure how relevant this all still is, we don't hear much about
native Windows testing driven by native Windows expect, for
instance), but as far as I remember, we've avoided writing
multi-line regexps like that.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-01-31 15:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-10 14:28 Jerome Guitton
2017-01-10 16:27 ` Simon Marchi
2017-01-11 16:05 ` Jerome Guitton
2017-01-11 16:14 ` Simon Marchi
2017-01-12 10:05 ` Jerome Guitton
2017-01-19 14:55 ` Pedro Alves
2017-01-31 14:29 ` Jerome Guitton
2017-01-31 15:10 ` Pedro Alves
2017-01-31 15:29 ` Jerome Guitton
2017-01-31 15:53 ` Pedro Alves [this message]
2017-01-31 16:04 ` Jerome Guitton
2017-01-31 16:05 ` Pedro Alves
2017-02-08 17:59 ` Jerome Guitton
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=b09f45a2-aac8-54bf-7ebf-07ab2c80fe9f@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=guitton@adacore.com \
--cc=simon.marchi@polymtl.ca \
/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