GDBDebugger.st
changeset 302 fdfe1a981363
parent 295 4e7365cece13
child 304 0dd4d6bc9b90
equal deleted inserted replaced
301:2d0631d5ed1a 302:fdfe1a981363
   416     self assert: self isConnected.
   416     self assert: self isConnected.
   417     ^ wait ifTrue:[
   417     ^ wait ifTrue:[
   418 "/        self 
   418 "/        self 
   419 "/            assert:Processor activeProcess ~~ connection eventDispatchProcess
   419 "/            assert:Processor activeProcess ~~ connection eventDispatchProcess
   420 "/            message:'Cannot send commands from within event dispatching process. Would deadlock'.
   420 "/            message:'Cannot send commands from within event dispatching process. Would deadlock'.
   421         blocker := Semaphore new.
   421         blocker := GDBPortlib current newSemaphore.
   422         self send: command andWithResultDo: [ :r | 
   422         self send: command andWithResultDo: [ :r | 
   423             result := r.
   423             result := r.
   424             blocker signal
   424             blocker signal
   425         ].
   425         ].
   426         blocker wait.
   426         blocker wait.
   442     ]
   442     ]
   443 
   443 
   444     "Created: / 02-06-2014 / 23:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   444     "Created: / 02-06-2014 / 23:45:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   445     "Modified: / 26-03-2018 / 21:19:59 / jv"
   445     "Modified: / 26-03-2018 / 21:19:59 / jv"
   446     "Modified: / 28-01-2019 / 21:26:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   446     "Modified: / 28-01-2019 / 21:26:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   447     "Modified: / 22-02-2022 / 13:17:28 / Jan Vrany <jan.vrany@labware.com>"
   447     "Modified: / 18-08-2023 / 14:17:04 / Jan Vrany <jan.vrany@labware.com>"
   448 !
   448 !
   449 
   449 
   450 send:command andWaitFor:eventHandlers
   450 send:command andWaitFor:eventHandlers
   451     "Sends given `command` to GDB and then wait for events mathing 
   451     "Sends given `command` to GDB and then wait for events mathing 
   452      `eventHandlers`. 
   452      `eventHandlers`. 
   731         self send: (GDBMI_exec_arguments arguments: anArray).
   731         self send: (GDBMI_exec_arguments arguments: anArray).
   732     ].
   732     ].
   733 
   733 
   734     "Created: / 05-06-2017 / 17:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   734     "Created: / 05-06-2017 / 17:05:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   735     "Modified: / 09-02-2018 / 09:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   735     "Modified: / 09-02-2018 / 09:44:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   736     "Modified (comment): / 19-09-2022 / 23:10:41 / Jan Vrany <jan.vrany@labware.com>"
   736     "Modified: / 18-08-2023 / 14:11:27 / Jan Vrany <jan.vrany@labware.com>"
   737 !
   737 !
   738 
   738 
   739 exit
   739 exit
   740     self send: GDBMI_gdb_exit new andWait: false
   740     self send: GDBMI_gdb_exit new andWait: false
   741 
   741 
  1018                 ].
  1018                 ].
  1019             ].
  1019             ].
  1020         self announcer when:GDBEvent do:(handlersArray at:i).
  1020         self announcer when:GDBEvent do:(handlersArray at:i).
  1021     ].
  1021     ].
  1022     handlerFinal := [ :event | connection eventAnnouncerInternal unsubscribe: handlerFinal. blocker signal ].  
  1022     handlerFinal := [ :event | connection eventAnnouncerInternal unsubscribe: handlerFinal. blocker signal ].  
  1023     blocker := Semaphore new.
  1023     blocker := GDBPortlib current newSemaphore.
  1024     block value.
  1024     block value.
  1025     [
  1025     [
  1026         (blocker waitWithTimeoutMs:timeout) isNil ifTrue:[
  1026         (blocker waitWithTimeoutMs:timeout) isNil ifTrue:[
  1027             eventsArray := nil.
  1027             eventsArray := nil.
  1028         ].
  1028         ].
  1042         ifTrue:[ eventsArray ] ifFalse:[ eventsArray first ]
  1042         ifTrue:[ eventsArray ] ifFalse:[ eventsArray first ]
  1043 
  1043 
  1044     "Created: / 08-03-2015 / 07:28:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1044     "Created: / 08-03-2015 / 07:28:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1045     "Modified: / 02-10-2018 / 14:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1045     "Modified: / 02-10-2018 / 14:26:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1046     "Modified (format): / 03-10-2018 / 12:58:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1046     "Modified (format): / 03-10-2018 / 12:58:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1047     "Modified: / 10-09-2021 / 15:41:33 / Jan Vrany <jan.vrany@labware.com>"
  1047     "Modified: / 18-08-2023 / 14:16:58 / Jan Vrany <jan.vrany@labware.com>"
  1048 ! !
  1048 ! !
  1049 
  1049 
  1050 !GDBDebugger methodsFor:'event handling'!
  1050 !GDBDebugger methodsFor:'event handling'!
  1051 
  1051 
  1052 onBreakpointCreatedEvent: aGDBBreakpointCreatedEvent
  1052 onBreakpointCreatedEvent: aGDBBreakpointCreatedEvent