[PATCH Fixup] PowerPC: bp-permanent.exp, kill-after-signal fix

Carl Love cel@us.ibm.com
Tue May 10 15:13:19 GMT 2022


Tom:

On Tue, 2022-05-10 at 11:27 +0200, Tom de Vries wrote:
> On 5/9/22 22:43, Carl Love wrote:
> >   		gdb_test_multiple "stepi" $test {
> > -		    -re "Program received signal SIGTRAP.*$gdb_prompt
> > $" {
> > +		    -re -wrap "Program received signal
> > SIGTRAP.*$gdb_prompt $" {
> >   			fail $test
> >   		    }
> 
> Hi Carl,
> 
> This doesn't look right.
> 
> So, there are essentially 3 things that do the same:
> 
> 1.
> gdb_test <cmd> <pat> <name>
> 
> 2.
> gdb_test_multiple <cmd> <name> {
>    -re -wrap <pat> {
>      pass $gdb_test_name
>    }
> }
> 
> 3.
> gdb_test_multiple <cmd> <name> {
>    -re "\[\r\n\]*(?:<pat>)\[\r\n\]+$gdb_prompt $" {
>      pass $gdb_test_name
>    }
> }
> 
> Put differently, -wrap is a shorthand that can be used in 
> gdb_test_multiple to match a pattern in the same way that gdb_test 
> would, which includes matching the prompt.
> 
> Specifying this:
> ...
>    -re -wrap "Program received signal SIGTRAP.*$gdb_prompt $" {
> ...
> means you're trying to match the prompt twice, once using -wrap,
> once 
> using $gdb_prompt.

This is really helpful.  I have been a bit confused as to when to use
wrap.  This really helps.  So, I will take the -wrap that I just added
to the bp-permanent.exp test.  Adding that was a mistake.  Thanks.

                                   Carl 



More information about the Gdb-patches mailing list