UI: in simple console use prompt defined by GDB parameter 'prompt'
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 19 Jan 2019 23:28:30 +0000
changeset 136 285c33a15fd2
parent 135 42e384802815
child 137 418e6ddd8733
UI: in simple console use prompt defined by GDB parameter 'prompt' ...which may be set by `set prompt` command in startup scripts.
VDBDebuggerApplication.st
VDBSimpleDebuggerConsoleApplication.st
--- a/VDBDebuggerApplication.st	Thu Jan 17 12:55:47 2019 +0000
+++ b/VDBDebuggerApplication.st	Sat Jan 19 23:28:30 2019 +0000
@@ -71,8 +71,7 @@
                         nextPutLine:'"/ VDBAbstractApplication defaultTextFont: (CodeView defaultFont asSize: 16).';
                         yourself.
                 ].
-        ] on:Error
-                do:[:ex | 
+        ] on:Error do:[:ex | 
             gdbinit exists ifTrue:[
                 gdbinit remove
             ].
@@ -82,9 +81,11 @@
     ^ gdbinit
 
     "
-     VDBDebuggerApplication defaultUserInit"
+    VDBDebuggerApplication defaultUserInit
+    "
 
     "Created: / 31-08-2018 / 07:03:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 19-01-2019 / 13:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBDebuggerApplication class methodsFor:'interface opening'!
--- a/VDBSimpleDebuggerConsoleApplication.st	Thu Jan 17 12:55:47 2019 +0000
+++ b/VDBSimpleDebuggerConsoleApplication.st	Sat Jan 19 23:28:30 2019 +0000
@@ -169,6 +169,14 @@
 
 !VDBSimpleDebuggerConsoleApplication methodsFor:'event handling'!
 
+onCmdParamChanged: event
+    event name = 'prompt' ifTrue:[
+        consolePrompt := event value
+    ].
+
+    "Created: / 19-01-2019 / 22:13:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 onCommandEvent: event
     event command == outstandingCommand ifTrue:[ 
         outstandingCommandToken := event token.
@@ -247,7 +255,7 @@
                     consolePromptPrinted := false.
                     self showCR: cmdLine.
                     cmdLine notEmptyOrNil ifTrue:[
-                        cmd := (GDBMIParser on:cmdLine) parseCommand.
+                        cmd := GDBCommand parse: cmdLine.
                         cmd isCLICommand ifTrue:[ 
                             cmd runOnBackground: true.  
                         ].
@@ -262,7 +270,7 @@
     ].
 
     "Created: / 10-06-2014 / 01:25:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 16-09-2016 / 00:42:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-01-2019 / 23:05:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 postBuildConsoleView: aTextCollector
@@ -285,14 +293,14 @@
     consoleInput := GDBInternalPipeStream new.
     consoleOutput := GDBInternalPipeStream new.
     consoleOutputLock := RecursionLock new.
-    consolePrompt := '(gdb) '.
+    consolePrompt := '(vdb) '.
     consolePromptPrinted := false.
     outstandingCommandBlocker := Semaphore new.
     ignoreNextLogStreamEvent := false.
 
     "Created: / 10-06-2014 / 01:23:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 07-04-2018 / 23:13:27 / jv"
-    "Modified: / 30-12-2018 / 22:02:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-01-2019 / 21:49:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 initializeCompletion
@@ -324,12 +332,16 @@
         when: GDBTargetOutputEvent       send: #onStreamOutputEvent:     to: self;
         when: GDBLogOutputEvent          send: #onLogOutputEvent:        to: self;
 
-        when: GDBEventSetProcessingFinished send: #onEventSetProcessingFinished: to: self.
+        when: GDBEventSetProcessingFinished send: #onEventSetProcessingFinished: to: self;
+
+        when: GDBCmdParamChangedEvent send: #onCmdParamChanged: to: self.
+
+    consolePrompt := debugger getParameter: 'prompt'.
 
     self initializeCompletion.
 
     "Created: / 06-06-2014 / 21:26:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 16-01-2019 / 14:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 19-01-2019 / 22:14:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBSimpleDebuggerConsoleApplication methodsFor:'private - writing'!