[strongtalk] r181 committed - Display activation temporaries in debugger

0 views
Skip to first unread message

codesite...@google.com

unread,
Nov 15, 2009, 8:57:08 PM11/15/09
to strongta...@googlegroups.com
Revision: 181
Author: StephenLRees
Date: Sun Nov 15 17:53:07 2009
Log: Display activation temporaries in debugger
http://code.google.com/p/strongtalk/source/detail?r=181

Modified:
/branches/gcc-linux/StrongtalkSource/ActivationOutliner.dlt
/branches/gcc-linux/StrongtalkSource/StackTraceInspector.dlt
/branches/gcc-linux/vm/deps/includeDB
/branches/gcc-linux/vm/interpreter/prettyPrinter.cpp
/branches/gcc-linux/vm/prims/vframe_prims.cpp

=======================================
--- /branches/gcc-linux/StrongtalkSource/ActivationOutliner.dlt Mon Sep 28
16:51:43 2009
+++ /branches/gcc-linux/StrongtalkSource/ActivationOutliner.dlt Sun Nov 15
17:53:07 2009
@@ -32,6 +32,19 @@
! (Delta mirrorFor: #ActivationOutliner) methodsFor: 'private' !


+activationVariableView: variable <Object> ^<Visual>
+
+ ^self
+ activationVariableView: (self safePrintString: variable)
+ value: variable!
+
+activationVariableView: label <Str> value: variable <Object> ^<Visual>
+
+ ^self
+ buildLabel: label
+ painter: self codePainter
+ action: [ (Inspector on: variable) launch ]!
+
buildActions ^ <Visual>

| row <Row[Visual]> |
@@ -46,15 +59,19 @@
row add: (Button
labeled: 'Step out'
action: [:b <Button> | debugger stepReturn: self activation]).
+ row add: Glue xStretchy.
^row!

buildBody ^<Visual>

- | col <Column[Visual]> |
+ | col <Column[Visual]> row <Row[Visual]> |

col := Column[Visual] new.
+ row := Row[Visual] new.
+ row add: self buildCodeView;
+ add: self buildTemporariesView.
col add: self buildActions;
- add: self buildCodeView.
+ add: row.
^col
!

@@ -75,19 +92,13 @@
row add: (StringGlyph for: '[' painter: self codePainter) asVisual.
args do: [ :arg <Object> |
row add: (StringGlyph for: ':' painter: self selectorPainter)
asVisual.
- row add: (self
- buildLabel: (self safePrintString: arg)
- painter: self codePainter
- action: [ (Inspector on: arg) launch ]) ].
+ row add: (self activationVariableView: arg)].
row add: (StringGlyph for: '] in ' painter: self codePainter)
asVisual.
row add: (StringGlyph for: selector painter: self selectorPainter)
asVisual ]
ifFalse: [ "Add receiver"
| receiver <Object> |
receiver := self activation receiver.
- row add: (self
- buildLabel: (self safePrintString: receiver)
- painter: self codePainter
- action: [ (Inspector on: receiver) launch ]).
+ row add: (self activationVariableView: receiver).
row add: (StringGlyph for: '>> ' painter: self codePainter)
asVisual.
"Add selector interspersed with arguments"
args size = 0
@@ -96,10 +107,7 @@
strm := selector readStream.
args do: [ :arg <Object> |
row add: (StringGlyph for: (strm upTo: $:), ':' painter:
self selectorPainter) asVisual.
- row add: (self
- buildLabel: (self safePrintString: arg)
- painter: self codePainter
- action: [ (Inspector on: arg) launch ]) ]
+ row add: (self activationVariableView: arg) ]
]
].
^row!
@@ -127,6 +135,16 @@

^(StringGlyph for: 'External activation' painter: self codePainter)
asVisual!

+buildTemporariesView ^ <Visual>
+
+ | column <Column[Visual]> |
+ column := Column[Visual] new.
+ self activation temporaries
+ do: [:temp| column add: (self activationVariableView: temp key
+ value: temp value)].
+ ^column
+!
+
currentByteCodeSeparatorCharacter ^ <Character>

^Character value: 16r1B
=======================================
--- /branches/gcc-linux/StrongtalkSource/StackTraceInspector.dlt Mon Sep 28
16:51:43 2009
+++ /branches/gcc-linux/StrongtalkSource/StackTraceInspector.dlt Sun Nov 15
17:53:07 2009
@@ -62,17 +62,25 @@

"Process get aborted by default when stack trace inspector is closed"
self remove.
- self requestCloseIfTopWindow.
+ self closeTopWindow

!

closeRequest: toClose <[]>

"Abort inspected process when window closes"
+ self remove.
self process isNil
ifFalse: [ self process terminate ].
super closeRequest: toClose!

+closeTopWindow
+
+ |topWindow|
+ topWindow := self visual topWindow.
+ topWindow isNil
+ ifFalse: [topWindow requestClose]!
+
continueProcess

|topWindow|
=======================================
--- /branches/gcc-linux/vm/deps/includeDB Sun Sep 13 14:52:44 2009
+++ /branches/gcc-linux/vm/deps/includeDB Sun Nov 15 17:53:07 2009
@@ -1524,6 +1524,7 @@
vframe_prims.cpp prettyPrinter.hpp
vframe_prims.cpp prim_impl.hpp
vframe_prims.cpp processOop.hpp
+vframe_prims.cpp tempDecoder.hpp
vframe_prims.cpp vframe.hpp
vframe_prims.cpp vframe_prims.hpp
vframe_prims.cpp vframeOop.hpp
=======================================
--- /branches/gcc-linux/vm/interpreter/prettyPrinter.cpp Sat Oct 10
17:23:44 2009
+++ /branches/gcc-linux/vm/interpreter/prettyPrinter.cpp Sun Nov 15
17:53:07 2009
@@ -302,7 +302,7 @@
void initParent() {
parentScope = _method->is_blockMethod()
? new scopeNode(_method->parent(), klass, -1, this)
- : parentScope = NULL;
+ : NULL;
}
deltaVFrame* fr() { return _fr; }
ScopeDesc* sd() const { return _sd; }
=======================================
--- /branches/gcc-linux/vm/prims/vframe_prims.cpp Tue Jun 9 23:05:09 2009
+++ /branches/gcc-linux/vm/prims/vframe_prims.cpp Sun Nov 15 17:53:07 2009
@@ -139,9 +139,50 @@

PRIM_DECL_1(vframeOopPrimitives::temporaries, oop receiver) {
PROLOGUE_1("temporaries", receiver);
- ASSERT_RECEIVER;
-
- return receiver;
+
+ assert(receiver->is_vframe(), "receiver must be vframe");
+
+ BlockScavenge bs;
+ ResourceMark rm;
+
+ vframe* vf = vframeOop(receiver)->get_vframe();
+
+ if (vf == NULL)
+ return markSymbol(vmSymbols::activation_is_invalid());
+
+ if (!vf->is_delta_frame())
+ return markSymbol(vmSymbols::external_activation());
+
+ deltaVFrame* df = (deltaVFrame*) vf;
+ GrowableArray<oop> *temps = new GrowableArray<oop>(10);
+ methodOop method = df->method();
+ int tempCount = method->number_of_stack_temporaries();
+
+ for (int offset = (method->activation_has_context() ? 1 : 0); offset <
tempCount; offset++) {
+ byteArrayOop name = find_stack_temp(method, df->bci(), offset);
+ if (name)
+
temps->append(oopFactory::new_association(oopFactory::new_symbol(name),
+ df->temp_at(offset),
+ false));
+ }
+
+ while(df) {
+ if (method->allocatesInterpretedContext()) {
+ int contextTempCount = method->number_of_context_temporaries();
+ for (int offset = 0; offset < contextTempCount; offset++) {
+ byteArrayOop name = find_heap_temp(method, df->bci(), offset);
+ if (name)
+
temps->append(oopFactory::new_association(oopFactory::new_symbol(name),
+
df->context_temp_at(offset),
+ false));
+ }
+ }
+ df = df->parent();
+ if (df)
+ method = df->method();
+ }
+
+ return oopFactory::new_objArray(temps);
}

PRIM_DECL_1(vframeOopPrimitives::arguments, oop receiver) {

Reply all
Reply to author
Forward
0 new messages