Add support for instruction dissection
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 16 Aug 2018 10:44:59 +0100
changeset 133 026074322527
parent 132 70c17add3b24
child 134 3abcf54431c1
Add support for instruction dissection Advanced clients (such as VDB) may need to analyze instructions further to extract baci block, jump targets and so on. This is now supported through "instruction dissection". If architecture (ISA) is known, specific `GDBArchitecture` may implement `#disassemble1:pc:` method that returns custom instruction model. This object must implement `GDBInstructionDIssection` protocol. As of now, instruction dissection is implemeted only for i386 and x84_64 targets, usinf UDIS86 disassembler.
GDBArch_i386.st
GDBArch_x86.st
GDBArch_x86_64.st
GDBArchitecture.st
GDBInstruction.st
GDBInstructionDissection.st
GDBInstructionsAndSourceLine.st
GDBMI_catch_exception.st
Make.proto
Make.spec
abbrev.stc
bc.mak
jv_libgdbs.st
libInit.cc
--- a/GDBArch_i386.st	Thu Aug 16 10:06:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-"
-jv:libgdbs - GNU Debugger Interface Library
-Copyright (C) 2015-now Jan Vrany
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License. 
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-"
-"{ Package: 'jv:libgdbs' }"
-
-"{ NameSpace: Smalltalk }"
-
-GDBArchitecture subclass:#GDBArch_i386
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	category:'GDB-Core'
-!
-
-!GDBArch_i386 class methodsFor:'documentation'!
-
-copyright
-"
-jv:libgdbs - GNU Debugger Interface Library
-Copyright (C) 2015-now Jan Vrany
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License. 
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-"
-! !
-
-!GDBArch_i386 methodsFor:'accessing'!
-
-name
-    ^ 'i386'
-
-    "Created: / 16-08-2018 / 07:37:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!GDBArch_i386 methodsFor:'queries'!
-
-sizeofPointer
-    ^ 4
-
-    "Created: / 16-08-2018 / 09:36:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GDBArch_x86.st	Thu Aug 16 10:44:59 2018 +0100
@@ -0,0 +1,129 @@
+"
+jv:libgdbs - GNU Debugger Interface Library
+Copyright (C) 2015-now Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+"{ Package: 'jv:libgdbs' }"
+
+"{ NameSpace: Smalltalk }"
+
+GDBArchitecture subclass:#GDBArch_x86
+	instanceVariableNames:'mode disassembler buffer'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'GDB-Core'
+!
+
+!GDBArch_x86 class methodsFor:'documentation'!
+
+copyright
+"
+jv:libgdbs - GNU Debugger Interface Library
+Copyright (C) 2015-now Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+! !
+
+!GDBArch_x86 class methodsFor:'initialization'!
+
+initialize
+    "Invoked at system start or when the class is dynamically loaded."
+
+    (Smalltalk includesKey:#UDIS86) ifFalse:[ 
+        Smalltalk loadPackage: 'jv:dragonfly/udis86sx'.
+    ].
+
+    "/ please change as required (and remove this comment)
+
+    "Modified: / 16-08-2018 / 13:59:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBArch_x86 methodsFor:'accessing'!
+
+name
+    ^ mode == 64 ifTrue:[ 'x86_64' ] ifFalse:[ 'i386' ]
+
+    "Created: / 16-08-2018 / 07:37:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-08-2018 / 11:01:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBArch_x86 methodsFor:'initialization'!
+
+setMode: anInteger
+    self assert: (anInteger == 32 or:[ anInteger == 64 ]).
+    mode := anInteger.
+    (Smalltalk includesKey:#UDIS86) ifTrue:[
+        disassembler := (Smalltalk at:#UDIS86) new.
+        disassembler mode: mode.
+        buffer := ExternalBytes unprotectedNew: 16
+    ].
+
+    "Created: / 16-08-2018 / 11:00:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-08-2018 / 07:53:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBArch_x86 methodsFor:'queries'!
+
+sizeofPointer
+    ^ 8
+
+    "Created: / 16-08-2018 / 09:35:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBArch_x86 methodsFor:'utilities'!
+
+disassemble1: bytes pc: pc
+    "
+    Disassemble one instruction from given bytes (as ByteArray)
+    and return the instruction dissection. Returned object must
+    conform to GDBInstructionDissection protocol.
+
+    @see GDBInstructionDissection
+    "
+    disassembler isNil ifTrue:[ 
+        "/ UDIS86 not available.
+        ^ super disassemble1: bytes pc: pc
+    ].
+    buffer replaceBytesFrom: 1  to: bytes size with: bytes startingAt: 1.
+    disassembler buffer: buffer pc: pc.
+    ^ disassembler disassemble
+
+    "Created: / 16-08-2018 / 11:07:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-08-2018 / 14:00:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBArch_x86 class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
+
+GDBArch_x86 initialize!
--- a/GDBArch_x86_64.st	Thu Aug 16 10:06:02 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-"
-jv:libgdbs - GNU Debugger Interface Library
-Copyright (C) 2015-now Jan Vrany
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License. 
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-"
-"{ Package: 'jv:libgdbs' }"
-
-"{ NameSpace: Smalltalk }"
-
-GDBArchitecture subclass:#GDBArch_x86_64
-	instanceVariableNames:''
-	classVariableNames:''
-	poolDictionaries:''
-	category:'GDB-Core'
-!
-
-!GDBArch_x86_64 class methodsFor:'documentation'!
-
-copyright
-"
-jv:libgdbs - GNU Debugger Interface Library
-Copyright (C) 2015-now Jan Vrany
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License. 
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-"
-! !
-
-!GDBArch_x86_64 methodsFor:'accessing'!
-
-name
-    ^ 'x86_64'
-
-    "Created: / 16-08-2018 / 07:37:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
-!GDBArch_x86_64 methodsFor:'queries'!
-
-sizeofPointer
-    ^ 8
-
-    "Created: / 16-08-2018 / 09:35:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
--- a/GDBArchitecture.st	Thu Aug 16 10:06:02 2018 +0100
+++ b/GDBArchitecture.st	Thu Aug 16 10:44:59 2018 +0100
@@ -79,10 +79,10 @@
     "/ please change as required (and remove this comment)
 
     Architectures := Dictionary new.
-    Architectures at: 'i386'        put: GDBArch_i386 new.
-    Architectures at: 'i386:x86_64' put: GDBArch_x86_64 new.
+    Architectures at: 'i386'        put: (GDBArch_x86 new setMode: 32; yourself).
+    Architectures at: 'i386:x86-64' put: (GDBArch_x86 new setMode: 64; yourself).
 
-    "Modified: / 16-08-2018 / 08:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-08-2018 / 11:12:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !GDBArchitecture class methodsFor:'instance creation'!
@@ -93,11 +93,12 @@
         ifAbsentPut:[GDBArch_unknown new setName: aString ].
 
     "
-    GDBArchitecture named: 'i386:x86_64'
+    GDBArchitecture named: 'i386:x86-64'
     GDBArchitecture named: 'mips'
     "
 
     "Created: / 16-08-2018 / 08:57:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 16-08-2018 / 11:12:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !GDBArchitecture methodsFor:'accessing'!
@@ -128,5 +129,20 @@
     "Created: / 16-08-2018 / 09:35:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!GDBArchitecture methodsFor:'utilities'!
+
+disassemble1: bytes pc: pc
+    "
+    Disassemble one instruction from given bytes (as ByteArray)
+    and return the instruction dissection. Returned object must
+    conform to GDBInstructionDissection protocol.
+
+    @see GDBInstructionDissection
+    "
+    ^ GDBInstructionDissection null
+
+    "Created: / 16-08-2018 / 10:56:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 
 GDBArchitecture initialize!
--- a/GDBInstruction.st	Thu Aug 16 10:06:02 2018 +0100
+++ b/GDBInstruction.st	Thu Aug 16 10:44:59 2018 +0100
@@ -21,7 +21,7 @@
 "{ NameSpace: Smalltalk }"
 
 GDBDebuggerObject subclass:#GDBInstruction
-	instanceVariableNames:'address offset func_name inst opcodes arch'
+	instanceVariableNames:'address offset func_name inst opcodes arch dissection'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'GDB-Core'
@@ -79,6 +79,16 @@
     "Created: / 22-06-2018 / 11:13:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+branchTarget
+    dissection isNil ifTrue:[
+        self dissect
+    ].
+    ^ dissection branchTarget
+
+    "Created: / 16-08-2018 / 11:13:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-08-2018 / 14:11:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 func
     ^ func_name
 
@@ -93,6 +103,14 @@
     ^ opcodes
 ! !
 
+!GDBInstruction methodsFor:'enumerating'!
+
+instructionsDo: aBlock
+    aBlock value: self
+
+    "Created: / 16-08-2018 / 11:32:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !GDBInstruction methodsFor:'initialization & release'!
 
 setArchitecture: aGDBArchitecture
@@ -101,17 +119,42 @@
     "Created: / 16-08-2018 / 09:38:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!GDBInstruction methodsFor:'private'!
+
+dissect
+    "raise an error: this method should be implemented (TODO)"
+
+    dissection := self arch disassemble1: opcodes pc: self address
+
+    "Created: / 16-08-2018 / 10:28:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !GDBInstruction methodsFor:'testing'!
 
-isBranchInstruction
-    ^ false
+isBranch
+    dissection isNil ifTrue:[
+        self dissect
+    ].
+    ^ dissection isBranch
 
     "Created: / 03-07-2018 / 14:39:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-08-2018 / 10:28:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-isReturnInstruction
-    ^ false
+isReturn
+    dissection isNil ifTrue:[
+        self dissect
+    ].
+    ^ dissection isReturn
 
     "Created: / 03-07-2018 / 14:39:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 16-08-2018 / 14:11:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!GDBInstruction class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GDBInstructionDissection.st	Thu Aug 16 10:44:59 2018 +0100
@@ -0,0 +1,104 @@
+"
+jv:libgdbs - GNU Debugger Interface Library
+Copyright (C) 2015-now Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+"{ Package: 'jv:libgdbs' }"
+
+"{ NameSpace: Smalltalk }"
+
+Object subclass:#GDBInstructionDissection
+	instanceVariableNames:''
+	classVariableNames:'Null'
+	poolDictionaries:''
+	category:'GDB-Private'
+!
+
+!GDBInstructionDissection class methodsFor:'documentation'!
+
+copyright
+"
+jv:libgdbs - GNU Debugger Interface Library
+Copyright (C) 2015-now Jan Vrany
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License. 
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+"
+! !
+
+!GDBInstructionDissection class methodsFor:'initialization'!
+
+initialize
+    "Invoked at system start or when the class is dynamically loaded."
+
+    "/ please change as required (and remove this comment)
+
+    Null := self new
+
+    "Modified: / 16-08-2018 / 10:27:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBInstructionDissection class methodsFor:'accessing'!
+
+null
+    ^ Null
+
+    "Created: / 16-08-2018 / 10:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBInstructionDissection methodsFor:'accessing'!
+
+branchTarget
+    "Return and address of next instruction if branch is taken.
+     Assumes that this instruction is a branch instruction."
+
+    self shouldNeverBeSent "since isBranchInstruction returns false"
+
+    "Created: / 16-08-2018 / 10:33:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 16-08-2018 / 14:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!GDBInstructionDissection methodsFor:'testing'!
+
+isBranch
+    "Return `true` is this instruction is some sort of branch instruction."
+    ^ false
+
+    "Created: / 03-07-2018 / 14:39:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 16-08-2018 / 14:02:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isReturn
+    "Return `true` is this instruction is a return"
+    ^ false
+
+    "Created: / 03-07-2018 / 14:39:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 16-08-2018 / 14:02:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+
+GDBInstructionDissection initialize!
--- a/GDBInstructionsAndSourceLine.st	Thu Aug 16 10:06:02 2018 +0100
+++ b/GDBInstructionsAndSourceLine.st	Thu Aug 16 10:44:59 2018 +0100
@@ -155,6 +155,14 @@
     "Created: / 07-08-2018 / 11:32:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!GDBInstructionsAndSourceLine methodsFor:'enumerating'!
+
+instructionsDo: aBlock
+    line_asm_insn ? #() do: aBlock
+
+    "Created: / 16-08-2018 / 11:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !GDBInstructionsAndSourceLine methodsFor:'initialization & release'!
 
 setArchitecture: aGDBArchitecture
@@ -172,13 +180,13 @@
 
 !GDBInstructionsAndSourceLine methodsFor:'testing'!
 
-isBranchInstruction
+isBranch
     ^ false
 
     "Created: / 03-07-2018 / 14:39:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-isReturnInstruction
+isReturn
     ^ false
 
     "Created: / 03-07-2018 / 14:39:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
--- a/GDBMI_catch_exception.st	Thu Aug 16 10:06:02 2018 +0100
+++ b/GDBMI_catch_exception.st	Thu Aug 16 10:44:59 2018 +0100
@@ -111,3 +111,10 @@
 	^ 'catch-exception'
 ! !
 
+!GDBMI_catch_exception class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/Make.proto	Thu Aug 16 10:06:02 2018 +0100
+++ b/Make.proto	Thu Aug 16 10:44:59 2018 +0100
@@ -34,7 +34,7 @@
 # add the path(es) here:,
 # ********** OPTIONAL: MODIFY the next lines ***
 # LOCALINCLUDES=-Ifoo -Ibar
-LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/announcements -I$(INCLUDE_TOP)/stx/goodies/magritte -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg
+LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/announcements -I$(INCLUDE_TOP)/stx/goodies/magritte -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic2 -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg
 
 
 # if you need any additional defines for embedded C code,
@@ -136,6 +136,7 @@
 $(OUTDIR)GDBEventSet.$(O) GDBEventSet.$(C) GDBEventSet.$(H): GDBEventSet.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)GDBEventSubscription.$(O) GDBEventSubscription.$(C) GDBEventSubscription.$(H): GDBEventSubscription.st $(INCLUDE_TOP)/stx/goodies/announcements/StrongSubscription.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Subscription.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)GDBFeatures.$(O) GDBFeatures.$(C) GDBFeatures.$(H): GDBFeatures.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/SharedPool.$(H) $(STCHDR)
+$(OUTDIR)GDBInstructionDissection.$(O) GDBInstructionDissection.$(C) GDBInstructionDissection.$(H): GDBInstructionDissection.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)GDBInternalPipeStream.$(O) GDBInternalPipeStream.$(C) GDBInternalPipeStream.$(H): GDBInternalPipeStream.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Stream.$(H) $(STCHDR)
 $(OUTDIR)GDBMAByteArrayDescription.$(O) GDBMAByteArrayDescription.$(C) GDBMAByteArrayDescription.$(H): GDBMAByteArrayDescription.st $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MADescription.$(H) $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MAElementDescription.$(H) $(INCLUDE_TOP)/stx/goodies/magritte/Magritte__MAObject.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(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)
@@ -152,9 +153,8 @@
 $(OUTDIR)GDBThreadState.$(O) GDBThreadState.$(C) GDBThreadState.$(H): GDBThreadState.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)GDBTransientDataHolder.$(O) GDBTransientDataHolder.$(C) GDBTransientDataHolder.$(H): GDBTransientDataHolder.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)jv_libgdbs.$(O) jv_libgdbs.$(C) jv_libgdbs.$(H): jv_libgdbs.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
-$(OUTDIR)GDBArch_i386.$(O) GDBArch_i386.$(C) GDBArch_i386.$(H): GDBArch_i386.st $(INCLUDE_TOP)/jv/libgdbs/GDBArchitecture.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)GDBArch_unknown.$(O) GDBArch_unknown.$(C) GDBArch_unknown.$(H): GDBArch_unknown.st $(INCLUDE_TOP)/jv/libgdbs/GDBArchitecture.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)GDBArch_x86_64.$(O) GDBArch_x86_64.$(C) GDBArch_x86_64.$(H): GDBArch_x86_64.st $(INCLUDE_TOP)/jv/libgdbs/GDBArchitecture.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)GDBArch_x86.$(O) GDBArch_x86.$(C) GDBArch_x86.$(H): GDBArch_x86.st $(INCLUDE_TOP)/jv/libgdbs/GDBArchitecture.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)GDBAsyncEvent.$(O) GDBAsyncEvent.$(C) GDBAsyncEvent.$(H): GDBAsyncEvent.st $(INCLUDE_TOP)/jv/libgdbs/GDBEvent.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Announcement.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)GDBCLICommand.$(O) GDBCLICommand.$(C) GDBCLICommand.$(H): GDBCLICommand.st $(INCLUDE_TOP)/jv/libgdbs/GDBCommand.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)GDBCommandEvent.$(O) GDBCommandEvent.$(C) GDBCommandEvent.$(H): GDBCommandEvent.st $(INCLUDE_TOP)/jv/libgdbs/GDBEvent.$(H) $(INCLUDE_TOP)/stx/goodies/announcements/Announcement.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/Make.spec	Thu Aug 16 10:06:02 2018 +0100
+++ b/Make.spec	Thu Aug 16 10:44:59 2018 +0100
@@ -60,6 +60,7 @@
 	GDBEventSet \
 	GDBEventSubscription \
 	GDBFeatures \
+	GDBInstructionDissection \
 	GDBInternalPipeStream \
 	GDBMAByteArrayDescription \
 	GDBMAContainer \
@@ -76,9 +77,8 @@
 	GDBThreadState \
 	GDBTransientDataHolder \
 	jv_libgdbs \
-	GDBArch_i386 \
 	GDBArch_unknown \
-	GDBArch_x86_64 \
+	GDBArch_x86 \
 	GDBAsyncEvent \
 	GDBCLICommand \
 	GDBCommandEvent \
@@ -267,6 +267,7 @@
     $(OUTDIR)GDBEventSet.$(O) \
     $(OUTDIR)GDBEventSubscription.$(O) \
     $(OUTDIR)GDBFeatures.$(O) \
+    $(OUTDIR)GDBInstructionDissection.$(O) \
     $(OUTDIR)GDBInternalPipeStream.$(O) \
     $(OUTDIR)GDBMAByteArrayDescription.$(O) \
     $(OUTDIR)GDBMAContainer.$(O) \
@@ -283,9 +284,8 @@
     $(OUTDIR)GDBThreadState.$(O) \
     $(OUTDIR)GDBTransientDataHolder.$(O) \
     $(OUTDIR)jv_libgdbs.$(O) \
-    $(OUTDIR)GDBArch_i386.$(O) \
     $(OUTDIR)GDBArch_unknown.$(O) \
-    $(OUTDIR)GDBArch_x86_64.$(O) \
+    $(OUTDIR)GDBArch_x86.$(O) \
     $(OUTDIR)GDBAsyncEvent.$(O) \
     $(OUTDIR)GDBCLICommand.$(O) \
     $(OUTDIR)GDBCommandEvent.$(O) \
--- a/abbrev.stc	Thu Aug 16 10:06:02 2018 +0100
+++ b/abbrev.stc	Thu Aug 16 10:44:59 2018 +0100
@@ -10,6 +10,7 @@
 GDBEventSet GDBEventSet jv:libgdbs 'GDB-Core-Events' 0
 GDBEventSubscription GDBEventSubscription jv:libgdbs 'GDB-Private' 0
 GDBFeatures GDBFeatures jv:libgdbs 'GDB-Core' 0
+GDBInstructionDissection GDBInstructionDissection jv:libgdbs 'GDB-Private' 0
 GDBInternalPipeStream GDBInternalPipeStream jv:libgdbs 'GDB-Support' 0
 GDBMAByteArrayDescription GDBMAByteArrayDescription jv:libgdbs 'GDB-Support' 0
 GDBMAContainer GDBMAContainer jv:libgdbs 'GDB-Support' 0
@@ -26,9 +27,8 @@
 GDBThreadState GDBThreadState jv:libgdbs 'GDB-Core' 1
 GDBTransientDataHolder GDBTransientDataHolder jv:libgdbs 'GDB-Private' 0
 jv_libgdbs jv_libgdbs jv:libgdbs '* Projects & Packages *' 3
-GDBArch_i386 GDBArch_i386 jv:libgdbs 'GDB-Core' 0
 GDBArch_unknown GDBArch_unknown jv:libgdbs 'GDB-Core' 0
-GDBArch_x86_64 GDBArch_x86_64 jv:libgdbs 'GDB-Core' 0
+GDBArch_x86 GDBArch_x86 jv:libgdbs 'GDB-Core' 0
 GDBAsyncEvent GDBAsyncEvent jv:libgdbs 'GDB-Core-Events' 0
 GDBCLICommand GDBCLICommand jv:libgdbs 'GDB-Core-Commands' 0
 GDBCommandEvent GDBCommandEvent jv:libgdbs 'GDB-Core-Events' 0
--- a/bc.mak	Thu Aug 16 10:06:02 2018 +0100
+++ b/bc.mak	Thu Aug 16 10:44:59 2018 +0100
@@ -35,7 +35,7 @@
 
 
 
-LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\announcements -I$(INCLUDE_TOP)\stx\goodies\magritte -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg
+LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\announcements -I$(INCLUDE_TOP)\stx\goodies\magritte -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libbasic2 -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libview2 -I$(INCLUDE_TOP)\stx\libwidg
 LOCALDEFINES=
 
 STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
@@ -83,6 +83,7 @@
 $(OUTDIR)GDBEventSet.$(O) GDBEventSet.$(C) GDBEventSet.$(H): GDBEventSet.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)GDBEventSubscription.$(O) GDBEventSubscription.$(C) GDBEventSubscription.$(H): GDBEventSubscription.st $(INCLUDE_TOP)\stx\goodies\announcements\StrongSubscription.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Subscription.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)GDBFeatures.$(O) GDBFeatures.$(C) GDBFeatures.$(H): GDBFeatures.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\SharedPool.$(H) $(STCHDR)
+$(OUTDIR)GDBInstructionDissection.$(O) GDBInstructionDissection.$(C) GDBInstructionDissection.$(H): GDBInstructionDissection.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)GDBInternalPipeStream.$(O) GDBInternalPipeStream.$(C) GDBInternalPipeStream.$(H): GDBInternalPipeStream.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(STCHDR)
 $(OUTDIR)GDBMAByteArrayDescription.$(O) GDBMAByteArrayDescription.$(C) GDBMAByteArrayDescription.$(H): GDBMAByteArrayDescription.st $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MADescription.$(H) $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MAElementDescription.$(H) $(INCLUDE_TOP)\stx\goodies\magritte\Magritte__MAObject.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(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)
@@ -99,9 +100,8 @@
 $(OUTDIR)GDBThreadState.$(O) GDBThreadState.$(C) GDBThreadState.$(H): GDBThreadState.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)GDBTransientDataHolder.$(O) GDBTransientDataHolder.$(C) GDBTransientDataHolder.$(H): GDBTransientDataHolder.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)jv_libgdbs.$(O) jv_libgdbs.$(C) jv_libgdbs.$(H): jv_libgdbs.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
-$(OUTDIR)GDBArch_i386.$(O) GDBArch_i386.$(C) GDBArch_i386.$(H): GDBArch_i386.st $(INCLUDE_TOP)\jv\libgdbs\GDBArchitecture.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)GDBArch_unknown.$(O) GDBArch_unknown.$(C) GDBArch_unknown.$(H): GDBArch_unknown.st $(INCLUDE_TOP)\jv\libgdbs\GDBArchitecture.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)GDBArch_x86_64.$(O) GDBArch_x86_64.$(C) GDBArch_x86_64.$(H): GDBArch_x86_64.st $(INCLUDE_TOP)\jv\libgdbs\GDBArchitecture.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)GDBArch_x86.$(O) GDBArch_x86.$(C) GDBArch_x86.$(H): GDBArch_x86.st $(INCLUDE_TOP)\jv\libgdbs\GDBArchitecture.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)GDBAsyncEvent.$(O) GDBAsyncEvent.$(C) GDBAsyncEvent.$(H): GDBAsyncEvent.st $(INCLUDE_TOP)\jv\libgdbs\GDBEvent.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Announcement.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)GDBCLICommand.$(O) GDBCLICommand.$(C) GDBCLICommand.$(H): GDBCLICommand.st $(INCLUDE_TOP)\jv\libgdbs\GDBCommand.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)GDBCommandEvent.$(O) GDBCommandEvent.$(C) GDBCommandEvent.$(H): GDBCommandEvent.st $(INCLUDE_TOP)\jv\libgdbs\GDBEvent.$(H) $(INCLUDE_TOP)\stx\goodies\announcements\Announcement.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
--- a/jv_libgdbs.st	Thu Aug 16 10:06:02 2018 +0100
+++ b/jv_libgdbs.st	Thu Aug 16 10:44:59 2018 +0100
@@ -89,11 +89,14 @@
      Please also take a look at the #mandatoryPreRequisites method"
 
     ^ #(
+        #'stx:goodies/sunit'    "TestAsserter - superclass of GDBSimulatorResource"
         #'stx:libbasic2'    "CacheDictionary - referenced by GDBInstructionsAndSourceLine class>>initialize"
         #'stx:libtool'    "Tools::Inspector2Tab - referenced by GDBBreakpoint>>inspector2TabCondition"
         #'stx:libview2'    "ApplicationModel - referenced by GDBEventSubscription class>>blockFor:withSelector:"
         #'stx:libwidg'    "EditTextView - referenced by GDBBreakpoint>>inspector2TabCondition"
     )
+
+    "Modified: / 20-08-2018 / 07:54:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 subProjects
@@ -125,6 +128,7 @@
         GDBEventSet
         GDBEventSubscription
         GDBFeatures
+        GDBInstructionDissection
         GDBInternalPipeStream
         GDBMAByteArrayDescription
         GDBMAContainer
@@ -141,9 +145,8 @@
         GDBThreadState
         GDBTransientDataHolder
         #'jv_libgdbs'
-        #'GDBArch_i386'
         #'GDBArch_unknown'
-        #'GDBArch_x86_64'
+        #'GDBArch_x86'
         GDBAsyncEvent
         GDBCLICommand
         GDBCommandEvent
--- a/libInit.cc	Thu Aug 16 10:06:02 2018 +0100
+++ b/libInit.cc	Thu Aug 16 10:44:59 2018 +0100
@@ -25,6 +25,7 @@
 extern void _GDBEventSet_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBEventSubscription_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBFeatures_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
+extern void _GDBInstructionDissection_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBInternalPipeStream_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBMAByteArrayDescription_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBMAContainer_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
@@ -41,9 +42,8 @@
 extern void _GDBThreadState_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBTransientDataHolder_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _jv_137libgdbs_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
-extern void _GDBArch_137i386_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBArch_137unknown_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
-extern void _GDBArch_137x86_13764_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
+extern void _GDBArch_137x86_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBAsyncEvent_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBCLICommand_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
 extern void _GDBCommandEvent_Init(int pass, struct __vmData__ *__pRT__, OBJ snd);
@@ -241,6 +241,7 @@
     _GDBEventSet_Init(pass,__pRT__,snd);
     _GDBEventSubscription_Init(pass,__pRT__,snd);
     _GDBFeatures_Init(pass,__pRT__,snd);
+    _GDBInstructionDissection_Init(pass,__pRT__,snd);
     _GDBInternalPipeStream_Init(pass,__pRT__,snd);
     _GDBMAByteArrayDescription_Init(pass,__pRT__,snd);
     _GDBMAContainer_Init(pass,__pRT__,snd);
@@ -257,9 +258,8 @@
     _GDBThreadState_Init(pass,__pRT__,snd);
     _GDBTransientDataHolder_Init(pass,__pRT__,snd);
     _jv_137libgdbs_Init(pass,__pRT__,snd);
-    _GDBArch_137i386_Init(pass,__pRT__,snd);
     _GDBArch_137unknown_Init(pass,__pRT__,snd);
-    _GDBArch_137x86_13764_Init(pass,__pRT__,snd);
+    _GDBArch_137x86_Init(pass,__pRT__,snd);
     _GDBAsyncEvent_Init(pass,__pRT__,snd);
     _GDBCLICommand_Init(pass,__pRT__,snd);
     _GDBCommandEvent_Init(pass,__pRT__,snd);