public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: 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 12:33:33 -0700	[thread overview]
Message-ID: <20210611123333.0a52dd0c@f33-m1.lan> (raw)
In-Reply-To: <89c99fe1-4b95-06d3-6768-105208d597e1@polymtl.ca>

On Fri, 11 Jun 2021 15:22:23 -0400
Simon Marchi <simon.marchi@polymtl.ca> wrote:

> On 2021-06-10 1:26 p.m., Kevin Buettner via Gdb-patches wrote:

> > ---
> >  gdb/testsuite/gdb.base/print-symbol-loading.exp | 15 ++++++++++++---
> >  1 file changed, 12 insertions(+), 3 deletions(-)
> > 
> > diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp
> > index b8eb1c844bd..6e176de351e 100644
> > --- a/gdb/testsuite/gdb.base/print-symbol-loading.exp
> > +++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp
> > @@ -96,6 +96,7 @@ test_load_core full
> >  
> >  proc test_load_shlib { print_symbol_loading } {
> >      global binfile
> > +    global gdb_prompt
> >      with_test_prefix "shlib ${print_symbol_loading}" {
> >  	clean_restart ${binfile}
> >  	gdb_test_no_output "set auto-solib-add off"
> > @@ -106,12 +107,20 @@ proc test_load_shlib { print_symbol_loading } {
> >  	set test_name "load shared-lib"
> >  	switch ${print_symbol_loading} {
> >  	    "off" {
> > -		gdb_test_no_output "sharedlibrary .*" \
> > -		    ${test_name}
> > +		set cmd "sharedlibrary .*"
> > +		set cmd_regex [string_to_regexp $cmd]
> > +		gdb_test_multiple $cmd $test_name {
> > +        	    -re "^$cmd_regex\r\n$gdb_prompt $" {
> > +			pass $test_name
> > +		    }
> > +        	    -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.

Kevin


  reply	other threads:[~2021-06-11 19:33 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 [this message]
2021-06-11 21:05       ` Kevin Buettner
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=20210611123333.0a52dd0c@f33-m1.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).