[BUG] block decompilation during code simulation by Through debugger button

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[BUG] block decompilation during code simulation by Through debugger button

Denis Kudriashov
Block decompilation not work at situation during code simulation. Maybe its just problem in debugger "Through button" action implementation.
This happen because block home in that situation not exists.

I attach class ClassWithBlockDecompilation which help reproduce that manually. See class side method #debug

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

ClassWithBlockDecompilation.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] block decompilation during code simulation by Through debugger button

Stéphane Ducasse
thanks

we should open a bug item

Stef

On May 23, 2010, at 12:06 AM, Denis Kudriashov wrote:

> Block decompilation not work at situation during code simulation. Maybe its just problem in debugger "Through button" action implementation.
> This happen because block home in that situation not exists.
>
> I attach class ClassWithBlockDecompilation which help reproduce that manually. See class side method #debug
> <ClassWithBlockDecompilation.st>_______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] block decompilation during code simulation by Through debugger button

Eliot Miranda-2
In reply to this post by Denis Kudriashov
Hi Denis,  (Hi Michaels, this may be related yo your issue)...


Denis, this is nothing to do with blocks having homes.  It's somewhere in the simulation of RemoteString>>text (used in CompiledMethod>>getSourceFromFile), specifically when UTF8TestDecoders egt involved.  Try the following and you'll see the -261 doesNotUnderstand: which is the symptom of the broken simulation.  Don't know exactly where simulation breaks down (but I suspect primitive invocation).  Anyway this may get you started digging deeper.

| m |
m := ClassWithBlockDecompilation >> #methodWithDecompilation.
ContextPart trace: [  m getSourceFromFile ] "fails"

| m |
m := ClassWithBlockDecompilation >> #methodWithDecompilation.
m getSourceFromFile "succeeds"


To dig deeper you may want to open up ContextPart class>>trace:on: in a workspace and put in some break-points, e.g. the following halts at the first doesNotUnderstand:.  Work your way back from there to find out where the -261 is coming form (I'm using Squeak 4.1, YMMV).

| aStream m aBlock prev |
(aStream := Transcript) clear.
m := ClassWithBlockDecompilation >> #methodWithDecompilation.
aBlock := [m getSourceFromFile].
prev := aBlock.
^thisContext sender
runSimulated: aBlock
contextAtEachStep:
[:current |
current selector = #doesNotUnderstand: ifTrue: [self halt].
Sensor anyButtonPressed ifTrue: [^ nil].
current == prev
ifFalse:
[prev sender ifNil:
[aStream space; nextPut: $^.
ContextPart carefullyPrint: current top on: aStream].
aStream cr.
(current depthBelow: aBlock) timesRepeat: [aStream space].
ContextPart carefullyPrint: current receiver on: aStream.
aStream space; nextPutAll: current selector; flush.
prev := current]


HTH
Eliot

2010/5/22 Denis Kudriashov <[hidden email]>
Block decompilation not work at situation during code simulation. Maybe its just problem in debugger "Through button" action implementation.
This happen because block home in that situation not exists.

I attach class ClassWithBlockDecompilation which help reproduce that manually. See class side method #debug

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project