TerminalSession.st
changeset 3112 48fe32a582b4
parent 3111 9db40cb12c21
child 3132 cadb44acf325
--- a/TerminalSession.st	Fri Aug 23 14:02:58 2013 +0200
+++ b/TerminalSession.st	Fri Aug 23 16:42:24 2013 +0200
@@ -339,6 +339,10 @@
     "Modified: / 12.6.1998 / 22:12:47 / cg"
 !
 
+sendCharacter:aCharacter
+    inStream nextPut:aCharacter.
+!
+
 sendLine:aString
     inStream nextPutAll:aString.
     self sendLineEnd
@@ -426,7 +430,7 @@
     "evaluate aBlock and wait for the prompt.
      return gdb output as string collection"
 
-    |sema output|
+    |sema output lastSize gotPrompt|
 
     sema := Semaphore new.
     self startCollectingOutput.
@@ -434,12 +438,23 @@
 
     aBlock value.
 
-    (sema waitWithTimeout:seconds) isNil ifTrue:[
-        self information:'Error: command timeout.'.
-        self stopCollectingOutput.
-        self onPrompt:nil do:nil.
-        AbortOperationRequest raise.
-    ].
+    lastSize := 0.
+    [
+        |newSize|
+
+        (gotPrompt := (sema waitWithTimeout:seconds) notNil) ifFalse:[
+            newSize := collectedOutput size.
+            Transcript show:'timeout - output size is: '; showCR:newSize.
+            newSize = lastSize ifTrue:[
+                "/ self information:'Error: command timeout.'.
+                self stopCollectingOutput.
+                self onPrompt:nil do:nil.
+                TimeoutError raiseRequestErrorString:'GDB command timeout'.
+            ].
+            lastSize := newSize.
+        ].  
+    ] doWhile:[ gotPrompt not ].
+
     output notEmptyOrNil ifTrue:[
         output first isEmpty ifTrue:[
             "/ self halt.
@@ -660,11 +675,11 @@
 !TerminalSession class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/TerminalSession.st,v 1.15 2013-08-23 12:02:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/TerminalSession.st,v 1.16 2013-08-23 14:42:24 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/TerminalSession.st,v 1.15 2013-08-23 12:02:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/TerminalSession.st,v 1.16 2013-08-23 14:42:24 cg Exp $'
 ! !