Hi all<br><br>"Through" button in Debugger does not work correct for expressions like:<br><br> [:a | a + 2] valueWithArguments: #(4 ).<br><br>this block is executed.<br><br>But expression:<br><br> [:a | a + 2] value: 4.
<br><br>works ok - block will start to debug.<br><br>I found reason in <br><br><span style="background-color: rgb(255, 255, 255);">ContextPart>>doPrimitive: primitiveIndex method: meth receiver: receiver args: argument
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> "Simulate a primitive method whose index is primitiveIndex. The</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> simulated receiver and arguments are given as arguments to this message."</span><br style="background-color: rgb(255, 255, 255);"><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> | value |</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> <primitive: 19> "Simulation guard"
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> "If successful, push result and return resuming context,</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> else ^ PrimitiveFailToken"</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> </span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> </span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> (primitiveIndex = 19) ifTrue:[</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> ToolSet </span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> debugContext: self</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> label:'Code simulation error'</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> contents: nil].
</span><br style="background-color: rgb(255, 255, 255);"><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> (primitiveIndex = 80 and: [receiver isKindOf: ContextPart])
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ifTrue: [^self push: ((BlockContext newForMethod: receiver home method)</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> home: receiver home</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> startpc: pc + 2
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> nargs: (arguments at: 1))].</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
(primitiveIndex = 81 and: [receiver isMemberOf: BlockContext])</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ifTrue: [^receiver pushArgs: arguments from: self].
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> primitiveIndex = 83 "afr 9/11/1998 19:50"</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> ifTrue: [^ self send: arguments first to: receiver</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> with: arguments allButFirst
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> super: false].</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
primitiveIndex = 84 "afr 9/11/1998 19:50"</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ifTrue: [^ self send: arguments first to: receiver
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> with: (arguments at: 2)</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
super: false].</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> primitiveIndex = 186 ifTrue: [ "closure value"</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> | m |</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> m _ receiver method.</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> arguments size = m numArgs ifFalse: [^ PrimitiveFailToken].</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
^ self activateMethod: m</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> withArgs: arguments</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> receiver: receiver</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> class: receiver class].
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> primitiveIndex = 187 ifTrue: [ "closure valueWithArguments:"</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> | m args |</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> m _ receiver method.</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> args _ arguments first.</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> args size = m numArgs ifFalse: [^ PrimitiveFailToken].
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ^ self activateMethod: m</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
withArgs: args</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> receiver: receiver</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> class: receiver class].</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> primitiveIndex = 188 ifTrue: [ "object withArgs:executeMethod:"
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> | m args |</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
args _ arguments first.</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> m _ arguments second.</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> args size = m numArgs ifFalse: [^ PrimitiveFailToken].</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
^ self activateMethod: m</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> withArgs: args</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> receiver: receiver</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> class: receiver class].
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> arguments size > 6 ifTrue: [^ PrimitiveFailToken].</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> primitiveIndex = 117 </span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ifTrue:[value _ self tryNamedPrimitiveIn: meth for: receiver withArgs: arguments]
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ifFalse:[value _ receiver tryPrimitive: primitiveIndex withArgs: arguments].</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> value == PrimitiveFailToken</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ifTrue: [^ PrimitiveFailToken]
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> ifFalse: [^ self push: value]</span><br><br>It checks primitive index for method under debug and choose how it must be performed.
<br>But index 82 (#valueWithArguments primitive) is absent.<br>I try correct method and add new line: <br> (primitiveIndex = 82 and: [receiver isMemberOf: BlockContext])<br>
ifTrue: [^receiver pushArgs: arguments first from: self].<br><br>And now debugging by though button works right for expression "[:a | a + 2] valueWithArguments: #(4 )".<br>But maybe it fix kills other part of system.
<br><br>I work in last Squeak.3.9.dev...image<br><br>