GDBMemoryDump.st
changeset 126 fb73b0af430b
parent 97 b17c889076e4
child 259 651864c2aa29
equal deleted inserted replaced
125:3d43348d694e 126:fb73b0af430b
    72 
    72 
    73 !GDBMemoryDump class methodsFor:'accessing-magritte'!
    73 !GDBMemoryDump class methodsFor:'accessing-magritte'!
    74 
    74 
    75 description
    75 description
    76     ^ (super description)
    76     ^ (super description)
    77         define:#addr as:Integer;
    77         define:#addr as:String;
    78         define:#nr_bytes as:Integer;
    78         define:#nr_bytes as:Integer;
    79         define:#total_bytes as:Integer;
    79         define:#total_bytes as:Integer;
    80         define:#memory as: Array of: GDBMemoryDumpRow;
    80         define:#memory as: Array of: GDBMemoryDumpRow;
    81         yourself
    81         yourself
    82 
    82 
    83     "Created: / 25-01-2018 / 08:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    83     "Created: / 25-01-2018 / 08:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    84     "Modified: / 25-01-2018 / 23:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    84     "Modified: / 03-07-2018 / 17:06:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    85 ! !
    85 ! !
    86 
    86 
    87 !GDBMemoryDump methodsFor:'accessing'!
    87 !GDBMemoryDump methodsFor:'accessing'!
    88 
    88 
    89 addr
    89 addr
   100     | addrW colW |
   100     | addrW colW |
   101 
   101 
   102     addrW := addr size.
   102     addrW := addr size.
   103     colW := memory inject: 0 into:[:w1 :r | r data inject: w1 into: [ :w2 :val | w2 max: val size ] ].
   103     colW := memory inject: 0 into:[:w1 :r | r data inject: w1 into: [ :w2 :val | w2 max: val size ] ].
   104     memory do:[:row|
   104     memory do:[:row|
   105         aStream nextPutAll: row addr; nextPut: $;; space.
   105         aStream nextPutAll: '0x'.
       
   106         row addr printOn: aStream base: 16 size: 16 fill: $0.
       
   107         aStream nextPut: $;; space.
   106         row data do:[:each | 
   108         row data do:[:each | 
   107             aStream nextPutAll: each; next: colW - each size + 2 put: Character space.
   109             aStream nextPutAll: each; next: colW - each size + 2 put: Character space.
   108         ].
   110         ].
   109         row ascii notNil ifTrue:[ 
   111         row ascii notNil ifTrue:[ 
   110             aStream space; nextPutAll: row ascii.
   112             aStream space; nextPutAll: row ascii.
   111         ].
   113         ].
   112         aStream cr.
   114         aStream cr.
   113     ].
   115     ].
   114 
   116 
   115     "Created: / 25-01-2018 / 23:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   117     "Created: / 25-01-2018 / 23:07:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   118     "Modified: / 04-07-2018 / 14:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   116 ! !
   119 ! !
   117 
   120 
   118 !GDBMemoryDump methodsFor:'inspecting'!
   121 !GDBMemoryDump methodsFor:'inspecting'!
   119 
   122 
   120 inspector2TabCondition
   123 inspector2TabCondition