From 447f9fd3a21d723f1b099ecf19f825594c3eca2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Morales=20Durand?= Date: Sun, 28 Jan 2024 20:05:23 +0100 Subject: [PATCH 1/2] Fix Bytes panel is broken on CompiledMethods --- .../CompiledCode.extension.st | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/NewTools-Inspector-Extensions/CompiledCode.extension.st b/src/NewTools-Inspector-Extensions/CompiledCode.extension.st index 4aa683ba1..8d54409f0 100644 --- a/src/NewTools-Inspector-Extensions/CompiledCode.extension.st +++ b/src/NewTools-Inspector-Extensions/CompiledCode.extension.st @@ -13,6 +13,27 @@ CompiledCode >> inpectionIr [ ^ self ir inpectionIr ] +{ #category : '*NewTools-Inspector-Extensions' } +CompiledCode >> inspectBytes: specBuilder [ + + + ^ 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 [ From 2643f5796ef4933b53f40a26029c2e4346728723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Morales=20Durand?= Date: Sun, 28 Jan 2024 20:06:53 +0100 Subject: [PATCH 2/2] Fix Bytes panel is broken on CompiledMethods --- src/NewTools-Inspector-Extensions/CompiledCode.extension.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NewTools-Inspector-Extensions/CompiledCode.extension.st b/src/NewTools-Inspector-Extensions/CompiledCode.extension.st index 8d54409f0..2b37bd78b 100644 --- a/src/NewTools-Inspector-Extensions/CompiledCode.extension.st +++ b/src/NewTools-Inspector-Extensions/CompiledCode.extension.st @@ -31,7 +31,7 @@ CompiledCode >> inspectBytes: specBuilder [ index = 1 ifFalse: [ index - 1 \\ 8 = 0 ifTrue: [ out cr ] ifFalse: [ out space ] ]. each printOn: out base: 16 nDigits: 2 ] ]); - table] + table ] ] { #category : '*NewTools-Inspector-Extensions' }