public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Carl Love <cel@us.ibm.com>
To: Andreas Schwab <schwab@linux-m68k.org>,
	Carl Love via Gdb <gdb@sourceware.org>
Subject: RE: Question:  gdb.tui/tui-layout-asm.exp
Date: Tue, 20 Jul 2021 10:41:42 -0700	[thread overview]
Message-ID: <c80e8e91fa14cd31a3687d245fab81f8fb195064.camel@us.ibm.com> (raw)
In-Reply-To: <87k0llct34.fsf@igel.home>

Andreas:

On Tue, 2021-07-20 at 10:01 +0200, Andreas Schwab wrote:
> On Jul 19 2021, Carl Love via Gdb wrote:
> 
> > So the if statement is checking to see if line1 matches the re_line
> > above it.  The match statement is 
> > 
> >    [regexp $re_line [Term::get_line 1]]
> > 
> > The final test fails for some reason?
> 
> Have you checked that [Term::get_line 1] really returns the same
> thing
> in both calls?

I had to rewrite the if statement a bit to be able to get to the result
of the get_line 1 read after the wait_for.  The code is now:

while (1) {                                                              
    # Grab the second line, this is about to become the first line.      
    puts " "                                                             
    set line [Term::get_line 2]                                          
    puts "Carll line $line"                

...

    if {[Term::wait_for $re_line]} {                                    
        puts "Carll  re_line $re_line"                                  
        set line1 [Term::get_line 1]                                    
        puts "Carll  line1 $line1"                                      
        if {[regexp $re_line $line1]} {                                 
            puts "Carll true"                                           
            # We scrolled successfully.                                 
        } else {                                                        
            puts "Carll match false"                                    
            fail "$testname (scroll failed)"                            
            Term::dump_screen                                           
            break                                                       
        }                                                               
    } else {                                                            
        puts "Carll wait for false"                                     
        fail "$testname (scroll failed)"                                
        Term::dump_screen                                               
        break                                                           
    }

The output is:

Carll line |    0x100007a8 <__glink_PLTresolve+48>      bctr                              |                             
CARLL, timeout, return 1                                                                                                
Carll  re_line \|\s+0x100007a8\s+<__glink_PLTresolve\+48>\s+bctr\s+\|                                                   
Carll  line1 |    0x100007a8 <__glink_PLTresolve+48>      bctr                              |                           
Carll true                                                                                                              
                                                                                                                        
Carll line |    0x100007ac <__libc_start_main@plt>      b       0x10000778 <__glink_PLTres|                             
CARLL, timeout, return 1                                                                                                
Carll  re_line \|\s+0x100007ac\s+<__libc_start_main@plt>\s+b\s+0x10000778\s+<__glink_PLTres\|                           
Carll  line1 |    0x100007ac <__libc_start_main@plt>      b       0x10000778 <__glink_PLTres|                           
Carll true                                                                                                              
                                                                                                                        
Carll line |    0x100007b0 <__gmon_start__@plt>         b       0x10000778 <__glink_PLTres|                             
CARLL, timeout, return 1                                                                                                
Carll  re_line \|\s+0x100007b0\s+<__gmon_start__@plt>\s+b\s+0x10000778\s+<__glink_PLTres\|                              
Carll  line1 |    0x100007b0 <__gmon_start__@plt> b       0x10000778 <__glink_PLTresolve>   |          <--  the read after the wait_for read more characters                 
Carll match false                                                                                                       
FAIL: gdb.tui/tui-layout-asm.exp: scroll to end of assembler (scroll failed)                                     


The initial read of line 2, which then becomes re_line has fewer
characters in it than when the same line is read the second time.  The
second read occurs following the wait_for statement. 

I played a little to try and put a wait_for in when doing the initial
"get_line 2".  That wait doesn't seem to work correctly.  I am looking
at the library routine to see if I am not use the wait_for call
correctly.  It is not clear yet why I get more characters the "second"
time the line is read.  I will keep digging but please let me know if
you have any thoughts on the issue.  Thanks.

                   Carl 


  reply	other threads:[~2021-07-20 17:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c9c9f9f9af7ae99468baa7fd885538af4a694714.camel@us.ibm.com>
     [not found] ` <20210719164804.GC1688065@embecosm.com>
2021-07-19 22:22   ` Carl Love
2021-07-20  8:01     ` Andreas Schwab
2021-07-20 17:41       ` Carl Love [this message]
2021-07-20 18:06         ` Carl Love
2021-07-20 18:16           ` Carl Love

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=c80e8e91fa14cd31a3687d245fab81f8fb195064.camel@us.ibm.com \
    --to=cel@us.ibm.com \
    --cc=gdb@sourceware.org \
    --cc=schwab@linux-m68k.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).