Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
December 2015
- 990 messages
Re: [Pharo-dev] Hook "WACurrentRequestContext" into debugger?
by Mariano Martinez Peck
OK, I started publishing here:
http://smalltalkhub.com/mc/marianopeck/MarianoPublic/main package
called SeasidePharoDebugging
I did not even have the time to try it..just committed.
I must leave now.
byw
On Fri, Dec 4, 2015 at 2:43 PM, Mariano Martinez Peck <marianopeck(a)gmail.com
> wrote:
> OK, I solved the Halt problem. I did it by adding:
>
> WADebugErrorHandler class >> exceptionSelector
> ^ super exceptionSelector, Halt
>
> And this override:
>
> WAErrorHandler >> handleException: anException
> (Error handles: anException)
> ifTrue: [ ^ self handleError: anException ].
> (Warning handles: anException)
> ifTrue: [ ^ self handleWarning: anException ].
> (Halt handles: anException)
> ifTrue: [ "Lets debug Halt as an error so that we can take advantage of
> the #openDebuggerOn: hook"
> ^ self handleError: anException ].
> ^ super handleException: anException
>
> Can you try that too?
>
> if it gets complicated to test, I can fire a first version of a package
> and publish it in Shub.
>
>
> On Fri, Dec 4, 2015 at 2:12 PM, Mariano Martinez Peck <
> marianopeck(a)gmail.com> wrote:
>
>>
>>
>> On Fri, Dec 4, 2015 at 1:29 PM, Mariano Martinez Peck <
>> marianopeck(a)gmail.com> wrote:
>>
>>> OK. But be aware it is very very little tested and probably still a
>>> hack, and it still need overrides. Hopefully you will help me to polish it
>>> until we get a "SeasidePharoDebugging" package with no override :)
>>>
>>> All what I mention here is tested in Pharo 4.0 with Seaside 3.1.4.1.
>>>
>>> These are the steps:
>>>
>>> 1) Create a
>>>
>>> ProcessLocalVariable subclass: #WACurrentRequestContextPLV
>>> instanceVariableNames: ''
>>> classVariableNames: ''
>>> category: 'SeasidePharoDebugging'
>>>
>>> 2) Override GRPharoPlatform >> openDebuggerOn (see highlighted lines)
>>> The idea is to simply store the WACurrentRequestContext into a processor
>>> local variable before we loose it.
>>>
>>> openDebuggerOn: anError
>>> | process currentRequest |
>>> process := Processor activeProcess.
>>> currentRequest := WACurrentRequestContext value.
>>>
>>> "If we are running in the UI process, we don't want to suspend the
>>> active process. The
>>> error was presumably triggered while stepping in the Debugger. If we
>>> simply immediately
>>> signal an UnhandledError, the debugger will catch this and display the
>>> signaling context.
>>> It isn't perfect or pretty but it works."
>>> (ProcessBrowser isUIProcess: process)
>>> ifTrue: [
>>> UnhandledError signalForException: anError ]
>>> ifFalse: [
>>> WorldState addDeferredUIMessage: [
>>> WACurrentRequestContextPLV value: currentRequest.
>>> process
>>> debug: anError signalerContext
>>> title: anError description
>>> full: true.
>>> ].
>>> process suspend ]
>>>
>>>
>>> 3) Override WACurrentRequestContext class >> defaultValue
>>>
>>> defaultValue
>>> ^ WACurrentRequestContextPLV value ifNil: [ WARequestContextNotFound
>>> signal ]
>>> 4) Set WADebugErrorHandler as the error handler in your seaside app (I
>>> am not sure if this step is needed).
>>>
>>> And that's all. Try to put a "self whateverMethodThatCausesDNU" and
>>> then, try to evalaute something from the debugger that calls #session or
>>> #requestContext etc... for example, evaluate "WAComponent new session" and
>>> that should work:
>>>
>>> Besides the overrides I still have doubts:
>>>
>>> a) do we need WADebugErrorHandler ?
>>>
>>
>> Yes, we do, because we are hooking in #openDebuggerOn: and that's only
>> called from WADebugErrorHandler.
>>
>>
>>> b) it seems "Halt halt" does not work but sending a message that causes
>>> dnu does work. Maybe related to WADebugErrorHandler.
>>>
>>
>> I guess problem is that while MessageNotUnderstood is indeed a subclass
>> of Error, Halt is not. Anyway, the real problem is that with halt, the
>> hooked method #openDebuggerOn: is not called... I tried to find out
>> which method handled Halt but I failed.
>>
>>
>> c) what happens if we have multiple debuggers opened? I am worried about
>>> the "soleInstance" of ProcessSpecificVariable.
>>>
>>>
>>> Thoughts? Can you tell me if this works for you?
>>>
>>>
>>>
>>>
>>> On Fri, Dec 4, 2015 at 1:13 PM, Max Leske <maxleske(a)gmail.com> wrote:
>>>
>>>>
>>>> On 04 Dec 2015, at 17:11, Mariano Martinez Peck <marianopeck(a)gmail.com>
>>>> wrote:
>>>>
>>>> I found a way!!!! Much cleaner and easier. Awesome!
>>>> I will clean it, test it a bit more and try to package it for public
>>>> usage :)
>>>>
>>>>
>>>> Give me a snippet! I want to play with it! :D
>>>>
>>>>
>>>> On Fri, Dec 4, 2015 at 12:31 PM, Mariano Martinez Peck <
>>>> marianopeck(a)gmail.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Fri, Dec 4, 2015 at 12:05 PM, Max Leske <maxleske(a)gmail.com> wrote:
>>>>>
>>>>>>
>>>>>> On 04 Dec 2015, at 14:29, Mariano Martinez Peck <
>>>>>> marianopeck(a)gmail.com> wrote:
>>>>>>
>>>>>> Max...Seaside uses WADynamicVariable (NOT DynamicVariable) which
>>>>>> are completely different. WADynamicVariable uses exception mechanism
>>>>>> while DynamicVariable uses the ProcessSpecificVariable.
>>>>>> But thanks anyway!
>>>>>>
>>>>>>
>>>>>> Oh manâ¦. Sorry :)
>>>>>>
>>>>>> I wonder, why WADynamicVariable *isnât* a DynamicVariable. The
>>>>>> semantics are the same if Iâm not mistaken (e.g. only available in the
>>>>>> current process) and I think access to a dynamic variable may even be
>>>>>> faster because it *doesnât* use the exception mechanism (i.e. no need to
>>>>>> walk down the stack).
>>>>>> If someone knows the answer, Iâd be happy to hear it.
>>>>>>
>>>>>>
>>>>> I bet it's because of portability. For example, i remember in GemStone
>>>>> the ProcessorLocalVariable did not behave the same as in Pharo. And it was
>>>>> actually an experiment. I think you cannot expect all this stuff to be ansi
>>>>> (or easily portable), while exceptions do.
>>>>>
>>>>>
>>>>>> Iâve played around with Process>>signalException: and
>>>>>> Context>>handleSignal: (which looked quite promising) but didnât get any
>>>>>> results. Iâm out of ideas.
>>>>>>
>>>>>>
>>>>> I have played all morning with an idea of using local variables. I
>>>>> arrive to the point where I DO HAVE the request context at hand, but I
>>>>> don't find an easy way to hook into do-its, print-it etc so that the
>>>>> closure evaluated gets the request context plugged. In other ways... let's
>>>>> say I have the context stored somewhere. I am at the SmalltalkEditor >>
>>>>> evaluateSelectionAndDo: aBlock
>>>>>
>>>>> and so..somewhere I need to do something like:
>>>>>
>>>>> WACurrentRequestContext use: self storedContextSomewhere during: [
>>>>> self theSelectionToBeEvaluated ]
>>>>>
>>>>> and that's where I am now :)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Cheers,
>>>>>> Max
>>>>>>
>>>>>>
>>>>>> On Fri, Dec 4, 2015 at 7:32 AM, Max Leske <maxleske(a)gmail.com> wrote:
>>>>>>
>>>>>>> Hereâs a snippet to play with:
>>>>>>>
>>>>>>> p := Processor activeProcess.
>>>>>>> x := 2.
>>>>>>> v := TestDynamicVariable value: x during: [
>>>>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>>>>> env copyWithout: nil ]) inspect
>>>>>>> ].
>>>>>>>
>>>>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>>>>> env copyWithout: nil ]) inspect
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Max
>>>>>>>
>>>>>>> On 04 Dec 2015, at 10:47, Max Leske <maxleske(a)gmail.com> wrote:
>>>>>>>
>>>>>>> I feel you :)
>>>>>>>
>>>>>>> Without having thought this through completely: if you look at the
>>>>>>> implementation of DynamicVariable>>value:during: youâll see that the way it
>>>>>>> works is that the variable is bound to the active process. In the debugger
>>>>>>> you have access to the process that is being debugged and thus you should
>>>>>>> have access to the variables bound to it. You could try accessing all such
>>>>>>> variables by iterating over them (which I think will require an extension
>>>>>>> on Process because youâd need to access at least the PSKeys class variable).
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Max
>>>>>>>
>>>>>>> On 04 Dec 2015, at 00:34, Mariano Martinez Peck <
>>>>>>> marianopeck(a)gmail.com> wrote:
>>>>>>>
>>>>>>> Hi guys,
>>>>>>>
>>>>>>> This thing I will ask in this email it's in my mind since YEARS. But
>>>>>>> I have always thought it was like that and that there was nothing we could
>>>>>>> do. However, I think it's time I ask again :)
>>>>>>>
>>>>>>> For those that have used Seaside, and you try to debug, you know
>>>>>>> that upon request processing seaside uses Exceptions mechanisim to always
>>>>>>> have access to the request, session, etc. They way that is done is very
>>>>>>> smart :)
>>>>>>>
>>>>>>> WACurrentRequestContext use: self during: aBlock
>>>>>>>
>>>>>>> In that case, "self" is the request instance and aBlock the closure
>>>>>>> that takes care of the request processing. So, inside that closure,
>>>>>>> everywhere you do "WACurrentRequestContext value" you get the correct
>>>>>>> request instance.
>>>>>>>
>>>>>>> So..that's great for Seaside, but debugging gets complicated. While
>>>>>>> you can restart, proceed, etc, once inside debugger, you cannot evaluate
>>>>>>> any piece of code that will use the session or request because you get
>>>>>>> a WARequestContextNotFound. Of course, because I guess the evaluation you
>>>>>>> do from cmd+d on a piece of text or via the debugger inspector, creates
>>>>>>> another closure/context which does not receive the WACurrentRequestContext
>>>>>>> instance.
>>>>>>>
>>>>>>> Now....besides WACurrentRequestContext I have my own class
>>>>>>> UserContextInformation where I basically have a bunch of stuff associated
>>>>>>> to the logged user. And I do exactly the same as the
>>>>>>> WACurrentRequestContext. And I have the same problem. I really want to be
>>>>>>> able to fix this.
>>>>>>>
>>>>>>> Anyone have an idea on how can I do it? I guess I can change the
>>>>>>> debugger, in the place where I evaluate code so that I wrap that evaluation
>>>>>>> with my request context instance???
>>>>>>>
>>>>>>> Thoughts?
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Mariano
>>>>>>> http://marianopeck.wordpress.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Mariano
>>>>>> http://marianopeck.wordpress.com
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Mariano
>>>>> http://marianopeck.wordpress.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Mariano
>>>> http://marianopeck.wordpress.com
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
--
Mariano
http://marianopeck.wordpress.com
Dec. 4, 2015
Re: [Pharo-dev] GTDebugger not draggable with latest VM
by Nicolai Hess
2015-12-04 17:42 GMT+01:00 Henrik Nergaard <henrin10(a)student.uia.no>:
> Case 17178 added an extra check to the handling of mouse movement to use
> the result from asking the event handler by default (if the morph has an
> event handler) in the same way as other âhandlesâ methods behaves. The
> default behaviour for Morph event handling is that if an event handler is
> present for a morphic object it is up to its class to specify which events
> that uses the event handling mechanism or not.
>
>
>
> GLMSystemWindow>>#initialize creates an event handler for itself, which
> then causes the #handlesMouseMove: to return false since it has an event
> handler, but it does not handle #mouseMove.
>
>
>
> One solution could be to remove GLMSystemWindow>>#initialize and implement
> #keyStroke: instead.
>
>
>
> >>keyStroke:
>
>
>
> super keyStroke.
>
> self handleKeyStroke: evt.
>
>
>
> Other possible solution could be to implement #handlesMouseMove: in
> GMLSystemWindow with the logic necessary.
>
>
>
> Another possibility is to only return early in Morph>>#handlesMouseMove:
> Iff the event handler has an event registration for #mouseMove.
>
>
>
> I would go with the first solution, and remove the need for an event
> handler object in GLMSystemWindow.
>
I would go with the third solution, return early only if handlesMouseMove
returns true.
(The handles mouse move seems somewhere special, maybe because all Morphs
supports to be dragged and move, and therefore some Morphs may not care
to install a mouse move eventhandler.)
>
>
>
>
> Best regards,
>
> Henrik
>
>
>
>
>
> *From:* Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] *On Behalf
> Of *Andrei Chis
> *Sent:* Friday, December 4, 2015 4:31 PM
> *To:* Pharo Development List <pharo-dev(a)lists.pharo.org>
> *Cc:* Moose-related development <moose-dev(a)list.inf.unibe.ch>
> *Subject:* Re: [Pharo-dev] GTDebugger not draggable with latest VM
>
>
>
> Seems to happen due to the fix in issue 17178
> <https://pharo.fogbugz.com/f/cases/17178>
>
>
>
> On Fri, Dec 4, 2015 at 4:21 PM, Andrei Chis <chisvasileandrei(a)gmail.com>
> wrote:
>
> Seems that starting with Pharo 50483 one cannot drag the
> inspector/playground/debugger.
>
>
>
> No idea what happened.
>
>
>
> On Fri, Dec 4, 2015 at 3:19 PM, Blondeau Vincent <
> vincent.blondeau(a)worldline.com> wrote:
>
> Hi,
>
>
>
> I have a problem on the latest Moose6.0 image.
>
> I was not able to open a Roassal view, I had a NativeBoost Generic
> failureâ¦
>
> So I updated the VM to last stable, and, now, the GTdebugger and the Moose
> panel are not draggable anymoreâ¦
>
> Can somebody is able to reproduce the problem?
>
>
>
> Thanks
>
>
>
> Cheers,
>
> Vincent
>
>
> ------------------------------
>
>
> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
> exclusif de ses destinataires. Il peut également être protégé par le secret
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
> pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra
> être recherchée quant au contenu de ce message. Bien que les meilleurs
> efforts soient faits pour maintenir cette transmission exempte de tout
> virus, l'expéditeur ne donne aucune garantie à cet égard et sa
> responsabilité ne saurait être recherchée pour tout dommage résultant d'un
> virus transmis.
>
> This e-mail and the documents attached are confidential and intended
> solely for the addressee; it may also be privileged. If you receive this
> e-mail in error, please notify the sender immediately and destroy it. As
> its integrity cannot be secured on the Internet, the Worldline liability
> cannot be triggered for the message content. Although the sender endeavours
> to maintain a computer virus-free network, the sender does not warrant that
> this transmission is virus-free and will not be liable for any damages
> resulting from any virus transmitted.
>
>
>
>
>
Dec. 4, 2015
Re: [Pharo-dev] Differences Compiler vs. OpalCompiler (or parser)
by Nicolai Hess
2015-12-04 20:29 GMT+01:00 Andrei Chis <chisvasileandrei(a)gmail.com>:
>
>
> On Sat, Nov 21, 2015 at 3:25 PM, Nicolai Hess <nicolaihess(a)gmail.com>
> wrote:
>
>>
>>
>> 2015-11-20 22:57 GMT+01:00 Eliot Miranda <eliot.miranda(a)gmail.com>:
>>
>>> Hi Nicolai,
>>>
>>> On Fri, Nov 20, 2015 at 1:37 PM, Nicolai Hess <nicolaihess(a)gmail.com>
>>> wrote:
>>>
>>>> GTDummyExamples class
>>>> d: anInteger
>>>> <gtExample>
>>>> <label: 'Dummy #d:, depends #c:'>
>>>> <description: 'should raise an exception as the argument is not
>>>> anInteger'>
>>>> <depends: #c:>
>>>> <raises: Literal constant expected -> MessageNotUnderstood>
>>>>
>>>> ^ 1 + anInteger
>>>>
>>>> The old Parser complains about the class name "MessageNotUnderstood"
>>>> used as a pragma
>>>> argument without being a string or symbol
>>>>
>>>> Opal does not complain
>>>>
>>>> Is Opals behavior intended ?
>>>>
>>>
>>> IMO no. The pragma design is that the only valid syntax is of a message
>>> pattern with only literal arguments except for the one piece of syntactic
>>> sugar where the error temporary name in a primitive call with an error can
>>> be given as an identifier, e.g.
>>>
>>> addressField
>>> <primitive: 'primAddressField' module: 'IA32ABI' error: errorCode>
>>> ^self primitiveFailed
>>>
>>> instead of
>>>
>>> addressField
>>> <primitive: 'primAddressField' module: 'IA32ABI' error: 'errorCode'>
>>> ^self primitiveFailed
>>>
>>>
>>> The issues are class reference, class redefinition, class removal etc.
>>> I guess we could extend the pragma syntax to allow class references but
>>> there's a lot of impact. I would prefer if we keep things restricted.
>>> There's nothing to stop one using a symbol and mapping it to a class name,
>>> e.g.
>>>
>>>
>>> GTDummyExamples class
>>> d: anInteger
>>> <gtExample>
>>> <label: 'Dummy #d:, depends #c:'>
>>> <description: 'should raise an exception as the argument is not
>>> anInteger'>
>>> <depends: #c:>
>>> <raises: #MessageNotUnderstood>
>>>
>>> ^ 1 + anInteger
>>>
>>
>> Thanks eliot
>>
>> Yes, we have this code too, I think, using the global var instead of a
>> symbol happened by accident.
>>
>> @andrei (and stefan?) can you check the GTDummyExamples methods
>> and replace classes with symbol names.
>>
>> After this is removed I will change the parser to notify about this.
>>
>
> I updated the pragmas to use symbols.
>
Thanks!
>
> Cheers,
> Andrei
>
>
>>
>>
>>
>>>
>>> Also, I *hate* this style of pragma. Why not
>>>
>>> GTDummyExamples class
>>> d: anInteger
>>> <gtExampleLabel: 'Dummy #d:, depends #c:'
>>> description: 'should raise an exception as the argument is not
>>> anInteger'
>>> depends: #c:
>>> raises: #MessageNotUnderstood>
>>>
>>> ^ 1 + anInteger
>>>
>>> ?
>>>
>>
>> no idea.
>>
>>
>>
>>>
>>> That's how the system is designed to be used. Then the message can be
>>> implemented by a builder which performs the selector from a visitor.
>>>
>>> From squeaks bugtracker : http://bugs.squeak.org/view.php?id=7770
>>>>
>>>> Cascading message sends to super.
>>>>
>>>> Compiler refuses to compile
>>>> super
>>>> initialize;
>>>> setListProperties
>>>>
>>>>
>>>> It looks like Opal would compile this to
>>>>
>>>> super initialize.
>>>> super setListProperties.
>>>>
>>>> Intended ? Do we want to keep it?
>>>>
>>>> NBNativeCodeGen
>>>> parseOptions: optionsArray
>>>> uses association symbol -> block instead of block -> block
>>>> for caseOf arguments.
>>>> The old parser does not accept this.
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> _,,,^..^,,,_
>>> best, Eliot
>>>
>>
>>
>
Dec. 4, 2015
Re: [Pharo-dev] Differences Compiler vs. OpalCompiler (or parser)
by Andrei Chis
On Sat, Nov 21, 2015 at 3:25 PM, Nicolai Hess <nicolaihess(a)gmail.com> wrote:
>
>
> 2015-11-20 22:57 GMT+01:00 Eliot Miranda <eliot.miranda(a)gmail.com>:
>
>> Hi Nicolai,
>>
>> On Fri, Nov 20, 2015 at 1:37 PM, Nicolai Hess <nicolaihess(a)gmail.com>
>> wrote:
>>
>>> GTDummyExamples class
>>> d: anInteger
>>> <gtExample>
>>> <label: 'Dummy #d:, depends #c:'>
>>> <description: 'should raise an exception as the argument is not
>>> anInteger'>
>>> <depends: #c:>
>>> <raises: Literal constant expected -> MessageNotUnderstood>
>>>
>>> ^ 1 + anInteger
>>>
>>> The old Parser complains about the class name "MessageNotUnderstood"
>>> used as a pragma
>>> argument without being a string or symbol
>>>
>>> Opal does not complain
>>>
>>> Is Opals behavior intended ?
>>>
>>
>> IMO no. The pragma design is that the only valid syntax is of a message
>> pattern with only literal arguments except for the one piece of syntactic
>> sugar where the error temporary name in a primitive call with an error can
>> be given as an identifier, e.g.
>>
>> addressField
>> <primitive: 'primAddressField' module: 'IA32ABI' error: errorCode>
>> ^self primitiveFailed
>>
>> instead of
>>
>> addressField
>> <primitive: 'primAddressField' module: 'IA32ABI' error: 'errorCode'>
>> ^self primitiveFailed
>>
>>
>> The issues are class reference, class redefinition, class removal etc. I
>> guess we could extend the pragma syntax to allow class references but
>> there's a lot of impact. I would prefer if we keep things restricted.
>> There's nothing to stop one using a symbol and mapping it to a class name,
>> e.g.
>>
>>
>> GTDummyExamples class
>> d: anInteger
>> <gtExample>
>> <label: 'Dummy #d:, depends #c:'>
>> <description: 'should raise an exception as the argument is not
>> anInteger'>
>> <depends: #c:>
>> <raises: #MessageNotUnderstood>
>>
>> ^ 1 + anInteger
>>
>
> Thanks eliot
>
> Yes, we have this code too, I think, using the global var instead of a
> symbol happened by accident.
>
> @andrei (and stefan?) can you check the GTDummyExamples methods
> and replace classes with symbol names.
>
> After this is removed I will change the parser to notify about this.
>
I updated the pragmas to use symbols.
Cheers,
Andrei
>
>
>
>>
>> Also, I *hate* this style of pragma. Why not
>>
>> GTDummyExamples class
>> d: anInteger
>> <gtExampleLabel: 'Dummy #d:, depends #c:'
>> description: 'should raise an exception as the argument is not
>> anInteger'
>> depends: #c:
>> raises: #MessageNotUnderstood>
>>
>> ^ 1 + anInteger
>>
>> ?
>>
>
> no idea.
>
>
>
>>
>> That's how the system is designed to be used. Then the message can be
>> implemented by a builder which performs the selector from a visitor.
>>
>> From squeaks bugtracker : http://bugs.squeak.org/view.php?id=7770
>>>
>>> Cascading message sends to super.
>>>
>>> Compiler refuses to compile
>>> super
>>> initialize;
>>> setListProperties
>>>
>>>
>>> It looks like Opal would compile this to
>>>
>>> super initialize.
>>> super setListProperties.
>>>
>>> Intended ? Do we want to keep it?
>>>
>>> NBNativeCodeGen
>>> parseOptions: optionsArray
>>> uses association symbol -> block instead of block -> block
>>> for caseOf arguments.
>>> The old parser does not accept this.
>>>
>>>
>>>
>>
>>
>> --
>> _,,,^..^,,,_
>> best, Eliot
>>
>
>
Dec. 4, 2015
Cannot upload file on Smalltalkhub
by Juraj Kubelka
Hi,
For some reasons I cannot upload mcz files on Smalltalkhub: 500 Internal Server Error text/plain;charset=utf-8 30B
Am I only one? I need to upload following files into Pharo/Rubric:
Thanks for any help,
Juraj
Dec. 4, 2015
Re: [Pharo-dev] Hook "WACurrentRequestContext" into debugger?
by Mariano Martinez Peck
OK, I solved the Halt problem. I did it by adding:
WADebugErrorHandler class >> exceptionSelector
^ super exceptionSelector, Halt
And this override:
WAErrorHandler >> handleException: anException
(Error handles: anException)
ifTrue: [ ^ self handleError: anException ].
(Warning handles: anException)
ifTrue: [ ^ self handleWarning: anException ].
(Halt handles: anException)
ifTrue: [ "Lets debug Halt as an error so that we can take advantage of the
#openDebuggerOn: hook"
^ self handleError: anException ].
^ super handleException: anException
Can you try that too?
if it gets complicated to test, I can fire a first version of a package and
publish it in Shub.
On Fri, Dec 4, 2015 at 2:12 PM, Mariano Martinez Peck <marianopeck(a)gmail.com
> wrote:
>
>
> On Fri, Dec 4, 2015 at 1:29 PM, Mariano Martinez Peck <
> marianopeck(a)gmail.com> wrote:
>
>> OK. But be aware it is very very little tested and probably still a hack,
>> and it still need overrides. Hopefully you will help me to polish it until
>> we get a "SeasidePharoDebugging" package with no override :)
>>
>> All what I mention here is tested in Pharo 4.0 with Seaside 3.1.4.1.
>>
>> These are the steps:
>>
>> 1) Create a
>>
>> ProcessLocalVariable subclass: #WACurrentRequestContextPLV
>> instanceVariableNames: ''
>> classVariableNames: ''
>> category: 'SeasidePharoDebugging'
>>
>> 2) Override GRPharoPlatform >> openDebuggerOn (see highlighted lines)
>> The idea is to simply store the WACurrentRequestContext into a processor
>> local variable before we loose it.
>>
>> openDebuggerOn: anError
>> | process currentRequest |
>> process := Processor activeProcess.
>> currentRequest := WACurrentRequestContext value.
>>
>> "If we are running in the UI process, we don't want to suspend the active
>> process. The
>> error was presumably triggered while stepping in the Debugger. If we
>> simply immediately
>> signal an UnhandledError, the debugger will catch this and display the
>> signaling context.
>> It isn't perfect or pretty but it works."
>> (ProcessBrowser isUIProcess: process)
>> ifTrue: [
>> UnhandledError signalForException: anError ]
>> ifFalse: [
>> WorldState addDeferredUIMessage: [
>> WACurrentRequestContextPLV value: currentRequest.
>> process
>> debug: anError signalerContext
>> title: anError description
>> full: true.
>> ].
>> process suspend ]
>>
>>
>> 3) Override WACurrentRequestContext class >> defaultValue
>>
>> defaultValue
>> ^ WACurrentRequestContextPLV value ifNil: [ WARequestContextNotFound
>> signal ]
>> 4) Set WADebugErrorHandler as the error handler in your seaside app (I am
>> not sure if this step is needed).
>>
>> And that's all. Try to put a "self whateverMethodThatCausesDNU" and then,
>> try to evalaute something from the debugger that calls #session or
>> #requestContext etc... for example, evaluate "WAComponent new session" and
>> that should work:
>>
>> Besides the overrides I still have doubts:
>>
>> a) do we need WADebugErrorHandler ?
>>
>
> Yes, we do, because we are hooking in #openDebuggerOn: and that's only
> called from WADebugErrorHandler.
>
>
>> b) it seems "Halt halt" does not work but sending a message that causes
>> dnu does work. Maybe related to WADebugErrorHandler.
>>
>
> I guess problem is that while MessageNotUnderstood is indeed a subclass of
> Error, Halt is not. Anyway, the real problem is that with halt, the hooked
> method #openDebuggerOn: is not called... I tried to find out which
> method handled Halt but I failed.
>
>
> c) what happens if we have multiple debuggers opened? I am worried about
>> the "soleInstance" of ProcessSpecificVariable.
>>
>>
>> Thoughts? Can you tell me if this works for you?
>>
>>
>>
>>
>> On Fri, Dec 4, 2015 at 1:13 PM, Max Leske <maxleske(a)gmail.com> wrote:
>>
>>>
>>> On 04 Dec 2015, at 17:11, Mariano Martinez Peck <marianopeck(a)gmail.com>
>>> wrote:
>>>
>>> I found a way!!!! Much cleaner and easier. Awesome!
>>> I will clean it, test it a bit more and try to package it for public
>>> usage :)
>>>
>>>
>>> Give me a snippet! I want to play with it! :D
>>>
>>>
>>> On Fri, Dec 4, 2015 at 12:31 PM, Mariano Martinez Peck <
>>> marianopeck(a)gmail.com> wrote:
>>>
>>>>
>>>>
>>>> On Fri, Dec 4, 2015 at 12:05 PM, Max Leske <maxleske(a)gmail.com> wrote:
>>>>
>>>>>
>>>>> On 04 Dec 2015, at 14:29, Mariano Martinez Peck <marianopeck(a)gmail.com>
>>>>> wrote:
>>>>>
>>>>> Max...Seaside uses WADynamicVariable (NOT DynamicVariable) which
>>>>> are completely different. WADynamicVariable uses exception mechanism
>>>>> while DynamicVariable uses the ProcessSpecificVariable.
>>>>> But thanks anyway!
>>>>>
>>>>>
>>>>> Oh manâ¦. Sorry :)
>>>>>
>>>>> I wonder, why WADynamicVariable *isnât* a DynamicVariable. The
>>>>> semantics are the same if Iâm not mistaken (e.g. only available in the
>>>>> current process) and I think access to a dynamic variable may even be
>>>>> faster because it *doesnât* use the exception mechanism (i.e. no need to
>>>>> walk down the stack).
>>>>> If someone knows the answer, Iâd be happy to hear it.
>>>>>
>>>>>
>>>> I bet it's because of portability. For example, i remember in GemStone
>>>> the ProcessorLocalVariable did not behave the same as in Pharo. And it was
>>>> actually an experiment. I think you cannot expect all this stuff to be ansi
>>>> (or easily portable), while exceptions do.
>>>>
>>>>
>>>>> Iâve played around with Process>>signalException: and
>>>>> Context>>handleSignal: (which looked quite promising) but didnât get any
>>>>> results. Iâm out of ideas.
>>>>>
>>>>>
>>>> I have played all morning with an idea of using local variables. I
>>>> arrive to the point where I DO HAVE the request context at hand, but I
>>>> don't find an easy way to hook into do-its, print-it etc so that the
>>>> closure evaluated gets the request context plugged. In other ways... let's
>>>> say I have the context stored somewhere. I am at the SmalltalkEditor >>
>>>> evaluateSelectionAndDo: aBlock
>>>>
>>>> and so..somewhere I need to do something like:
>>>>
>>>> WACurrentRequestContext use: self storedContextSomewhere during: [
>>>> self theSelectionToBeEvaluated ]
>>>>
>>>> and that's where I am now :)
>>>>
>>>>
>>>>
>>>>
>>>>> Cheers,
>>>>> Max
>>>>>
>>>>>
>>>>> On Fri, Dec 4, 2015 at 7:32 AM, Max Leske <maxleske(a)gmail.com> wrote:
>>>>>
>>>>>> Hereâs a snippet to play with:
>>>>>>
>>>>>> p := Processor activeProcess.
>>>>>> x := 2.
>>>>>> v := TestDynamicVariable value: x during: [
>>>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>>>> env copyWithout: nil ]) inspect
>>>>>> ].
>>>>>>
>>>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>>>> env copyWithout: nil ]) inspect
>>>>>>
>>>>>> Cheers,
>>>>>> Max
>>>>>>
>>>>>> On 04 Dec 2015, at 10:47, Max Leske <maxleske(a)gmail.com> wrote:
>>>>>>
>>>>>> I feel you :)
>>>>>>
>>>>>> Without having thought this through completely: if you look at the
>>>>>> implementation of DynamicVariable>>value:during: youâll see that the way it
>>>>>> works is that the variable is bound to the active process. In the debugger
>>>>>> you have access to the process that is being debugged and thus you should
>>>>>> have access to the variables bound to it. You could try accessing all such
>>>>>> variables by iterating over them (which I think will require an extension
>>>>>> on Process because youâd need to access at least the PSKeys class variable).
>>>>>>
>>>>>> Cheers,
>>>>>> Max
>>>>>>
>>>>>> On 04 Dec 2015, at 00:34, Mariano Martinez Peck <
>>>>>> marianopeck(a)gmail.com> wrote:
>>>>>>
>>>>>> Hi guys,
>>>>>>
>>>>>> This thing I will ask in this email it's in my mind since YEARS. But
>>>>>> I have always thought it was like that and that there was nothing we could
>>>>>> do. However, I think it's time I ask again :)
>>>>>>
>>>>>> For those that have used Seaside, and you try to debug, you know that
>>>>>> upon request processing seaside uses Exceptions mechanisim to always have
>>>>>> access to the request, session, etc. They way that is done is very smart :)
>>>>>>
>>>>>> WACurrentRequestContext use: self during: aBlock
>>>>>>
>>>>>> In that case, "self" is the request instance and aBlock the closure
>>>>>> that takes care of the request processing. So, inside that closure,
>>>>>> everywhere you do "WACurrentRequestContext value" you get the correct
>>>>>> request instance.
>>>>>>
>>>>>> So..that's great for Seaside, but debugging gets complicated. While
>>>>>> you can restart, proceed, etc, once inside debugger, you cannot evaluate
>>>>>> any piece of code that will use the session or request because you get
>>>>>> a WARequestContextNotFound. Of course, because I guess the evaluation you
>>>>>> do from cmd+d on a piece of text or via the debugger inspector, creates
>>>>>> another closure/context which does not receive the WACurrentRequestContext
>>>>>> instance.
>>>>>>
>>>>>> Now....besides WACurrentRequestContext I have my own class
>>>>>> UserContextInformation where I basically have a bunch of stuff associated
>>>>>> to the logged user. And I do exactly the same as the
>>>>>> WACurrentRequestContext. And I have the same problem. I really want to be
>>>>>> able to fix this.
>>>>>>
>>>>>> Anyone have an idea on how can I do it? I guess I can change the
>>>>>> debugger, in the place where I evaluate code so that I wrap that evaluation
>>>>>> with my request context instance???
>>>>>>
>>>>>> Thoughts?
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Mariano
>>>>>> http://marianopeck.wordpress.com
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Mariano
>>>>> http://marianopeck.wordpress.com
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Mariano
>>>> http://marianopeck.wordpress.com
>>>>
>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>>
>>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
--
Mariano
http://marianopeck.wordpress.com
Dec. 4, 2015
Re: [Pharo-dev] How to listen Monticello load start/end (and origin of changes)
by Andrei Chis
Hi,
A fix is now available that uses custom announcements to signal the
start/end of a monticello version load
(MCVersionLoaderStartAnnouncement, MCVersionLoaderStopAnnouncement)
A review is required: https://pharo.fogbugz.com/f/cases/17186
Cheers,
Andrei
On Fri, Dec 4, 2015 at 1:52 PM, Andrei Chis <chisvasileandrei(a)gmail.com>
wrote:
> Hi Martin,
>
> Interesting solution but it feels a bit like a hack.
> For the GTools we made a solution that triggers a custom announcer before
> and after a Monticello load.
> We'll make a slice later today.
>
> Cheers,
> Andrei
>
> On Thu, Dec 3, 2015 at 3:46 PM, Martin Dias <tinchodias(a)gmail.com> wrote:
>
>> Hi,
>>
>> Doru asked me how does Epicea listen this information, and I created a
>> snippet to demo it *in a plain Pharo 5 image* (no need to load Epicea
>> before). Maybe somebody else is interested, that's why I share it with
>> everybody.
>>
>> You can open a Transcript and evaluate the following snippet. After
>> evaluation, you can add new methods in Nautilus and see the log in the
>> Transcript. (The code is not very nice).
>>
>> Cheers,
>> Martin
>>
>>
>>
>> "Listen load start"
>> Job jobAnnouncer
>> when: JobStart
>> do: [ :aJobStart |
>> | owner |
>> owner := aJobStart job owner.
>>
>> (owner isKindOf: MCVersionLoader)
>> ifTrue: [ ('Starting to load ', owner versions asArray asString) logCr ]
>> ].
>> "Listen load end"
>> Job jobAnnouncer
>> when: JobEnd
>> do: [ :aJobEnd |
>> | owner |
>> owner := aJobEnd job owner.
>>
>> (owner isKindOf: MCVersionLoader)
>> ifTrue: [ ('Ending to load ', owner versions asArray asString) logCr ] ].
>>
>> "Listen changes in the middle"
>> SystemAnnouncer uniqueInstance
>> when: MethodAdded
>> do: [ :aMethodAdded |
>> | mcLoaderJobOrNil |
>> mcLoaderJobOrNil :=
>> Job current
>> ifNil: [ nil ]
>> ifNotNil: [ :currentJob |
>> currentJob
>> lookup: [ :job | job owner isKindOf: MCVersionLoader ]
>> ifNone: [ nil ] ].
>> (aMethodAdded methodAdded printString, ' --- ',
>> (mcLoaderJobOrNil
>> ifNil: [ 'no info' ]
>> ifNotNil: [ 'while loading ', mcLoaderJobOrNil owner versions asArray
>> asString ])) logCr ].
>>
>>
>> "Try it loading"
>> Gofer it
>> smalltalkhubUser: 'MartinDias' project: 'AlarmClock';
>> package: 'AlarmClock';
>> load.
>>
>>
>>
>>
>
Dec. 4, 2015
Re: [Pharo-dev] Hook "WACurrentRequestContext" into debugger?
by Mariano Martinez Peck
On Fri, Dec 4, 2015 at 1:29 PM, Mariano Martinez Peck <marianopeck(a)gmail.com
> wrote:
> OK. But be aware it is very very little tested and probably still a hack,
> and it still need overrides. Hopefully you will help me to polish it until
> we get a "SeasidePharoDebugging" package with no override :)
>
> All what I mention here is tested in Pharo 4.0 with Seaside 3.1.4.1.
>
> These are the steps:
>
> 1) Create a
>
> ProcessLocalVariable subclass: #WACurrentRequestContextPLV
> instanceVariableNames: ''
> classVariableNames: ''
> category: 'SeasidePharoDebugging'
>
> 2) Override GRPharoPlatform >> openDebuggerOn (see highlighted lines)
> The idea is to simply store the WACurrentRequestContext into a processor
> local variable before we loose it.
>
> openDebuggerOn: anError
> | process currentRequest |
> process := Processor activeProcess.
> currentRequest := WACurrentRequestContext value.
>
> "If we are running in the UI process, we don't want to suspend the active
> process. The
> error was presumably triggered while stepping in the Debugger. If we
> simply immediately
> signal an UnhandledError, the debugger will catch this and display the
> signaling context.
> It isn't perfect or pretty but it works."
> (ProcessBrowser isUIProcess: process)
> ifTrue: [
> UnhandledError signalForException: anError ]
> ifFalse: [
> WorldState addDeferredUIMessage: [
> WACurrentRequestContextPLV value: currentRequest.
> process
> debug: anError signalerContext
> title: anError description
> full: true.
> ].
> process suspend ]
>
>
> 3) Override WACurrentRequestContext class >> defaultValue
>
> defaultValue
> ^ WACurrentRequestContextPLV value ifNil: [ WARequestContextNotFound
> signal ]
> 4) Set WADebugErrorHandler as the error handler in your seaside app (I am
> not sure if this step is needed).
>
> And that's all. Try to put a "self whateverMethodThatCausesDNU" and then,
> try to evalaute something from the debugger that calls #session or
> #requestContext etc... for example, evaluate "WAComponent new session" and
> that should work:
>
> Besides the overrides I still have doubts:
>
> a) do we need WADebugErrorHandler ?
>
Yes, we do, because we are hooking in #openDebuggerOn: and that's only
called from WADebugErrorHandler.
> b) it seems "Halt halt" does not work but sending a message that causes
> dnu does work. Maybe related to WADebugErrorHandler.
>
I guess problem is that while MessageNotUnderstood is indeed a subclass of
Error, Halt is not. Anyway, the real problem is that with halt, the hooked
method #openDebuggerOn: is not called... I tried to find out which
method handled Halt but I failed.
c) what happens if we have multiple debuggers opened? I am worried about
> the "soleInstance" of ProcessSpecificVariable.
>
>
> Thoughts? Can you tell me if this works for you?
>
>
>
>
> On Fri, Dec 4, 2015 at 1:13 PM, Max Leske <maxleske(a)gmail.com> wrote:
>
>>
>> On 04 Dec 2015, at 17:11, Mariano Martinez Peck <marianopeck(a)gmail.com>
>> wrote:
>>
>> I found a way!!!! Much cleaner and easier. Awesome!
>> I will clean it, test it a bit more and try to package it for public
>> usage :)
>>
>>
>> Give me a snippet! I want to play with it! :D
>>
>>
>> On Fri, Dec 4, 2015 at 12:31 PM, Mariano Martinez Peck <
>> marianopeck(a)gmail.com> wrote:
>>
>>>
>>>
>>> On Fri, Dec 4, 2015 at 12:05 PM, Max Leske <maxleske(a)gmail.com> wrote:
>>>
>>>>
>>>> On 04 Dec 2015, at 14:29, Mariano Martinez Peck <marianopeck(a)gmail.com>
>>>> wrote:
>>>>
>>>> Max...Seaside uses WADynamicVariable (NOT DynamicVariable) which
>>>> are completely different. WADynamicVariable uses exception mechanism
>>>> while DynamicVariable uses the ProcessSpecificVariable.
>>>> But thanks anyway!
>>>>
>>>>
>>>> Oh manâ¦. Sorry :)
>>>>
>>>> I wonder, why WADynamicVariable *isnât* a DynamicVariable. The
>>>> semantics are the same if Iâm not mistaken (e.g. only available in the
>>>> current process) and I think access to a dynamic variable may even be
>>>> faster because it *doesnât* use the exception mechanism (i.e. no need to
>>>> walk down the stack).
>>>> If someone knows the answer, Iâd be happy to hear it.
>>>>
>>>>
>>> I bet it's because of portability. For example, i remember in GemStone
>>> the ProcessorLocalVariable did not behave the same as in Pharo. And it was
>>> actually an experiment. I think you cannot expect all this stuff to be ansi
>>> (or easily portable), while exceptions do.
>>>
>>>
>>>> Iâve played around with Process>>signalException: and
>>>> Context>>handleSignal: (which looked quite promising) but didnât get any
>>>> results. Iâm out of ideas.
>>>>
>>>>
>>> I have played all morning with an idea of using local variables. I
>>> arrive to the point where I DO HAVE the request context at hand, but I
>>> don't find an easy way to hook into do-its, print-it etc so that the
>>> closure evaluated gets the request context plugged. In other ways... let's
>>> say I have the context stored somewhere. I am at the SmalltalkEditor >>
>>> evaluateSelectionAndDo: aBlock
>>>
>>> and so..somewhere I need to do something like:
>>>
>>> WACurrentRequestContext use: self storedContextSomewhere during: [ self
>>> theSelectionToBeEvaluated ]
>>>
>>> and that's where I am now :)
>>>
>>>
>>>
>>>
>>>> Cheers,
>>>> Max
>>>>
>>>>
>>>> On Fri, Dec 4, 2015 at 7:32 AM, Max Leske <maxleske(a)gmail.com> wrote:
>>>>
>>>>> Hereâs a snippet to play with:
>>>>>
>>>>> p := Processor activeProcess.
>>>>> x := 2.
>>>>> v := TestDynamicVariable value: x during: [
>>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>>> env copyWithout: nil ]) inspect
>>>>> ].
>>>>>
>>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>>> env copyWithout: nil ]) inspect
>>>>>
>>>>> Cheers,
>>>>> Max
>>>>>
>>>>> On 04 Dec 2015, at 10:47, Max Leske <maxleske(a)gmail.com> wrote:
>>>>>
>>>>> I feel you :)
>>>>>
>>>>> Without having thought this through completely: if you look at the
>>>>> implementation of DynamicVariable>>value:during: youâll see that the way it
>>>>> works is that the variable is bound to the active process. In the debugger
>>>>> you have access to the process that is being debugged and thus you should
>>>>> have access to the variables bound to it. You could try accessing all such
>>>>> variables by iterating over them (which I think will require an extension
>>>>> on Process because youâd need to access at least the PSKeys class variable).
>>>>>
>>>>> Cheers,
>>>>> Max
>>>>>
>>>>> On 04 Dec 2015, at 00:34, Mariano Martinez Peck <marianopeck(a)gmail.com>
>>>>> wrote:
>>>>>
>>>>> Hi guys,
>>>>>
>>>>> This thing I will ask in this email it's in my mind since YEARS. But I
>>>>> have always thought it was like that and that there was nothing we could
>>>>> do. However, I think it's time I ask again :)
>>>>>
>>>>> For those that have used Seaside, and you try to debug, you know that
>>>>> upon request processing seaside uses Exceptions mechanisim to always have
>>>>> access to the request, session, etc. They way that is done is very smart :)
>>>>>
>>>>> WACurrentRequestContext use: self during: aBlock
>>>>>
>>>>> In that case, "self" is the request instance and aBlock the closure
>>>>> that takes care of the request processing. So, inside that closure,
>>>>> everywhere you do "WACurrentRequestContext value" you get the correct
>>>>> request instance.
>>>>>
>>>>> So..that's great for Seaside, but debugging gets complicated. While
>>>>> you can restart, proceed, etc, once inside debugger, you cannot evaluate
>>>>> any piece of code that will use the session or request because you get
>>>>> a WARequestContextNotFound. Of course, because I guess the evaluation you
>>>>> do from cmd+d on a piece of text or via the debugger inspector, creates
>>>>> another closure/context which does not receive the WACurrentRequestContext
>>>>> instance.
>>>>>
>>>>> Now....besides WACurrentRequestContext I have my own class
>>>>> UserContextInformation where I basically have a bunch of stuff associated
>>>>> to the logged user. And I do exactly the same as the
>>>>> WACurrentRequestContext. And I have the same problem. I really want to be
>>>>> able to fix this.
>>>>>
>>>>> Anyone have an idea on how can I do it? I guess I can change the
>>>>> debugger, in the place where I evaluate code so that I wrap that evaluation
>>>>> with my request context instance???
>>>>>
>>>>> Thoughts?
>>>>>
>>>>>
>>>>> --
>>>>> Mariano
>>>>> http://marianopeck.wordpress.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Mariano
>>>> http://marianopeck.wordpress.com
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
--
Mariano
http://marianopeck.wordpress.com
Dec. 4, 2015
Re: [Pharo-dev] GTDebugger not draggable with latest VM
by Henrik Nergaard
Case 17178 added an extra check to the handling of mouse movement to use the result from asking the event handler by default (if the morph has an event handler) in the same way as other âhandlesâ methods behaves. The default behaviour for Morph event handling is that if an event handler is present for a morphic object it is up to its class to specify which events that uses the event handling mechanism or not.
GLMSystemWindow>>#initialize creates an event handler for itself, which then causes the #handlesMouseMove: to return false since it has an event handler, but it does not handle #mouseMove.
One solution could be to remove GLMSystemWindow>>#initialize and implement #keyStroke: instead.
>>keyStroke:
super keyStroke.
self handleKeyStroke: evt.
Other possible solution could be to implement #handlesMouseMove: in GMLSystemWindow with the logic necessary.
Another possibility is to only return early in Morph>>#handlesMouseMove: Iff the event handler has an event registration for #mouseMove.
I would go with the first solution, and remove the need for an event handler object in GLMSystemWindow.
Best regards,
Henrik
From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Andrei Chis
Sent: Friday, December 4, 2015 4:31 PM
To: Pharo Development List <pharo-dev(a)lists.pharo.org>
Cc: Moose-related development <moose-dev(a)list.inf.unibe.ch>
Subject: Re: [Pharo-dev] GTDebugger not draggable with latest VM
Seems to happen due to the fix in issue 17178<https://pharo.fogbugz.com/f/cases/17178>
On Fri, Dec 4, 2015 at 4:21 PM, Andrei Chis <chisvasileandrei(a)gmail.com<mailto:chisvasileandrei@gmail.com>> wrote:
Seems that starting with Pharo 50483 one cannot drag the inspector/playground/debugger.
No idea what happened.
On Fri, Dec 4, 2015 at 3:19 PM, Blondeau Vincent <vincent.blondeau(a)worldline.com<mailto:vincent.blondeau@worldline.com>> wrote:
Hi,
I have a problem on the latest Moose6.0 image.
I was not able to open a Roassal view, I had a NativeBoost Generic failureâ¦
So I updated the VM to last stable, and, now, the GTdebugger and the Moose panel are not draggable anymoreâ¦
Can somebody is able to reproduce the problem?
Thanks
Cheers,
Vincent
________________________________
Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité de Worldline ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
Dec. 4, 2015
Re: [Pharo-dev] Hook "WACurrentRequestContext" into debugger?
by Mariano Martinez Peck
OK. But be aware it is very very little tested and probably still a hack,
and it still need overrides. Hopefully you will help me to polish it until
we get a "SeasidePharoDebugging" package with no override :)
All what I mention here is tested in Pharo 4.0 with Seaside 3.1.4.1.
These are the steps:
1) Create a
ProcessLocalVariable subclass: #WACurrentRequestContextPLV
instanceVariableNames: ''
classVariableNames: ''
category: 'SeasidePharoDebugging'
2) Override GRPharoPlatform >> openDebuggerOn (see highlighted lines)
The idea is to simply store the WACurrentRequestContext into a processor
local variable before we loose it.
openDebuggerOn: anError
| process currentRequest |
process := Processor activeProcess.
currentRequest := WACurrentRequestContext value.
"If we are running in the UI process, we don't want to suspend the active
process. The
error was presumably triggered while stepping in the Debugger. If we simply
immediately
signal an UnhandledError, the debugger will catch this and display the
signaling context.
It isn't perfect or pretty but it works."
(ProcessBrowser isUIProcess: process)
ifTrue: [
UnhandledError signalForException: anError ]
ifFalse: [
WorldState addDeferredUIMessage: [
WACurrentRequestContextPLV value: currentRequest.
process
debug: anError signalerContext
title: anError description
full: true.
].
process suspend ]
3) Override WACurrentRequestContext class >> defaultValue
defaultValue
^ WACurrentRequestContextPLV value ifNil: [ WARequestContextNotFound signal
]
4) Set WADebugErrorHandler as the error handler in your seaside app (I am
not sure if this step is needed).
And that's all. Try to put a "self whateverMethodThatCausesDNU" and then,
try to evalaute something from the debugger that calls #session or
#requestContext etc... for example, evaluate "WAComponent new session" and
that should work:
Besides the overrides I still have doubts:
a) do we need WADebugErrorHandler ?
b) it seems "Halt halt" does not work but sending a message that causes dnu
does work. Maybe related to WADebugErrorHandler.
c) what happens if we have multiple debuggers opened? I am worried about
the "soleInstance" of ProcessSpecificVariable.
Thoughts? Can you tell me if this works for you?
On Fri, Dec 4, 2015 at 1:13 PM, Max Leske <maxleske(a)gmail.com> wrote:
>
> On 04 Dec 2015, at 17:11, Mariano Martinez Peck <marianopeck(a)gmail.com>
> wrote:
>
> I found a way!!!! Much cleaner and easier. Awesome!
> I will clean it, test it a bit more and try to package it for public usage
> :)
>
>
> Give me a snippet! I want to play with it! :D
>
>
> On Fri, Dec 4, 2015 at 12:31 PM, Mariano Martinez Peck <
> marianopeck(a)gmail.com> wrote:
>
>>
>>
>> On Fri, Dec 4, 2015 at 12:05 PM, Max Leske <maxleske(a)gmail.com> wrote:
>>
>>>
>>> On 04 Dec 2015, at 14:29, Mariano Martinez Peck <marianopeck(a)gmail.com>
>>> wrote:
>>>
>>> Max...Seaside uses WADynamicVariable (NOT DynamicVariable) which
>>> are completely different. WADynamicVariable uses exception mechanism
>>> while DynamicVariable uses the ProcessSpecificVariable.
>>> But thanks anyway!
>>>
>>>
>>> Oh manâ¦. Sorry :)
>>>
>>> I wonder, why WADynamicVariable *isnât* a DynamicVariable. The semantics
>>> are the same if Iâm not mistaken (e.g. only available in the current
>>> process) and I think access to a dynamic variable may even be faster
>>> because it *doesnât* use the exception mechanism (i.e. no need to walk down
>>> the stack).
>>> If someone knows the answer, Iâd be happy to hear it.
>>>
>>>
>> I bet it's because of portability. For example, i remember in GemStone
>> the ProcessorLocalVariable did not behave the same as in Pharo. And it was
>> actually an experiment. I think you cannot expect all this stuff to be ansi
>> (or easily portable), while exceptions do.
>>
>>
>>> Iâve played around with Process>>signalException: and
>>> Context>>handleSignal: (which looked quite promising) but didnât get any
>>> results. Iâm out of ideas.
>>>
>>>
>> I have played all morning with an idea of using local variables. I arrive
>> to the point where I DO HAVE the request context at hand, but I don't find
>> an easy way to hook into do-its, print-it etc so that the closure evaluated
>> gets the request context plugged. In other ways... let's say I have the
>> context stored somewhere. I am at the SmalltalkEditor >>
>> evaluateSelectionAndDo: aBlock
>>
>> and so..somewhere I need to do something like:
>>
>> WACurrentRequestContext use: self storedContextSomewhere during: [ self
>> theSelectionToBeEvaluated ]
>>
>> and that's where I am now :)
>>
>>
>>
>>
>>> Cheers,
>>> Max
>>>
>>>
>>> On Fri, Dec 4, 2015 at 7:32 AM, Max Leske <maxleske(a)gmail.com> wrote:
>>>
>>>> Hereâs a snippet to play with:
>>>>
>>>> p := Processor activeProcess.
>>>> x := 2.
>>>> v := TestDynamicVariable value: x during: [
>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>> env copyWithout: nil ]) inspect
>>>> ].
>>>>
>>>> ((p instVarNamed: 'env') ifNotNil: [ :env|
>>>> env copyWithout: nil ]) inspect
>>>>
>>>> Cheers,
>>>> Max
>>>>
>>>> On 04 Dec 2015, at 10:47, Max Leske <maxleske(a)gmail.com> wrote:
>>>>
>>>> I feel you :)
>>>>
>>>> Without having thought this through completely: if you look at the
>>>> implementation of DynamicVariable>>value:during: youâll see that the way it
>>>> works is that the variable is bound to the active process. In the debugger
>>>> you have access to the process that is being debugged and thus you should
>>>> have access to the variables bound to it. You could try accessing all such
>>>> variables by iterating over them (which I think will require an extension
>>>> on Process because youâd need to access at least the PSKeys class variable).
>>>>
>>>> Cheers,
>>>> Max
>>>>
>>>> On 04 Dec 2015, at 00:34, Mariano Martinez Peck <marianopeck(a)gmail.com>
>>>> wrote:
>>>>
>>>> Hi guys,
>>>>
>>>> This thing I will ask in this email it's in my mind since YEARS. But I
>>>> have always thought it was like that and that there was nothing we could
>>>> do. However, I think it's time I ask again :)
>>>>
>>>> For those that have used Seaside, and you try to debug, you know that
>>>> upon request processing seaside uses Exceptions mechanisim to always have
>>>> access to the request, session, etc. They way that is done is very smart :)
>>>>
>>>> WACurrentRequestContext use: self during: aBlock
>>>>
>>>> In that case, "self" is the request instance and aBlock the closure
>>>> that takes care of the request processing. So, inside that closure,
>>>> everywhere you do "WACurrentRequestContext value" you get the correct
>>>> request instance.
>>>>
>>>> So..that's great for Seaside, but debugging gets complicated. While you
>>>> can restart, proceed, etc, once inside debugger, you cannot evaluate any
>>>> piece of code that will use the session or request because you get
>>>> a WARequestContextNotFound. Of course, because I guess the evaluation you
>>>> do from cmd+d on a piece of text or via the debugger inspector, creates
>>>> another closure/context which does not receive the WACurrentRequestContext
>>>> instance.
>>>>
>>>> Now....besides WACurrentRequestContext I have my own class
>>>> UserContextInformation where I basically have a bunch of stuff associated
>>>> to the logged user. And I do exactly the same as the
>>>> WACurrentRequestContext. And I have the same problem. I really want to be
>>>> able to fix this.
>>>>
>>>> Anyone have an idea on how can I do it? I guess I can change the
>>>> debugger, in the place where I evaluate code so that I wrap that evaluation
>>>> with my request context instance???
>>>>
>>>> Thoughts?
>>>>
>>>>
>>>> --
>>>> Mariano
>>>> http://marianopeck.wordpress.com
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>>
>>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>
--
Mariano
http://marianopeck.wordpress.com
Dec. 4, 2015