DISection.st
branchjv
changeset 4384 aee25576d864
parent 4383 b93f1405b8c7
--- a/DISection.st	Tue Jul 10 15:59:31 2018 +0100
+++ b/DISection.st	Sun Jul 15 18:18:34 2018 +0200
@@ -40,20 +40,28 @@
 
 !DISection class methodsFor:'reading'!
 
-decode: aStream
-    | pos size type |
+decode: aStreamOrByteArray
+    | stream pos size type |
 
-    pos := aStream position.
-    size := aStream nextUnsignedInt16MSB: UninterpretedBytes isBigEndian. 
-    type := aStream nextByte.
-    aStream position: pos.
+    stream := aStreamOrByteArray readStream.
+    pos := stream position.
+    size := stream nextUnsignedInt16MSB: UninterpretedBytes isBigEndian. 
+    type := stream nextByte.
+    stream position: pos.
     type == DbgInfoSectionVariableTable ifTrue:[ 
-        ^ DIVariableTable new decode: aStream
+        ^ DIVariableTable new decode: stream
     ] ifFalse:[ 
-        ^ DISection new decode: aStream
+        ^ DISection new decode: stream
     ].
 
     "Created: / 10-07-2018 / 12:46:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 15-07-2018 / 12:27:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!DISection methodsFor:'accessing'!
+
+type
+    ^ type
 ! !
 
 !DISection methodsFor:'reading & writing'!
@@ -67,3 +75,11 @@
     "Modified: / 10-07-2018 / 14:49:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!DISection methodsFor:'testing'!
+
+isVariableTableSection
+    ^ false
+
+    "Created: / 15-07-2018 / 11:27:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+