Skip to content

Commit

Permalink
Updated VM Machine Code Debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
QDucasse committed Jul 22, 2021
1 parent 6c98da9 commit 50d98a8
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions smalltalksrc/VMMaker-Tools/VMMachineCodeDebugger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ Class {
{ #category : #specs }
VMMachineCodeDebugger class >> defaultSpec [

^ SpPanedLayout newHorizontal
add: #instructions;
add: (SpPanedLayout newHorizontal
^ SpBoxLayout newVertical
add:(SpBoxLayout newHorizontal
add: #instructions expand: true fill: true padding: 5;
add: #machineState expand: true fill: true padding: 5;
add: #stack expand: true fill: true padding: 5;
yourself) expand: true fill: true padding: 5;
add: (SpBoxLayout newHorizontal
add: (SpBoxLayout newVertical
add: #machineState;
add: (SpBoxLayout newHorizontal
add: #ipInput;
add: #jumpToButton);
add: #stepButton;
add: #disassembleAtPCButton;
yourself);
add: #stack;
yourself)
add: #ipInput;
add: #jumpToButton) expand: true fill: true padding: 5;
add: #stepButton expand: true fill: true padding: 5;
add: #disassembleAtPCButton expand: true fill: true padding: 5) width: 200;
yourself
]

Expand Down Expand Up @@ -99,12 +98,12 @@ VMMachineCodeDebugger >> connectPresenters [
instructionsContextMenu addItem: [ :item |
item
name: 'Set Intruction Pointer Here';
action: [ self setInstructionPointerToSelectedInstruction ] ].
action: [ self setInstructionPointerToSelectedInstruction. self refreshAll ] ].

instructionsContextMenu addItem: [ :item |
item
name: 'Run to Here';
action: [ self runToSelectedInstruction ] ].
action: [ self runToSelectedInstruction. self refreshAll ] ].

instructionsContextMenu addItem: [ :item |
item
Expand Down Expand Up @@ -153,7 +152,7 @@ VMMachineCodeDebugger >> initialDisassembly [
{ #category : #showing }
VMMachineCodeDebugger >> initialExtent [

^ 1000@1000
^ 1000@600
]

{ #category : #showing }
Expand Down Expand Up @@ -249,11 +248,16 @@ VMMachineCodeDebugger >> machineSimulator: anObject [
{ #category : #showing }
VMMachineCodeDebugger >> openWithSpec [

self refreshRegisters.
self refreshAll.
super openWithSpec.
]

{ #category : #showing }
VMMachineCodeDebugger >> refreshAll [

self refreshInstructions.
self refreshStack.

super openWithSpec.
self refreshRegisters.
]

{ #category : #showing }
Expand Down Expand Up @@ -305,6 +309,11 @@ VMMachineCodeDebugger >> setInstructionPointerToSelectedInstruction [
VMMachineCodeDebugger >> step [

machineSimulator step.
self refreshStack.
self refreshRegisters
self refreshAll
]

{ #category : #showing }
VMMachineCodeDebugger >> title [

^ 'VM Debugger'
]

0 comments on commit 50d98a8

Please sign in to comment.