Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bytes panel is broken on compiled methods #670

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/NewTools-Inspector-Extensions/CompiledCode.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ CompiledCode >> inpectionIr [
^ self ir inpectionIr
]

{ #category : '*NewTools-Inspector-Extensions' }
CompiledCode >> inspectBytes: specBuilder [
<inspectorPresentationOrder: 30 title: 'Bytes'>

^ self size > 1000
ifTrue: [
(StSimpleInspectorBuilder on: specBuilder)
key: 'error' value: 'too many bytes, size is ' , self size asString;
table ]
ifFalse: [
(StSimpleInspectorBuilder on: specBuilder)
key: 'hex string bytecode' value: (String streamContents: [ :out |
self bytecodes do: [ :each | each printOn: out base: 16 nDigits: 2 ] ]);
key: 'hex lines bytecode' value: (String streamContents: [ :out |
self bytecodes withIndexDo: [ :each :index |
index = 1 ifFalse: [
index - 1 \\ 8 = 0 ifTrue: [ out cr ] ifFalse: [ out space ] ].
each printOn: out base: 16 nDigits: 2 ] ]);
table ]
]

{ #category : '*NewTools-Inspector-Extensions' }
CompiledCode >> inspectionAST [
<inspectorPresentationOrder: 35 title: 'AST'>
Expand Down
Loading