When starting an event loop, allow for GDB to ouput some random messages when it start up.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sun, 01 Mar 2015 08:27:42 +0000
changeset 57 f27c9f059a08
parent 56 20989de12cfb
child 58 531c7f5d6558
When starting an event loop, allow for GDB to ouput some random messages when it start up. GDB 7.9.XX apparently does that if there's some sort of non-fatal error.
GDBConnection.st
GDBMIParser.st
--- a/GDBConnection.st	Sat Feb 28 08:34:19 2015 +0100
+++ b/GDBConnection.st	Sun Mar 01 08:27:42 2015 +0000
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'jv:libgdbs' }"
 
 "{ NameSpace: Smalltalk }"
@@ -181,6 +183,7 @@
             command
         ].
     parser recorder:recorder.
+    parser parsePostStartHeader.
     [
         process debuggerOutput atEnd
     ] whileFalse:[
@@ -212,8 +215,7 @@
     ]
 
     "Created: / 02-06-2014 / 22:38:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 23-06-2014 / 09:20:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-02-2015 / 15:08:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-03-2015 / 08:26:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 eventPumpStart
--- a/GDBMIParser.st	Sat Feb 28 08:34:19 2015 +0100
+++ b/GDBMIParser.st	Sun Mar 01 08:27:42 2015 +0000
@@ -261,6 +261,33 @@
     "Modified: / 01-10-2014 / 09:36:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+parsePostStartHeader
+    "
+Python Exception <type 'exceptions.ImportError'> No module named gdb: 
+./gdb: warning: 
+Could not load the Python gdb module from `/usr/local/share/gdb/python'.
+Limited Python support is available from the _gdb module.
+Suggest passing --data-directory=/path/to/gdb/data-directory.
+
+=thread-group-added,id='i1'
+(gdb) 
+
+    "
+
+    | atBeginingOfLine c |
+
+    atBeginingOfLine := true.
+    [ 
+        c := source peek.
+        atBeginingOfLine and:[ c == $= ]
+    ] whileFalse:[ 
+        c := source next.
+        atBeginingOfLine := c == Character lf
+    ].
+
+    "Created: / 01-03-2015 / 08:25:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 parseResultClass
     "
     result-class → 'done' | 'running' | 'connected' | 'error' | 'exit'