Skip to content

Commit

Permalink
#253 minimal tode debugger comes up with gemstone method source (not …
Browse files Browse the repository at this point in the history
…selected context) and context inspector ... not quite the right object ... but hey most of the dots are conntected so I just need to wire them up to the server correctly
  • Loading branch information
dalehenrich committed Apr 24, 2016
1 parent 8480026 commit fabd1db
Show file tree
Hide file tree
Showing 59 changed files with 328 additions and 19 deletions.
@@ -0,0 +1,3 @@
*Tode-Minimal-Client-Debugger
minimalTodeMethod
^ self custom: GLMMinimalTodeMethodPresentation new
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"minimalTodeMethod" : "dkh 4/24/2016 13:02" } }
@@ -0,0 +1,2 @@
{
"name" : "GLMCompositePresentation" }
Empty file.
@@ -0,0 +1,21 @@
examples
pharoMethodPresentationExample
"
self pharoMethodPresentationExample
"

| browser |
browser := GLMTabulator new.
browser
row: #r1;
row: #r2.
browser transmit
to: #r1;
andShow: [ :aComposite | aComposite pharoMethod display: [ :method | method sourceCode ] ].
browser transmit
to: #r2;
andShow: [ :aComposite |
aComposite pharoMethod
display: [ :method | method sourceCode ];
smalltalkClass: [ :method | method methodClass ] ].
browser openOn: CompiledMethod class >> #gtExampleSimple
@@ -0,0 +1,5 @@
accessing
highlightSmalltalkContext
^ highlightSmalltalkContext isNil
ifTrue: [nil]
ifFalse: [highlightSmalltalkContext glamourValue: self entity]
@@ -0,0 +1,4 @@
rendering
renderGlamorouslyOn: aRenderer
self registerAnnouncements.
^ aRenderer renderPharoMethodPresentation: self
@@ -0,0 +1,5 @@
accessing
smalltalkClass: aBlock
"aBlock takes as parameters the entity objects and
its evaluation is expected to produce a Smalltalk class"
highlightSmalltalkContext := aBlock.
@@ -0,0 +1,7 @@
{
"class" : {
"pharoMethodPresentationExample" : "dkh 4/24/2016 12:59" },
"instance" : {
"highlightSmalltalkContext" : "dkh 4/24/2016 12:59",
"renderGlamorouslyOn:" : "dkh 4/24/2016 12:59",
"smalltalkClass:" : "dkh 4/24/2016 12:59" } }
@@ -0,0 +1,14 @@
{
"category" : "Tode-Minimal-Client-Debugger",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"highlightSmalltalkContext" ],
"name" : "GLMMinimalTodeMethodPresentation",
"pools" : [
],
"super" : "GLMRubricSmalltalkCodePresentation",
"type" : "normal" }
Empty file.
@@ -0,0 +1,5 @@
private
methodBindingsStrategy

^ [ :currentBindings :aSymbol |
currentBindings associationAt: aSymbol ifAbsent: [nil] ]
@@ -0,0 +1,5 @@
rendering
modelFor: aPresentation

^ (super modelFor: aPresentation)
yourself
@@ -0,0 +1,11 @@
rendering
morph
|morph|
morph := RubScrolledTextMorph new
beForSmalltalkCode;
getSelectionSelector: #primarySelectionInterval;
model: textModel;
color: Smalltalk ui theme backgroundColor;
textFont: StandardFonts codeFont;
yourself.
^ morph
@@ -0,0 +1,7 @@
{
"class" : {
},
"instance" : {
"methodBindingsStrategy" : "dkh 4/24/2016 13:04",
"modelFor:" : "dkh 4/24/2016 13:04",
"morph" : "dkh 4/24/2016 13:04" } }
@@ -0,0 +1,14 @@
{
"category" : "Tode-Minimal-Client-Debugger",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "GLMMorphicMinimalTodeMethodRenderer",
"pools" : [
],
"super" : "GLMMorphicPharoCodeRenderer",
"type" : "normal" }
Empty file.
@@ -0,0 +1,3 @@
accessing
getText
^ self displayLogic phlowValue: self entity
@@ -0,0 +1,6 @@
phlow
installEntity
self textBrick model: self.
self textBrick classOrMetaClass: (self smalltalkClassLogic phlowValue: self entity).
self textBrick setTextWith: (self displayLogic phlowValue: self entity).
self textBrick selectionInterval: (self selectionInterval phlowValue: self entity)
@@ -0,0 +1,3 @@
accessing
interactionModel
^ self
@@ -0,0 +1,4 @@
phlow
smalltalkClass: anObject

self setProperty: #phlowSmalltalkClass toValue: anObject
@@ -0,0 +1,4 @@
accessing
smalltalkClassLogic

^ self valueOfProperty: #phlowSmalltalkClass ifAbsent: [ #yourself ]
@@ -0,0 +1,5 @@
accessing
textBrick: aBrick

super textBrick: aBrick.
self textBrick beForSmalltalkCode.
@@ -0,0 +1,10 @@
{
"class" : {
},
"instance" : {
"getText" : "dkh 4/24/2016 12:55",
"installEntity" : "dkh 4/24/2016 12:55",
"interactionModel" : "dkh 4/24/2016 12:55",
"smalltalkClass:" : "dkh 4/24/2016 12:55",
"smalltalkClassLogic" : "dkh 4/24/2016 12:55",
"textBrick:" : "dkh 4/24/2016 12:55" } }
@@ -0,0 +1,14 @@
{
"category" : "Tode-Minimal-Client-Debugger",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "GLMPhlowMinimalTodeMethodBrick",
"pools" : [
],
"super" : "GLMPhlowTextBrick",
"type" : "normal" }
Expand Up @@ -2,23 +2,30 @@ example
example
"self example"

| debugger debuggerSession |
(TDMinimalClient
loginWith: (GsDevKit_home sessionDescriptionNamed: SCIGemStoneServerConfigSpec defaultSessionName))
debugMode: true;
interactive: true;
registerService: [ :stonString :aClient |
| clientElement |
| windowId clientElement |
clientElement := aClient objectSerializer fromString: stonString.
clientElement topez: aClient.
clientElement editorWindowLocation == #debugger
ifTrue: [ self
ifTrue: [ windowId := 1.
debugger := self
openOn:
(TDMinimalDebuggerSession new
(debuggerSession := TDMinimalDebuggerSession new
stackClientElement: clientElement;
client: aClient;
yourself) ]
ifFalse: [ self halt ].
1 "windowId" ]
ifFalse: [ windowId := 11.
clientElement editorWindowLocation == #method
ifTrue: [ debuggerSession codeClientElement: clientElement ]
ifFalse: [ clientElement editorWindowLocation == #context
ifTrue: [ debuggerSession contextClientElement: clientElement ]
ifFalse: [ self halt ] ] ].
windowId ]
for: #editStonElement:;
registerService: [ :listElement :index :listSelections :aClient |
aClient session
Expand All @@ -30,5 +37,8 @@ example
false.
nil} "return result to caller" ]
for: #itemSelectedForClientListElement:index:listSelections:;
registerService:
[ :methodSourceElement :aClient | aClient session send: #value to: methodSourceElement getBlockOopType withArgs: #() "return result to caller" ]
for: #getSourceForClientSourceElement:;
evaluate: 'foo `3+4`';
yourself
@@ -0,0 +1,6 @@
accessing context
currentContext

^self selectedContext
ifNil: [ self interruptedContext ]
ifNotNil: [ self selectedContext ]
@@ -0,0 +1,6 @@
building presentations
inspectorIn: aComposite

^ aComposite dynamic
display: [:anObject |
self inspectorIn: GLMCompositePresentation new on: anObject ]
@@ -0,0 +1,6 @@
building presentations
inspectorIn: aComposite on: anObject

^ anObject gtConstructDebuggerInspectorIn: aComposite for: self


@@ -0,0 +1,3 @@
building actions
installCodeActionsFor: aPresentation

@@ -0,0 +1,7 @@
building presentations
methodCodeIn: composite forContext: aContext

(self methodCodeWidgetIn: composite forContext: aContext)
initialize: [ :code |
code selectionInterval: (self session selectedCodeRangeForContext: self currentContext) ];
with: [ :code | self installCodeActionsFor: code ]
@@ -0,0 +1,6 @@
building presentations
methodCodeWidgetIn: composite forContext: aContext

^ composite minimalTodeMethod
title: 'Source';
format: [ aContext sourceCode ]
@@ -1,6 +1,6 @@
scripting opening
openOn: anObject

^ (super openOn: anObject)
openOn: aTDMinimalDebuggerSession
aTDMinimalDebuggerSession debugger: self.
^ (super openOn: aTDMinimalDebuggerSession)
title: self session name;
yourself
@@ -0,0 +1,3 @@
accessing context
selectedContext
^ ((self browser paneNamed: #stack) port: #selection) value
@@ -0,0 +1,8 @@
updating
selectionChanged: aContext

aContext isNotNil ifTrue: [ self announce: (GTGenericStackDebuggerSelectionChanged forDebugger: self) ].

UIManager default defer: [
(self browser paneNamed: #stack) presentations updateToolbar ].

@@ -0,0 +1,4 @@
accessing
sourceCode: aString

^ ((self browser paneNamed: #code) port: #text) value: aString
@@ -1,12 +1,21 @@
{
"class" : {
"example" : "dkh 4/23/2016 18:15" },
"example" : "dkh 4/24/2016 13:10" },
"instance" : {
"actOnBrowserClosing:" : "dkh 4/23/2016 17:43",
"browser" : "dkh 4/23/2016 17:38",
"compose" : "dkh 4/23/2016 17:42",
"contextToSelectFrom:" : "dkh 4/23/2016 17:52",
"openOn:" : "dkh 4/23/2016 17:37",
"currentContext" : "dkh 4/24/2016 10:58",
"inspectorIn:" : "dkh 4/24/2016 13:30",
"inspectorIn:on:" : "dkh 4/24/2016 13:31",
"installCodeActionsFor:" : "dkh 4/24/2016 11:16",
"methodCodeIn:forContext:" : "dkh 4/24/2016 10:34",
"methodCodeWidgetIn:forContext:" : "dkh 4/24/2016 13:27",
"openOn:" : "dkh 4/24/2016 10:53",
"selectedContext" : "dkh 4/24/2016 11:15",
"selectionChanged:" : "dkh 4/24/2016 10:59",
"session" : "dkh 4/23/2016 17:36",
"session:" : "dkh 4/23/2016 17:36",
"sourceCode:" : "dkh 4/24/2016 10:55",
"stackFrameListIn:" : "dkh 4/23/2016 17:24" } }
Empty file.
@@ -0,0 +1,3 @@
accessing
frameIndex: anObject
frameIndex := anObject
@@ -0,0 +1,3 @@
accessing
frameIndex
^ frameIndex
@@ -0,0 +1,4 @@
printing
printOn: aStream
aStream
nextPutAll: (self session stackClientElement firstList key at: frameIndex) asString
@@ -0,0 +1,3 @@
accessing
session: anObject
session := anObject
@@ -0,0 +1,3 @@
accessing
session
^ session
@@ -0,0 +1,3 @@
context compat
sourceCode
^ self session codeClientElement source
@@ -0,0 +1,10 @@
{
"class" : {
},
"instance" : {
"frameIndex" : "dkh 4/24/2016 11:05",
"frameIndex:" : "dkh 4/24/2016 11:05",
"printOn:" : "dkh 4/24/2016 11:14",
"session" : "dkh 4/24/2016 11:04",
"session:" : "dkh 4/24/2016 11:04",
"sourceCode" : "dkh 4/24/2016 13:06" } }
@@ -0,0 +1,15 @@
{
"category" : "Tode-Minimal-Client-Debugger",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"session",
"frameIndex" ],
"name" : "TDMinimalDebuggerContext",
"pools" : [
],
"super" : "Object",
"type" : "normal" }

0 comments on commit fabd1db

Please sign in to comment.