>From 491644fb8c870143daf099e159cd89514d04f663 Mon Sep 17 00:00:00 2001 From: Gwenael Casaccio Date: Wed, 21 Aug 2013 14:53:47 +0200 Subject: [PATCH] Add new command for printing context state. --- packages/debug/debugger/ChangeLog | 4 ++++ packages/debug/debugger/MiniDebugger.st | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/debug/debugger/ChangeLog b/packages/debug/debugger/ChangeLog index e8859be..9fa2cb5 100644 --- a/packages/debug/debugger/ChangeLog +++ b/packages/debug/debugger/ChangeLog @@ -1,5 +1,9 @@ 2013-08-20 Gwenael Casaccio + * MiniDebugger.st: Add new command for printing context state. + +2013-08-20 Gwenael Casaccio + * Extensions.st: Import and split it from examples/MiniDebugger.st * MiniDebugger.st: Import and split it from examples/MiniDebugger.st * MiniInspector.st: Import and split it from examples/MiniDebugger.st diff --git a/packages/debug/debugger/MiniDebugger.st b/packages/debug/debugger/MiniDebugger.st index 00cc6d3..078e746 100644 --- a/packages/debug/debugger/MiniDebugger.st +++ b/packages/debug/debugger/MiniDebugger.st @@ -213,7 +213,7 @@ graphical debugger). The interface is vaguely similar to GDB.'> ]. activeContext isNil ifFalse: [ - activeContext == context ifFalse: [ activeContext printNl; printContextState ]. + activeContext == context ifFalse: [ activeContext printNl ]. self printCurrentLine ]. ^true @@ -267,7 +267,7 @@ graphical debugger). The interface is vaguely similar to GDB.'> self doStepCommand ifTrue: [ ^true ]. self doProcessCommand ifTrue: [ ^true ]. - ('PriIelwgxX' includes: command) ifFalse: [ ^false ]. + ('PriIJelwgxX' includes: command) ifFalse: [ ^false ]. (command == $h) ifTrue: [ ^true ]. @@ -278,6 +278,7 @@ graphical debugger). The interface is vaguely similar to GDB.'> (command == $r) ifTrue: [ activeContext receiver printNl ]. (command == $i) ifTrue: [ MiniInspector openOn: activeContext receiver ]. (command == $I) ifTrue: [ MiniInspector openOn: activeContext ]. + (command == $J) ifTrue: [ self printContextState ]. (command == $e) ifTrue: [ self interpreterLoopWith: activeContext receiver ]. (command == $l) ifTrue: [ self printCurrentMethod ]. (command == $w) ifTrue: [ activeContext printNl. self printCurrentLine ]. @@ -318,6 +319,7 @@ Examining state: r print receiver on stdout i inspect (enter MiniInspector on current receiver) I inspect context (enter MiniInspector on current context) + J print context state on stdout e eval (enter read-eval-print loop on current receiver) Examining the call stack: @@ -332,6 +334,13 @@ Other commands: x exit Smalltalk' ] + printContextState [ + + + activeContext ifNil: [ ^ self ]. + activeContext printContextState + ] + currentMethodSource [ -- 1.8.1.2