GDBMIPrinter.st
changeset 199 cb411138b295
parent 179 c43cece06442
child 200 e9250da35d87
equal deleted inserted replaced
198:2078a57c6783 199:cb411138b295
   162 !
   162 !
   163 
   163 
   164 printCommandCLI: aGDBCLICommand
   164 printCommandCLI: aGDBCLICommand
   165     "
   165     "
   166     cli-command → [ token ] cli-command nl, where cli-command is any existing GDB CLI command.
   166     cli-command → [ token ] cli-command nl, where cli-command is any existing GDB CLI command.
   167 
   167     "
   168     "
   168     "/ Although MI allows "bare" CLI commands to be issued as well,
   169     aGDBCLICommand token notNil ifTrue:[ 
   169     "/ there's a problem with C-escaping - some commands need C-escaping,
   170         aGDBCLICommand token printOn: stream.
   170     "/ some other do not. 
   171     ].
   171     "/
   172     self printCEscapedString: aGDBCLICommand value.
   172     "/ Try to address this by using -interpreter-exec CLI command to
   173     aGDBCLICommand runOnBackground ifTrue:[ 
   173     "/ send it to GDB.
   174         stream space; nextPut:$&  
   174     self printCommandMI: 
   175     ].
   175         (GDBMI_interpreter_exec new
       
   176             token: aGDBCLICommand token;
       
   177             arguments: (Array with: 'console' with: aGDBCLICommand value))
       
   178 
       
   179     "/ Original implementation, left for reference:
       
   180 "/ aGDBCLICommand token notNil ifTrue:[ 
       
   181 "/        aGDBCLICommand token printOn: stream.
       
   182 "/    ].
       
   183 "/    self printCEscapedString: aGDBCLICommand value.
       
   184 "/    aGDBCLICommand runOnBackground ifTrue:[ 
       
   185 "/        stream space; nextPut:$&  
       
   186 "/    ].
   176 
   187 
   177     "Created: / 11-07-2017 / 21:33:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   188     "Created: / 11-07-2017 / 21:33:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   178     "Modified: / 28-01-2019 / 21:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   179     "Modified: / 13-03-2019 / 12:15:36 / jv"
   189     "Modified: / 13-03-2019 / 12:15:36 / jv"
       
   190     "Modified (format): / 08-07-2019 / 10:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   180 !
   191 !
   181 
   192 
   182 printCommandMI: aGDBMICommand
   193 printCommandMI: aGDBMICommand
   183     "
   194     "
   184     mi-command → [ token ] '-' operation ( ' ' option )* [ ' --' ] ( ' ' parameter )* nl
   195     mi-command → [ token ] '-' operation ( ' ' option )* [ ' --' ] ( ' ' parameter )* nl