`GDBProcess` refatored to have console interpreter on STDIN/STDOUT
...and spawn an extra MI2 interpreter on extra-allocated PTY. This way
we'll get command completion, command editing and so on for free.
For details, see Pedro Alves's explanation:
https://sourceware.org/ml/gdb/2017-01/msg00039.html
--- a/GDBBreakpoint.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBBreakpoint.st Thu Jun 01 12:15:43 2017 +0100
@@ -9,6 +9,7 @@
category:'GDB-Core'
!
+
!GDBBreakpoint class methodsFor:'accessing - GDB value descriptors'!
description
@@ -70,3 +71,10 @@
^ type
! !
+!GDBBreakpoint class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/GDBCmdParamChangedEvent.st Thu Jun 01 12:15:43 2017 +0100
@@ -0,0 +1,17 @@
+"{ Package: 'jv:libgdbs' }"
+
+"{ NameSpace: Smalltalk }"
+
+GDBNotificationEvent subclass:#GDBCmdParamChangedEvent
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'GDB-Core-Events'
+!
+
+!GDBCmdParamChangedEvent methodsFor:'accessing'!
+
+type
+ ^ 'cmd-param-changed'
+! !
+
--- a/GDBConnection.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBConnection.st Thu Jun 01 12:15:43 2017 +0100
@@ -28,6 +28,18 @@
!GDBConnection methodsFor:'accessing'!
+consoleInput
+ ^ process consoleInput
+
+ "Created: / 02-06-2017 / 23:34:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+consoleOutput
+ ^ process consoleOutput
+
+ "Created: / 02-06-2017 / 23:35:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
eventAnnouncer
^ eventAnnouncer
!
@@ -165,7 +177,7 @@
!GDBConnection methodsFor:'event pump'!
eventPumpLoop
- | parser |
+ | parser done |
parser := GDBMIParser on:process debuggerOutput.
parser
@@ -182,14 +194,22 @@
].
parser recorder:recorder.
parser parsePostStartHeader.
+ done := false.
[
- process debuggerOutput atEnd
+ [
+ done or:[ process debuggerOutput atEnd ]
+ ] on: TerminateProcessRequest do:[:request|
+ done := true.
+ ].
] whileFalse:[
| eventset |
[
[
eventset := parser parseOutput.
+ (eventset contains:[:each | each isCommandResultEvent and:[ each status == #exit] ]) ifTrue:[
+ done := true.
+ ].
] on:StreamNotOpenError do:[ ^ self. ].
self pushEventSet:eventset.
] on:AbortOperationRequest do:[
@@ -213,7 +233,7 @@
]
"Created: / 02-06-2014 / 22:38:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 01-03-2015 / 08:26:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-06-2017 / 22:22:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
eventPumpStart
@@ -308,24 +328,18 @@
!
released: status
+ self pushEvent: GDBExitEvent new.
TraceProcesses ifTrue:[
Logger log: ('gdb process: exited with status %1' bindWith: status code) severity: #trace facility: 'GDB'.
- ].
- TraceProcesses ifTrue:[
Logger log: 'gdb process: waiting for event pump to finish' severity: #trace facility: 'GDB'.
].
- [ eventPumpProcess notNil ] whileTrue:[
- Delay waitForMilliseconds: 200.
- ].
- TraceProcesses ifTrue:[
- Logger log: ('gdb process: event pump finished' bindWith: status code) severity: #trace facility: 'GDB'.
- ].
+ self eventPumpStop.
eventQueueNotifier signalForAll.
process release.
inferiorPTY release.
"Created: / 26-05-2014 / 21:31:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 25-08-2014 / 08:55:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-06-2017 / 22:24:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBConnection class methodsFor:'documentation'!
--- a/GDBDebugger.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBDebugger.st Thu Jun 01 12:15:43 2017 +0100
@@ -33,6 +33,20 @@
"Created: / 02-06-2014 / 23:06:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+consoleInput
+ ^ connection consoleInput
+
+ "Created: / 31-05-2017 / 23:20:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-06-2017 / 23:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+consoleOutput
+ ^ connection consoleOutput
+
+ "Created: / 31-05-2017 / 23:20:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-06-2017 / 23:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
executable: aStringOrFilename
"Sets the executable to debug.
API equivalent to CLI command:
@@ -349,14 +363,6 @@
"Modified: / 20-06-2014 / 22:09:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
-onCommandResultEvent:aGDBCommandResultEvent
- aGDBCommandResultEvent result status == CommandStatusExit ifTrue:[
- connection pushEvent:GDBExitEvent new.
- ].
-
- "Created: / 07-09-2014 / 23:37:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
onExitEvent:aGDBExitEvent
self release.
@@ -510,7 +516,6 @@
subscribe
connection eventAnnouncerInternal
when: GDBCommandEvent send: #onCommandEvent: to: self;
- when: GDBCommandResultEvent send: #onCommandResultEvent: to: self;
when: GDBExitEvent send: #onExitEvent: to: self;
when: GDBThreadGroupAddedEvent send: #onThreadGroupAddedEvent: to: self;
@@ -524,7 +529,7 @@
when: GDBStoppedEvent send: #onStoppedEvent: to: self.
"Created: / 20-06-2014 / 22:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 07-09-2014 / 23:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-06-2017 / 21:18:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
unsubscribe
--- a/GDBEventSet.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBEventSet.st Thu Jun 01 12:15:43 2017 +0100
@@ -9,3 +9,11 @@
category:'GDB-Core-Events'
!
+
+!GDBEventSet class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/GDBMIParser.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBMIParser.st Thu Jun 01 12:15:43 2017 +0100
@@ -242,6 +242,16 @@
] ifFalse:[
peek == $^ ifTrue:[
events add: self parseResultRecord.
+ "/ Sigh, when using MI over PTY (as suggested by Pedro Alves),
+ "/ the PTY is kept open if GDB exits so peek block for ever.
+ "/ So, if ^exit status is reported, exit immediately.
+ (events last isCommandResultEvent and:[ events last status == #exit ]) ifTrue:[
+ events last token: token.
+ recorder notNil ifTrue:[
+ recorder recordResponseEnd.
+ ].
+ ^ events
+ ].
] ifFalse:[
self error:'Invalid MI record'.
].
@@ -258,7 +268,7 @@
^ events
"Created: / 30-05-2014 / 09:52:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 01-10-2014 / 09:36:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 31-05-2017 / 22:24:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
parsePostStartHeader
--- a/GDBMI_interpreter_exec.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBMI_interpreter_exec.st Thu Jun 01 12:15:43 2017 +0100
@@ -48,3 +48,10 @@
^ 'interpreter-exec'
! !
+!GDBMI_interpreter_exec class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/GDBPTY.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBPTY.st Thu Jun 01 12:15:43 2017 +0100
@@ -5,10 +5,11 @@
Object subclass:#GDBPTY
instanceVariableNames:'name master slave'
classVariableNames:''
- poolDictionaries:''
+ poolDictionaries:'TTYConstants'
category:'GDB-Private'
!
+
!GDBPTY class methodsFor:'instance creation'!
new
@@ -36,8 +37,9 @@
initialize
| triplet |
+ OperatingSystem isUNIXlike ifTrue:[
+ | attrs |
- OperatingSystem isUNIXlike ifTrue:[
"Use a pseudo-tty"
triplet := OperatingSystem makePTY.
@@ -49,8 +51,7 @@
master buffered:false.
slave := NonPositionableExternalStream forReadWriteToFileDescriptor:(triplet at:2).
- master buffered:false.
-
+ slave buffered:false.
] ifFalse:[
OperatingSystem isMSWINDOWSNTlike ifTrue:[
self error: 'Windows are not (yet) supported'
@@ -59,7 +60,7 @@
]
].
- "Modified: / 09-06-2014 / 18:23:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 31-05-2017 / 20:14:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
release
@@ -76,3 +77,53 @@
"Created: / 09-06-2014 / 18:25:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!GDBPTY methodsFor:'printing & storing'!
+
+printOn:aStream
+ "append a printed representation of the receiver to the argument, aStream"
+
+ super printOn:aStream.
+ aStream nextPutAll:'('.
+ name printOn:aStream.
+ aStream nextPutAll:')'.
+
+ "Modified: / 31-05-2017 / 20:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBPTY methodsFor:'setup'!
+
+setLocalEcho: aBoolean
+ | attrs |
+
+ attrs := master getTTYAttributes.
+ aBoolean ifTrue:[
+ attrs c_lflag: (attrs c_lflag bitOr: ECHO).
+ ] ifFalse:[
+ attrs c_lflag: (attrs c_lflag bitClear: ECHO).
+ ].
+ master setTTYAttributes: attrs.
+
+ "Created: / 31-05-2017 / 20:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+setOutputCRLF: aBoolean
+ | attrs |
+
+ attrs := master getTTYAttributes.
+ aBoolean ifTrue:[
+ attrs c_oflag: (attrs c_oflag bitOr: ONLCR).
+ ] ifFalse:[
+ attrs c_oflag: (attrs c_oflag bitClear: ONLCR).
+ ].
+ master setTTYAttributes: attrs.
+
+ "Created: / 31-05-2017 / 20:20:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBPTY class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/GDBProcess.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBProcess.st Thu Jun 01 12:15:43 2017 +0100
@@ -3,12 +3,13 @@
"{ NameSpace: Smalltalk }"
Object subclass:#GDBProcess
- instanceVariableNames:'pid debuggerInput debuggerOutput connection'
+ instanceVariableNames:'pid connection'
classVariableNames:''
poolDictionaries:''
category:'GDB-Private'
!
+
!GDBProcess class methodsFor:'instance creation'!
new
@@ -33,32 +34,41 @@
connection := aGDBConnection.
!
+consoleInput
+ ^ self subclassResponsibility
+
+ "Created: / 02-06-2017 / 23:35:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+consoleOutput
+ ^ self subclassResponsibility
+
+ "Created: / 02-06-2017 / 23:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
debuggerInput
- ^ debuggerInput
+ "raise an error: must be redefined in concrete subclass(es)"
+
+ ^ self subclassResponsibility
!
debuggerOutput
- ^ debuggerOutput
+ "raise an error: must be redefined in concrete subclass(es)"
+
+ ^ self subclassResponsibility
!
pid
^ pid
! !
-!GDBProcess methodsFor:'initialization'!
+!GDBProcess methodsFor:'initialization & release'!
release
pid := connection := nil.
- debuggerInput notNil ifTrue:[
- debuggerInput close.
- debuggerInput := nil.
- ].
- debuggerOutput notNil ifTrue:[
- debuggerOutput close.
- debuggerOutput := nil.
- ].
"Created: / 20-06-2014 / 21:35:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-06-2017 / 23:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBProcess methodsFor:'private'!
@@ -67,5 +77,13 @@
connection released: status
"Created: / 20-06-2014 / 21:35:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 31-05-2017 / 21:48:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!GDBProcess class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/GDBRunningEvent.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBRunningEvent.st Thu Jun 01 12:15:43 2017 +0100
@@ -9,6 +9,7 @@
category:'GDB-Core-Events'
!
+
!GDBRunningEvent class methodsFor:'accessing - GDB value descriptors'!
description
@@ -32,3 +33,10 @@
^ 'running'
! !
+!GDBRunningEvent class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/GDBSimulatorProcess.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBSimulatorProcess.st Thu Jun 01 12:15:43 2017 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
GDBProcess subclass:#GDBSimulatorProcess
- instanceVariableNames:'record thread steppingSemaphore'
+ instanceVariableNames:'record thread steppingSemaphore debuggerInput debuggerOutput'
classVariableNames:''
poolDictionaries:''
category:'GDB-Private-Simulator'
--- a/GDBUnixProcess.st Fri May 26 08:05:28 2017 +0100
+++ b/GDBUnixProcess.st Thu Jun 01 12:15:43 2017 +0100
@@ -3,7 +3,7 @@
"{ NameSpace: Smalltalk }"
GDBProcess subclass:#GDBUnixProcess
- instanceVariableNames:''
+ instanceVariableNames:'debuggerPTY consolePTY'
classVariableNames:'GDBExecutable'
poolDictionaries:''
category:'GDB-Private'
@@ -24,16 +24,44 @@
"Created: / 01-03-2015 / 08:07:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
-!GDBUnixProcess methodsFor:'initialization'!
+!GDBUnixProcess methodsFor:'accessing'!
+
+consoleInput
+ ^ consolePTY master
+
+ "Created: / 02-06-2017 / 23:36:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+consoleOutput
+ ^ consolePTY master
+
+ "Created: / 02-06-2017 / 23:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+debuggerInput
+ ^ debuggerPTY master
+
+ "Modified: / 26-05-2017 / 11:33:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+debuggerOutput
+ ^ debuggerPTY master
+
+ "Modified: / 26-05-2017 / 11:34:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBUnixProcess methodsFor:'initialization & release'!
initialize
- | inputPipe input outputPipe output args |
+ | conpty dbgpty args |
+
+ conpty := GDBPTY new.
- inputPipe := NonPositionableExternalStream makePipe.
- input := inputPipe second.
- outputPipe := NonPositionableExternalStream makePipe.
- output := outputPipe first.
- args := { GDBExecutable ? '/usr/bin/gdb' . '-q' . '-nx' . '--interpreter' . 'mi2' }.
+ dbgpty := GDBPTY new.
+ dbgpty setLocalEcho: false.
+ dbgpty setOutputCRLF: false.
+
+ args := { GDBExecutable ? '/usr/bin/gdb' . '-q' . '-ex' . 'new-ui mi ', dbgpty name . '-ex' . 'set pagination off' . '-ex' . 'show version'}.
Processor
monitor:[
pid := OperatingSystem
@@ -41,27 +69,38 @@
withArguments:args
environment:OperatingSystem getEnvironment
fileDescriptors:{
- inputPipe first fileDescriptor.
- outputPipe second fileDescriptor.
- outputPipe second fileDescriptor
+ conpty slave fileDescriptor.
+ conpty slave fileDescriptor.
+ conpty slave fileDescriptor
}
fork:true
newPgrp:false
- inDirectory:Filename currentDirectory.
- debuggerInput := input.
- debuggerOutput := output.
+ inDirectory:Filename currentDirectory
+ showWindow: false.
+ consolePTY := conpty.
+ debuggerPTY := dbgpty.
pid.
]
- action:[:stat | self exited:stat. ].
- inputPipe first close.
- outputPipe second close.
+ action:[:stat | self exited:stat ].
pid isNil ifTrue:[
- input close.
- output close.
+ conpty close.
+ dbgpty close.
self error:'Failed to launch gdb'.
].
- "Modified: / 01-03-2015 / 08:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-06-2017 / 08:18:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+release
+ debuggerPTY notNil ifTrue:[
+ debuggerPTY release.
+ ].
+ consolePTY notNil ifTrue:[
+ consolePTY release.
+ ].
+ super release
+
+ "Created: / 02-06-2017 / 23:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBUnixProcess class methodsFor:'documentation'!
--- a/Make.proto Fri May 26 08:05:28 2017 +0100
+++ b/Make.proto Thu Jun 01 12:15:43 2017 +0100
@@ -106,7 +106,6 @@
cd $(TOP)/libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
cd $(TOP)/libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
cd $(TOP)/libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- cd $(TOP)/goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
cd $(TOP)/libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
cd $(TOP)/goodies/magritte && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
@@ -139,7 +138,7 @@
$(OUTDIR)GDBMAContainer.$(O) GDBMAContainer.$(C) GDBMAContainer.$(H): GDBMAContainer.st $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MAContainer.$(H) $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MADescription.$(H) $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MAObject.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBMAPropertyAccessor.$(O) GDBMAPropertyAccessor.$(C) GDBMAPropertyAccessor.$(H): GDBMAPropertyAccessor.st $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MAAccessor.$(H) $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MAObject.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBObject.$(O) GDBObject.$(C) GDBObject.$(H): GDBObject.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)GDBPTY.$(O) GDBPTY.$(C) GDBPTY.$(H): GDBPTY.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)GDBPTY.$(O) GDBPTY.$(C) GDBPTY.$(H): GDBPTY.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/TTYConstants.$(H) $(STCHDR)
$(OUTDIR)GDBProcess.$(O) GDBProcess.$(C) GDBProcess.$(H): GDBProcess.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBSessionRecord.$(O) GDBSessionRecord.$(C) GDBSessionRecord.$(H): GDBSessionRecord.st $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(STCHDR)
$(OUTDIR)GDBThreadGroupType.$(O) GDBThreadGroupType.$(C) GDBThreadGroupType.$(H): GDBThreadGroupType.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -292,6 +291,7 @@
$(OUTDIR)GDBTransientObject.$(O) GDBTransientObject.$(C) GDBTransientObject.$(H): GDBTransientObject.st $(INCLUDE_TOP)/jv/libgdbs/GDBDebuggerObject.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBObject.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBBreakpointDeletedEvent.$(O) GDBBreakpointDeletedEvent.$(C) GDBBreakpointDeletedEvent.$(H): GDBBreakpointDeletedEvent.st $(INCLUDE_TOP)/jv/libgdbs/GDBAsyncEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBNotificationEvent.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Announcement.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBBreakpointEvent.$(O) GDBBreakpointEvent.$(C) GDBBreakpointEvent.$(H): GDBBreakpointEvent.st $(INCLUDE_TOP)/jv/libgdbs/GDBAsyncEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBNotificationEvent.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Announcement.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)GDBCmdParamChangedEvent.$(O) GDBCmdParamChangedEvent.$(C) GDBCmdParamChangedEvent.$(H): GDBCmdParamChangedEvent.st $(INCLUDE_TOP)/jv/libgdbs/GDBAsyncEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBNotificationEvent.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Announcement.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBEventSetProcessingFinished.$(O) GDBEventSetProcessingFinished.$(C) GDBEventSetProcessingFinished.$(H): GDBEventSetProcessingFinished.st $(INCLUDE_TOP)/jv/libgdbs/GDBEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBEventSetEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBInternalEvent.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Announcement.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBEventSetProcessingStarted.$(O) GDBEventSetProcessingStarted.$(C) GDBEventSetProcessingStarted.$(H): GDBEventSetProcessingStarted.st $(INCLUDE_TOP)/jv/libgdbs/GDBEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBEventSetEvent.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBInternalEvent.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Announcement.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBFrame.$(O) GDBFrame.$(C) GDBFrame.$(H): GDBFrame.st $(INCLUDE_TOP)/jv/libgdbs/GDBDebuggerObject.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBObject.$(H) $(INCLUDE_TOP)/jv/libgdbs/GDBTransientObject.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/Make.spec Fri May 26 08:05:28 2017 +0100
+++ b/Make.spec Thu Jun 01 12:15:43 2017 +0100
@@ -215,6 +215,7 @@
GDBTransientObject \
GDBBreakpointDeletedEvent \
GDBBreakpointEvent \
+ GDBCmdParamChangedEvent \
GDBEventSetProcessingFinished \
GDBEventSetProcessingStarted \
GDBFrame \
@@ -402,6 +403,7 @@
$(OUTDIR)GDBTransientObject.$(O) \
$(OUTDIR)GDBBreakpointDeletedEvent.$(O) \
$(OUTDIR)GDBBreakpointEvent.$(O) \
+ $(OUTDIR)GDBCmdParamChangedEvent.$(O) \
$(OUTDIR)GDBEventSetProcessingFinished.$(O) \
$(OUTDIR)GDBEventSetProcessingStarted.$(O) \
$(OUTDIR)GDBFrame.$(O) \
--- a/abbrev.stc Fri May 26 08:05:28 2017 +0100
+++ b/abbrev.stc Thu Jun 01 12:15:43 2017 +0100
@@ -15,7 +15,6 @@
GDBPTY GDBPTY jv:libgdbs 'GDB-Private' 0
GDBProcess GDBProcess jv:libgdbs 'GDB-Private' 0
GDBSessionRecord GDBSessionRecord jv:libgdbs 'GDB-Private-Simulator' 0
-GDBSimulatorResource GDBSimulatorResource jv:libgdbs 'GDB-Resources' 1
GDBThreadGroupType GDBThreadGroupType jv:libgdbs 'GDB-Core' 1
GDBThreadState GDBThreadState jv:libgdbs 'GDB-Core' 1
GDBTransientDataHolder GDBTransientDataHolder jv:libgdbs 'GDB-Private' 0
@@ -166,6 +165,7 @@
GDBTransientObject GDBTransientObject jv:libgdbs 'GDB-Core' 0
GDBBreakpointDeletedEvent GDBBreakpointDeletedEvent jv:libgdbs 'GDB-Core-Events' 0
GDBBreakpointEvent GDBBreakpointEvent jv:libgdbs 'GDB-Core-Events' 0
+GDBCmdParamChangedEvent GDBCmdParamChangedEvent jv:libgdbs 'GDB-Core-Events' 0
GDBEventSetProcessingFinished GDBEventSetProcessingFinished jv:libgdbs 'GDB-Core-Events' 0
GDBEventSetProcessingStarted GDBEventSetProcessingStarted jv:libgdbs 'GDB-Core-Events' 0
GDBFrame GDBFrame jv:libgdbs 'GDB-Core' 0
@@ -184,3 +184,4 @@
GDBThreadGroupAddedEvent GDBThreadGroupAddedEvent jv:libgdbs 'GDB-Core-Events' 0
GDBThreadGroupExitedEvent GDBThreadGroupExitedEvent jv:libgdbs 'GDB-Core-Events' 0
GDBThreadGroupStartedEvent GDBThreadGroupStartedEvent jv:libgdbs 'GDB-Core-Events' 0
+GDBSimulatorResource GDBSimulatorResource jv:libgdbs 'GDB-Resources' 1
--- a/bc.mak Fri May 26 08:05:28 2017 +0100
+++ b/bc.mak Thu Jun 01 12:15:43 2017 +0100
@@ -56,7 +56,6 @@
pushd ..\..\stx\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\stx\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\stx\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
- pushd ..\..\stx\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\stx\libwidg & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
pushd ..\..\stx\goodies\magritte & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
@@ -86,7 +85,7 @@
$(OUTDIR)GDBMAContainer.$(O) GDBMAContainer.$(C) GDBMAContainer.$(H): GDBMAContainer.st $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MAContainer.$(H) $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MADescription.$(H) $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MAObject.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBMAPropertyAccessor.$(O) GDBMAPropertyAccessor.$(C) GDBMAPropertyAccessor.$(H): GDBMAPropertyAccessor.st $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MAAccessor.$(H) $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MAObject.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBObject.$(O) GDBObject.$(C) GDBObject.$(H): GDBObject.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)GDBPTY.$(O) GDBPTY.$(C) GDBPTY.$(H): GDBPTY.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)GDBPTY.$(O) GDBPTY.$(C) GDBPTY.$(H): GDBPTY.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\TTYConstants.$(H) $(STCHDR)
$(OUTDIR)GDBProcess.$(O) GDBProcess.$(C) GDBProcess.$(H): GDBProcess.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBSessionRecord.$(O) GDBSessionRecord.$(C) GDBSessionRecord.$(H): GDBSessionRecord.st $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(STCHDR)
$(OUTDIR)GDBThreadGroupType.$(O) GDBThreadGroupType.$(C) GDBThreadGroupType.$(H): GDBThreadGroupType.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -239,6 +238,7 @@
$(OUTDIR)GDBTransientObject.$(O) GDBTransientObject.$(C) GDBTransientObject.$(H): GDBTransientObject.st $(INCLUDE_TOP)\jv\libgdbs\GDBDebuggerObject.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBObject.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBBreakpointDeletedEvent.$(O) GDBBreakpointDeletedEvent.$(C) GDBBreakpointDeletedEvent.$(H): GDBBreakpointDeletedEvent.st $(INCLUDE_TOP)\jv\libgdbs\GDBAsyncEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBNotificationEvent.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Announcement.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBBreakpointEvent.$(O) GDBBreakpointEvent.$(C) GDBBreakpointEvent.$(H): GDBBreakpointEvent.st $(INCLUDE_TOP)\jv\libgdbs\GDBAsyncEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBNotificationEvent.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Announcement.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)GDBCmdParamChangedEvent.$(O) GDBCmdParamChangedEvent.$(C) GDBCmdParamChangedEvent.$(H): GDBCmdParamChangedEvent.st $(INCLUDE_TOP)\jv\libgdbs\GDBAsyncEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBNotificationEvent.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Announcement.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBEventSetProcessingFinished.$(O) GDBEventSetProcessingFinished.$(C) GDBEventSetProcessingFinished.$(H): GDBEventSetProcessingFinished.st $(INCLUDE_TOP)\jv\libgdbs\GDBEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBEventSetEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBInternalEvent.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Announcement.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBEventSetProcessingStarted.$(O) GDBEventSetProcessingStarted.$(C) GDBEventSetProcessingStarted.$(H): GDBEventSetProcessingStarted.st $(INCLUDE_TOP)\jv\libgdbs\GDBEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBEventSetEvent.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBInternalEvent.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Announcement.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
$(OUTDIR)GDBFrame.$(O) GDBFrame.$(C) GDBFrame.$(H): GDBFrame.st $(INCLUDE_TOP)\jv\libgdbs\GDBDebuggerObject.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBObject.$(H) $(INCLUDE_TOP)\jv\libgdbs\GDBTransientObject.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
--- a/jv_libgdbs.st Fri May 26 08:05:28 2017 +0100
+++ b/jv_libgdbs.st Thu Jun 01 12:15:43 2017 +0100
@@ -27,12 +27,12 @@
are extended by myself.
They are mandatory, because we need these packages as a prerequisite for loading and compiling.
This method is generated automatically,
- by searching along the inheritance chain of all of my classes."
+ by searching along the inheritance chain of all of my classes.
+ Please take a look at the #referencedPreRequisites method as well."
^ #(
#'stx:goodies/announcements' "Announcement - superclass of GDBAsyncEvent"
#'stx:goodies/magritte' "Magritte::MAAccessor - superclass of GDBMAPropertyAccessor"
- #'stx:goodies/sunit' "TestAsserter - superclass of GDBSimulatorResource"
#'stx:libbasic' "Collection - superclass of GDBEventSet"
)
!
@@ -40,14 +40,16 @@
referencedPreRequisites
"list packages which are a prerequisite, because they contain
classes which are referenced by my classes.
- We do not need these packages as a prerequisite for compiling or loading,
+ These packages are NOT needed as a prerequisite for compiling or loading,
however, a class from it may be referenced during execution and having it
unloaded then may lead to a runtime doesNotUnderstand error, unless the caller
includes explicit checks for the package being present.
This method is generated automatically,
- by searching all classes (and their packages) which are referenced by my classes."
+ by searching all classes (and their packages) which are referenced by my classes.
+ Please also take a look at the #mandatoryPreRequisites method"
^ #(
+ #'stx:goodies/sunit' "TestAsserter - superclass of GDBSimulatorResource"
#'stx:libbasic2' "List - referenced by GDBDebugger>>onThreadGroupAddedEvent:"
#'stx:libview2' "ApplicationModel - referenced by GDBEventSubscription class>>blockFor:withSelector:"
)
@@ -87,7 +89,6 @@
GDBPTY
GDBProcess
GDBSessionRecord
- (GDBSimulatorResource autoload)
GDBThreadGroupType
GDBThreadState
GDBTransientDataHolder
@@ -238,6 +239,7 @@
GDBTransientObject
GDBBreakpointDeletedEvent
GDBBreakpointEvent
+ GDBCmdParamChangedEvent
GDBEventSetProcessingFinished
GDBEventSetProcessingStarted
GDBFrame
@@ -256,12 +258,15 @@
GDBThreadGroupAddedEvent
GDBThreadGroupExitedEvent
GDBThreadGroupStartedEvent
+ (GDBSimulatorResource autoload)
)
!
extensionMethodNames
- "list class/selector pairs of extensions.
- A correponding method with real names must be present in my concrete subclasses"
+ "lists the extension methods which are to be included in the project.
+ Entries are 2-element array literals, consisting of class-name and selector.
+ A correponding method with real names must be present in my concrete subclasses
+ if it has extensions."
^ #(
#'Magritte::MABooleanDescription' parseUsingGDBMIParser:
--- a/libInit.cc Fri May 26 08:05:28 2017 +0100
+++ b/libInit.cc Thu Jun 01 12:15:43 2017 +0100
@@ -180,6 +180,7 @@
extern void _GDBTransientObject_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
extern void _GDBBreakpointDeletedEvent_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
extern void _GDBBreakpointEvent_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
+extern void _GDBCmdParamChangedEvent_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
extern void _GDBEventSetProcessingFinished_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
extern void _GDBEventSetProcessingStarted_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
extern void _GDBFrame_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
@@ -376,6 +377,7 @@
_GDBTransientObject_Init(pass,__pRT__,snd);
_GDBBreakpointDeletedEvent_Init(pass,__pRT__,snd);
_GDBBreakpointEvent_Init(pass,__pRT__,snd);
+ _GDBCmdParamChangedEvent_Init(pass,__pRT__,snd);
_GDBEventSetProcessingFinished_Init(pass,__pRT__,snd);
_GDBEventSetProcessingStarted_Init(pass,__pRT__,snd);
_GDBFrame_Init(pass,__pRT__,snd);
--- a/tests/GDBDebuggeesResource.st Fri May 26 08:05:28 2017 +0100
+++ b/tests/GDBDebuggeesResource.st Thu Jun 01 12:15:43 2017 +0100
@@ -52,3 +52,10 @@
"Created: / 08-03-2015 / 07:24:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!GDBDebuggeesResource class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+
--- a/tests/GDBDebuggerTestsR.st Fri May 26 08:05:28 2017 +0100
+++ b/tests/GDBDebuggerTestsR.st Thu Jun 01 12:15:43 2017 +0100
@@ -69,10 +69,12 @@
debugger send: 'd'.
debugger send: 'c' andWaitFor: GDBThreadGroupExitedEvent.
- self assert: thread1 isDead
+ self assert: thread1 isDead.
+
+ debugger send: 'quit' andWait: false.
"Created: / 28-02-2015 / 00:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 24-05-2017 / 15:18:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-06-2017 / 21:44:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
test_03
@@ -99,8 +101,10 @@
debugger send: 'c' andWaitFor: GDBThreadGroupExitedEvent.
+ debugger send: 'quit' andWait: false
+
"Created: / 08-03-2015 / 07:42:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 18-03-2015 / 14:01:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 01-06-2017 / 22:30:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
test_basic_01
@@ -110,14 +114,17 @@
self assert: debugger isConnected.
timeouted := ([
debugger send: (GDBMI_gdb_exit new).
- true.
+ [ debugger isConnected ] whileTrue:[
+ Delay waitForMilliseconds: 200.
+ ].
+ 1.
] valueWithTimeout: 3 seconds) isNil.
self assert: timeouted not.
self assert: debugger isConnected not.
"Created: / 24-06-2014 / 09:06:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified (format): / 06-09-2014 / 02:16:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 31-05-2017 / 22:42:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GDBDebuggerTestsR class methodsFor:'documentation'!
--- a/tests/GDBMIParserTests.st Fri May 26 08:05:28 2017 +0100
+++ b/tests/GDBMIParserTests.st Thu Jun 01 12:15:43 2017 +0100
@@ -117,6 +117,22 @@
"Created: / 20-06-2014 / 09:08:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
+test_command_gdb_exit
+ | parser events result |
+
+ parser := GDBMIParser
+ on:'1^exit'.
+ parser token2CommandMappingBlock:[:token | GDBMI_gdb_exit new ].
+ events := parser parseOutput.
+
+ self assert:events size == 1.
+ result := events first result.
+
+ self assert:result value isNil.
+
+ "Created: / 31-05-2017 / 21:19:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
test_command_stack_list_frames_01
| parser events |
--- a/tests/jv_libgdbs_tests.st Fri May 26 08:05:28 2017 +0100
+++ b/tests/jv_libgdbs_tests.st Thu Jun 01 12:15:43 2017 +0100
@@ -27,7 +27,8 @@
are extended by myself.
They are mandatory, because we need these packages as a prerequisite for loading and compiling.
This method is generated automatically,
- by searching along the inheritance chain of all of my classes."
+ by searching along the inheritance chain of all of my classes.
+ Please take a look at the #referencedPreRequisites method as well."
^ #(
#'jv:libgdbs' "GDBCommandStatus - shared pool used by GDBMIParserTests"
@@ -39,12 +40,13 @@
referencedPreRequisites
"list packages which are a prerequisite, because they contain
classes which are referenced by my classes.
- We do not need these packages as a prerequisite for compiling or loading,
+ These packages are NOT needed as a prerequisite for compiling or loading,
however, a class from it may be referenced during execution and having it
unloaded then may lead to a runtime doesNotUnderstand error, unless the caller
includes explicit checks for the package being present.
This method is generated automatically,
- by searching all classes (and their packages) which are referenced by my classes."
+ by searching all classes (and their packages) which are referenced by my classes.
+ Please also take a look at the #mandatoryPreRequisites method"
^ #(
#'stx:goodies/magritte' "Magritte::MAReadError - referenced by GDBMIParserTests>>test_typed_object_03a"
@@ -83,8 +85,10 @@
!
extensionMethodNames
- "list class/selector pairs of extensions.
- A correponding method with real names must be present in my concrete subclasses"
+ "lists the extension methods which are to be included in the project.
+ Entries are 2-element array literals, consisting of class-name and selector.
+ A correponding method with real names must be present in my concrete subclasses
+ if it has extensions."
^ #(
)