DISection.st
branchjv
changeset 4384 aee25576d864
parent 4383 b93f1405b8c7
equal deleted inserted replaced
4383:b93f1405b8c7 4384:aee25576d864
    38 "
    38 "
    39 ! !
    39 ! !
    40 
    40 
    41 !DISection class methodsFor:'reading'!
    41 !DISection class methodsFor:'reading'!
    42 
    42 
    43 decode: aStream
    43 decode: aStreamOrByteArray
    44     | pos size type |
    44     | stream pos size type |
    45 
    45 
    46     pos := aStream position.
    46     stream := aStreamOrByteArray readStream.
    47     size := aStream nextUnsignedInt16MSB: UninterpretedBytes isBigEndian. 
    47     pos := stream position.
    48     type := aStream nextByte.
    48     size := stream nextUnsignedInt16MSB: UninterpretedBytes isBigEndian. 
    49     aStream position: pos.
    49     type := stream nextByte.
       
    50     stream position: pos.
    50     type == DbgInfoSectionVariableTable ifTrue:[ 
    51     type == DbgInfoSectionVariableTable ifTrue:[ 
    51         ^ DIVariableTable new decode: aStream
    52         ^ DIVariableTable new decode: stream
    52     ] ifFalse:[ 
    53     ] ifFalse:[ 
    53         ^ DISection new decode: aStream
    54         ^ DISection new decode: stream
    54     ].
    55     ].
    55 
    56 
    56     "Created: / 10-07-2018 / 12:46:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    57     "Created: / 10-07-2018 / 12:46:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    58     "Modified: / 15-07-2018 / 12:27:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    59 ! !
       
    60 
       
    61 !DISection methodsFor:'accessing'!
       
    62 
       
    63 type
       
    64     ^ type
    57 ! !
    65 ! !
    58 
    66 
    59 !DISection methodsFor:'reading & writing'!
    67 !DISection methodsFor:'reading & writing'!
    60 
    68 
    61 decode: aStream
    69 decode: aStream
    65 
    73 
    66     "Created: / 10-07-2018 / 12:49:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    74     "Created: / 10-07-2018 / 12:49:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    67     "Modified: / 10-07-2018 / 14:49:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    75     "Modified: / 10-07-2018 / 14:49:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    68 ! !
    76 ! !
    69 
    77 
       
    78 !DISection methodsFor:'testing'!
       
    79 
       
    80 isVariableTableSection
       
    81     ^ false
       
    82 
       
    83     "Created: / 15-07-2018 / 11:27:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    84 ! !
       
    85