Hi,

The debugger can display the debug informations while debugging
a method or a block.

Cheers,
Gwen

>From 95e01a11a8eaddf90b57e1494711eb7b8d7fef99 Mon Sep 17 00:00:00 2001
From: Gwenael Casaccio <mrg...@gmail.com>
Date: Fri, 13 Sep 2013 15:14:51 +0200
Subject: [PATCH] GtkDebugger support debug informations

---
 packages/visualgst/ChangeLog                       |  6 ++++++
 packages/visualgst/Debugger/Extensions.st          | 22 ++++++++++++++++++++++
 .../visualgst/Debugger/GtkStackInspectorView.st    | 21 ++++++++++-----------
 packages/visualgst/Extensions.st                   | 19 -------------------
 4 files changed, 38 insertions(+), 30 deletions(-)

diff --git a/packages/visualgst/ChangeLog b/packages/visualgst/ChangeLog
index bd9b727..30d9e35 100644
--- a/packages/visualgst/ChangeLog
+++ b/packages/visualgst/ChangeLog
@@ -1,5 +1,11 @@
 2013-08-20  Gwenael Casaccio  <gwenael.casac...@gmail.com>
 
+	* Extensions.st: Move some extensions to Debugger/Extensions.
+	* Debugger/Extensions.st: Moved extensions.
+	* Debugger/GtkStackInspectorView.st: Support debug information.
+
+2013-08-20  Gwenael Casaccio  <gwenael.casac...@gmail.com>
+
 	* Inspector/Extensions.st: Add ContextPart view support.
 	* Inspector/GtkContextInspectorView.st: Dedicated view for ContextPart.
 
diff --git a/packages/visualgst/Debugger/Extensions.st b/packages/visualgst/Debugger/Extensions.st
index 50eaa39..5d011b6 100644
--- a/packages/visualgst/Debugger/Extensions.st
+++ b/packages/visualgst/Debugger/Extensions.st
@@ -41,3 +41,25 @@ Behavior extend [
         ^ VisualGST.GtkDebugger
     ]
 ]
+
+ContextPart extend [
+
+    variables [
+        <category: '*VisualGST-debugger'>
+
+        ^ self method arguments, self method temporaries
+    ]
+
+    variablesDo: aBlock [
+        <category: '*VisualGST-debugger'>
+
+        ^ self variables do: aBlock
+    ]
+
+    stackInspectorView [
+        <category: '*VisualGST-debugger'>
+
+        ^ VisualGST.GtkStackInspectorView
+    ]
+]
+
diff --git a/packages/visualgst/Debugger/GtkStackInspectorView.st b/packages/visualgst/Debugger/GtkStackInspectorView.st
index 1f8c05a..19355ab 100644
--- a/packages/visualgst/Debugger/GtkStackInspectorView.st
+++ b/packages/visualgst/Debugger/GtkStackInspectorView.st
@@ -34,7 +34,7 @@
 ======================================================================"
 
 GtkConcreteWidget subclass: GtkStackInspectorView [
-    | object variables |
+    | object args temps |
 
     GtkStackInspectorView class >> openOn: aContext [
 	<category: 'instance creation'>
@@ -59,22 +59,21 @@ GtkConcreteWidget subclass: GtkStackInspectorView [
     do: aBlock [
 	<category: 'iterating'>
 
-	| i |
-        variables := Dictionary new.
-        i := 1.
 	aBlock value: 'thisContext'.
-        self object variablesDo: [ :each |
-                variables at: each displayString put: i.
-		aBlock value: each displayString.
-                i := i + 1 ].
+        args := IdentitySet new.
+        self object method arguments do: [ :each |
+		aBlock value: (args add: each asString) ].
+        temps := IdentitySet new.
+        self object method temporaries do: [ :each |
+		aBlock value: (temps add: each asString) ].
     ]
 
     selectedValue: aString [
 	<category: 'item selection'>
 
-        ^ aString = 'thisContext'
-            ifTrue: [ self object ]
-            ifFalse: [ self object at: (variables at: aString) ]
+        aString = 'thisContext' ifTrue: [ ^ self object ].
+        (args includes: aString) ifTrue: [ ^ (self object at: (self object method arguments indexOf: aString asSymbol)) displayString ].
+        ^ (self object at: self object numArgs + (self object method temporaries indexOf: aString asSymbol)) displayString
     ]
 
     canDive [
diff --git a/packages/visualgst/Extensions.st b/packages/visualgst/Extensions.st
index 40b6013..0661d7d 100644
--- a/packages/visualgst/Extensions.st
+++ b/packages/visualgst/Extensions.st
@@ -286,25 +286,6 @@ ContextPart extend [
 	    ifTrue: [ ctxt ]
 	    ifFalse: [ self error: 'Error indice too high' ]
     ]
-
-    variables [
-	<category: '*VisualGST'>
-
-	^ 1 to: self numArgs + self numTemps collect: [ :each |
-	    each displayString ]
-    ]
-
-    variablesDo: aBlock [
-	<category: '*VisualGST'>
-
-	^ self variables do: aBlock
-    ]
-
-    stackInspectorView [
-        <category: '*VisualGST'>
-
-        ^ GtkStackInspectorView
-    ]
 ]
 
 VariableBinding extend [
-- 
1.8.1.2

_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to