Changeset 975 for gdb-mi

Show
Ignore:
Timestamp:
12/25/07 03:11:09 (2 years ago)
Author:
vasi
Message:

basic loop working

Location:
gdb-mi/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gdb-mi/trunk/lib/gdb/mi.rb

    r974 r975  
    8484        ### SIMPLE RUN LOOP 
    8585         
    86         def MI.runloop(cmdline, *commands) 
     86        def MI.basicloop(cmdline, *commands) 
    8787                mi = GDB::MI.new(*cmdline) 
     88                input = true 
    8889                until mi.done 
    89                         prompt = false 
    9090                        mi.update 
    9191                        while line = mi.prog_output.shift 
     
    9393                        end 
    9494                        while obj = mi.mi_output.shift 
    95                                 prompt = true if GdbPrompt === obj 
     95                                input = true if StoppedOutput === obj || DoneResult === obj 
    9696                                pp obj 
    9797                        end 
    98                         if prompt && cmd = commands.shift 
     98                        if input 
     99                                cmd = commands.shift or break 
     100                                input = false 
    99101                                mi.input(*cmd) 
    100102                        end 
  • gdb-mi/trunk/test.rb

    r974 r975  
    55require 'gdb/mi' 
    66 
    7 GDB::MI.runloop(%w[../https https://banweb.mcgill.ca], 
     7GDB::MI.basicloop(%w[../https https://banweb.mcgill.ca], 
    88        %w[-break-insert -f SSLRead], 
    99        %w[-exec-run],