|Anonymous | Login||01-18-2022 09:48 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0005957||[Squeak Packages] Seaside||major||always||02-07-07 21:52||10-09-07 17:39|
|Summary||0005957: When debugging a Seaside request/response, evaluating (self session) results in nil|
There currently is no way to access the (self session) object when debugging Seaside, since that object is only in the debugee's stack (and not in the debuggers's stack in which evaluation is done).
People used to compile a (self session) into the halted method during debugging, only for getting access to that object.
This bug is marked *major* because the general problem of evaluating in the wrong stack is not addressed by debugger.
Attached patch shows Seaside's (self session) object in the context pane of debugger, if the object present in the debugee's stack.
Tested with the 3.7/8/9 stock images and the Squeak-web-72 (Seaside) image.
DebugSessionVariable-kwl.2.cs [^] (3,331 bytes) 02-07-07 21:52
context-aware-evaluator.1.cs [^] (1,931 bytes) 02-08-07 23:34
DoItWithContextVariable-kwl.1.cs [^] (2,948 bytes) 02-09-07 20:18
WADynamicVariable-kwl.1.cs [^] (993 bytes) 02-09-07 20:41
(0009554 - 227 - 227 - 227 - 227 - 227 - 227)
|Context-aware-evaluator.1.cs is a first step towards a debugger evaluating do-its in the right context. It fixes the stated problem, but might be a cause of other problems if in the code some exceptions are raised. Please test.|
(0009572 - 1313 - 1455 - 1455 - 1455 - 1455 - 1455)
what's the magic with bottonContext (which has sender nil), what do you want me to test (if possible nothing related to Seaside, so we can derive an "image neutral" test)?
What remains to be checked (at least) are all the *return* messages which deal with ContextPart and subclasses (perhaps in form of tests).
BTW nice trick (and a strong invariant): the aContext argument can be nil and so "bottomContext swapSender: aContext" cannot do anything wrong. This implies that "stack-lookup for dynamic variables" works only when invoked from the right (context) pane in the debugger, confirmed that in the Squeak-web image.
NB: I thought about using #ifCurtailed: but your #ensure: seems to serve a similiar purpose (not that I pretend to fully understand the differences, they both rely on primitive 198). Now this very primitive (198 #primitiveMarkUnwindMethod in Interpreter) just forces the shadow Smalltalk code to be executed. But on stack-unwind (#isUnwindMarked: in the Interpreter), it marks its stack position as "don't pass me by". So, no exception signaled can unwind the stack past #doIt, #printIt?! This is perhaps an advantage (even in non-Seaside apps) and the ultimate solution!?
Please comment, better yet ask squeak-dev about their opinion on your change.
(0009575 - 644 - 686 - 686 - 686 - 686 - 686)
the problem is that if the evaluated code raises an exception that is handled in the original context (that's the trick to get the dynamic variable), then it might well happen that the whole stack gets unwound. Then the trouble is that the debugger is within a stack that is not active anymore and therefor runs into troubles. In context of Seaside the UI locks up and a new stack trace is displayed in the web browser.
In context of Seaside this could be easily solved by using a continuation in which the doIt is evaluated, but for a generic patch this looks problematic as Squeak doesn't have continuations.
(0009583 - 466 - 508 - 508 - 508 - 508 - 508)
DoItWithContextVariable-kwl.1.cs provides as a dynamic variable the context (argument name: aContext) in which the compiler evaluates an expression.
Usage: (DoItWithContextVariable raiseSignal), returns non-nil when evaluated in the right (context) pane of debugger.
Answer: the context argument passed to Compiler>>#evaluate:in:to:
This dynamic variable solution is supposed to be used by applications which use dynamic variables, like for example Seaside.
(0009584 - 196 - 214 - 214 - 214 - 214 - 214)
The methods in WADynamicVariable-kwl.1.cs search for a dynamic variable even if its context is isolated by debugger and Compiler>>#evaluate:in:to:
(0011269 - 229 - 229 - 229 - 229 - 229 - 229)
|This issue is highly platform specific. It would introduce a lot of non-portable (between different platforms and different platform versions) code. We suspend this issue to be included into a separate extension package later on.|
|02-07-07 21:52||kwl||New Issue|
|02-07-07 21:52||kwl||File Added: DebugSessionVariable-kwl.2.cs|
|02-08-07 23:33||renggli||Issue Monitored: renggli|
|02-08-07 23:34||renggli||File Added: context-aware-evaluator.1.cs|
|02-08-07 23:36||renggli||Note Added: 0009554|
|02-09-07 15:09||kwl||Note Added: 0009572|
|02-09-07 16:49||renggli||Note Added: 0009575|
|02-09-07 20:17||kwl||Note Added: 0009583|
|02-09-07 20:18||kwl||File Added: DoItWithContextVariable-kwl.1.cs|
|02-09-07 20:41||kwl||File Added: WADynamicVariable-kwl.1.cs|
|02-09-07 20:42||kwl||Note Added: 0009584|
|08-21-07 00:05||KenCausey||Project||Squeak => Squeak Packages|
|08-21-07 00:06||KenCausey||Assigned To||=> renggli|
|08-21-07 00:06||KenCausey||Status||new => assigned|
|08-21-07 00:06||KenCausey||Category||Kernel => Seaside|
|10-09-07 17:31||renggli||Status||assigned => closed|
|10-09-07 17:31||renggli||Note Added: 0011267|
|10-09-07 17:31||renggli||Resolution||open => won't fix|
|10-09-07 17:35||renggli||Status||closed => resolved|
|10-09-07 17:35||renggli||Resolution||won't fix => suspended|
|10-09-07 17:35||renggli||Note Added: 0011268|
|10-09-07 17:35||renggli||Note Deleted: 0011267|
|10-09-07 17:35||renggli||Note Deleted: 0011268|
|10-09-07 17:37||renggli||Status||resolved => feedback|
|10-09-07 17:37||renggli||Resolution||suspended => reopened|
|10-09-07 17:39||renggli||Status||feedback => closed|
|10-09-07 17:39||renggli||Note Added: 0011269|
|10-09-07 17:39||renggli||Resolution||reopened => suspended|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
87 total queries executed.|
45 unique queries executed.