public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 3/4] print-symbol-loading.exp: Allow libc symbols to be already loaded
Date: Fri, 11 Jun 2021 14:05:30 -0700	[thread overview]
Message-ID: <20210611140530.0a3eec5c@f33-m1.lan> (raw)
In-Reply-To: <20210611123333.0a52dd0c@f33-m1.lan>

On Fri, 11 Jun 2021 12:33:33 -0700
Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org> wrote:

> On Fri, 11 Jun 2021 15:22:23 -0400
> Simon Marchi <simon.marchi@polymtl.ca> wrote:
>>		    }
> > > +        	    -re "^$cmd_regex\r\nSymbols already loaded for.*?\\/libc\\..*?\r\n$gdb_prompt $" {    
> > 
> > I'm just wondering about these regexps:
> > 
> >  - What does the sequence .*? mean in a regexp?
> >  - Doesn't having .* risk matching multiple lines, including some
> >    unexpected output that we wouldn't want to match?  Should we use the
> >    typical [^\r\n]* instead?  
> 
> The regexp ".*?" is the non-greedy variation of ".*".  I.e. whereas ".*"
> matches as much as possible, ".*?" will match as little as possible.
> Therefore, ".*?\r\n" will only match only as much as needed until
> the next \r is found; therefore it will not match multiple lines.

After some IRC discussion, we both agreed that it'd be safer to use
[^\r\n]* instead.  So that line left quoted above looks like this now:

		    -re "^$cmd_regex\r\nSymbols already loaded for\[^\r\n\]*\\/libc\\.\[^\r\n\]*\r\n$gdb_prompt $" {

Kevin


  reply	other threads:[~2021-06-11 21:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 17:26 [PATCH 0/4] libthread_db initialization changes related to upcoming glibc-2.34 Kevin Buettner
2021-06-10 17:26 ` [PATCH 1/4] " Kevin Buettner
2021-06-11 19:10   ` Simon Marchi
2021-06-11 21:24     ` Kevin Buettner
2021-06-10 17:26 ` [PATCH 2/4] testsuite/glib-2.34: Match/consume optional libthread_db related output Kevin Buettner
2021-06-11 19:13   ` Simon Marchi
2021-06-10 17:26 ` [PATCH 3/4] print-symbol-loading.exp: Allow libc symbols to be already loaded Kevin Buettner
2021-06-11 19:22   ` Simon Marchi
2021-06-11 19:33     ` Kevin Buettner
2021-06-11 21:05       ` Kevin Buettner [this message]
2021-06-10 17:26 ` [PATCH 4/4] mi-sym-info.exp: Increase timeout for 114-symbol-info-functions Kevin Buettner
2021-06-11 20:11   ` Simon Marchi
2021-06-11 21:07     ` Kevin Buettner
2021-06-11 22:21 ` [PATCH 0/4] libthread_db initialization changes related to upcoming glibc-2.34 Kevin Buettner
2021-06-12  2:58   ` Carlos O'Donell
2021-06-11 16:35 [PATCH 3/4] print-symbol-loading.exp: Allow libc symbols to be already loaded Carlos O'Donell

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=20210611140530.0a3eec5c@f33-m1.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).