Hi
I try to investigate how debugger opens and who initiates it. I want to cleanup this logic and simplify current debugger API. I found that basic error debugging starts with UIManager then UIManager calls SpecDebugger, then SpecDebugger calls UIManager and again... At the end of this chain debugger is opened by #openFullSuspendLabel: or #openNotifierContents:label: There are two places where opening debugger initiated differently: - Low space watcher calls SpecDebugger class>>openInterrupt:onProcess: - Warning default action calls SpecDebugger class>>openContext:label:contents: (And it not uses UIManager. I guess non interactive mode not working here). In latest Pharo image it is only users of this methods. Is anybody know anyone else? I almost cleaned basic errors debugging. And I want use it for this two cases too. But they implements very specific logic. They both contains primitive simulation guard 19 and some kind of recursion tracking. I understand that low space watcher requires something clever. But why Warning not opens debugger with way Error does it? Any suggestions? Best regards, Denis |
I clean and refactor all but lowSpaceWatcher. It is in slice 17069. In my image it is not broke stuff. So I hope it is safe change. 2015-11-20 12:18 GMT+01:00 Denis Kudriashov <[hidden email]>:
|
Very nice. I remember when I made GTDebugger that there were way to many ways to open the debugger. I ended up just copy-pasting things. Would be very useful to have a small doc with what one needs to do to replace SpecDebugger with another debugger (e.g. what are the entry points of the debugger in the system) Cheers, Andrei On Fri, Nov 20, 2015 at 6:48 PM, Denis Kudriashov <[hidden email]> wrote:
|
Slice was declined because I remove SyntaxErrorDebugger. I not found any reference to it. And there was no instances of it. Can anybody show me where it is used? 20 нояб. 2015 г. 19:27 пользователь "Andrei Chis" <[hidden email]> написал:
|
Are you sure? The validation says that it failed due to “subclass responsibility not defined” (two messages of UIManager that aren’t implemented in all of its subclasses). It doesn’t say anything abut SyntaxErrorDebugger. Cheers, Max
|
Ok. 21 нояб. 2015 г. 10:15 AM пользователь "Max Leske" <[hidden email]> написал:
|
My quick check didn’t turn up anything. But to be sure, go and grab the Moose development image. Maybe they use it there in some way (though I doubt it).
|
2015-11-21 10:43 GMT+01:00 Max Leske <[hidden email]>:
The SyntaxErrorDebugger registers itself for Smalltalk tools: registerToolsOn: registry "Add ourselves to registry. See [Smalltalk tools]" registry register: self as: #syntaxErrorDebugger And this is used by MorphicUIManager syntaxErrorNotificationDefaultAction: anException If you fileIn some code with syntactical error, this debugger pops up and (if if would work: issue 16961 ) you could fix that error manually.
|
Or if you type in a syntactically incorrect expression in inspectors search field: 2015-11-21 10:55 GMT+01:00 Nicolai Hess <[hidden email]>:
PharoScreenshot.png (72K) Download Attachment |
Oops! Thanks Nicolai. I missed that.
|
In reply to this post by Nicolai Hess-3-2
2015-11-21 10:55 GMT+01:00 Nicolai Hess <[hidden email]>:
Thank's. I will revert it |
In reply to this post by Nicolai Hess-3-2
An auxiliary concern here this /nice/correct/ form of using self
makes it invisible to the usual "users-of" search tools. I've been bitten by similar before. What can we do to make this use case more visible? A pragmatic option might be to de-tune the purity of form and use... registry register: SyntaxErrorDebugger as: #syntaxErrorDebugger Probably this would probably additionally need a guard to ensure that subclasses can't run this code. I'm sure there'll be some adverse views to this suggestion, but I wanted raise the question and learn something along the way. cheers -ben On Sat, Nov 21, 2015 at 5:55 PM, Nicolai Hess <[hidden email]> wrote: > > > 2015-11-21 10:43 GMT+01:00 Max Leske <[hidden email]>: >> >> >> On 21 Nov 2015, at 10:22, Denis Kudriashov <[hidden email]> wrote: >> >> Ok. >> I just read Nicolai comment. >> So question: is SyntaxErrorDebugger used anywhere? I remove it because it >> uses another way how to open debugger >> >> >> >> My quick check didn’t turn up anything. But to be sure, go and grab the >> Moose development image. Maybe they use it t > > > The SyntaxErrorDebugger registers itself for Smalltalk tools: > > registerToolsOn: registry > "Add ourselves to registry. See [Smalltalk tools]" > registry register: self as: #syntaxErrorDebugger > > And this is used by MorphicUIManager syntaxErrorNotificationDefaultAction: > anException > > If you fileIn some code with syntactical error, this debugger pops up and > (if if would work: issue 16961 ) you could fix that error manually. > > >> >> here in some way (though I doubt it). >> >> 21 нояб. 2015 г. 10:15 AM пользователь "Max Leske" <[hidden email]> >> написал: >>> >>> >>> On 21 Nov 2015, at 09:34, Denis Kudriashov <[hidden email]> wrote: >>> >>> Slice was declined because I remove SyntaxErrorDebugger. I not found any >>> reference to it. And there was no instances of it. Can anybody show me where >>> it is used? >>> >>> >>> >>> Are you sure? The validation says that it failed due to “subclass >>> responsibility not defined” (two messages of UIManager that aren’t >>> implemented in all of its subclasses). It doesn’t say anything abut >>> SyntaxErrorDebugger. >>> >>> Cheers, >>> Max >>> >>> 20 нояб. 2015 г. 19:27 пользователь "Andrei Chis" >>> <[hidden email]> написал: >>>> >>>> Very nice. I remember when I made GTDebugger that there were way to many >>>> ways to open the debugger. I ended up just copy-pasting things. >>>> Would be very useful to have a small doc with what one needs to do to >>>> replace SpecDebugger with another debugger (e.g. what are the entry points >>>> of the debugger in the system) >>>> >>>> Cheers, >>>> Andrei >>>> >>>> On Fri, Nov 20, 2015 at 6:48 PM, Denis Kudriashov <[hidden email]> >>>> wrote: >>>>> >>>>> I clean and refactor all but lowSpaceWatcher. >>>>> It is in slice 17069. >>>>> In my image it is not broke stuff. So I hope it is safe change. >>>>> >>>>> 2015-11-20 12:18 GMT+01:00 Denis Kudriashov <[hidden email]>: >>>>>> >>>>>> Hi >>>>>> >>>>>> I try to investigate how debugger opens and who initiates it. >>>>>> I want to cleanup this logic and simplify current debugger API. >>>>>> >>>>>> I found that basic error debugging starts with UIManager then >>>>>> UIManager calls SpecDebugger, then SpecDebugger calls UIManager and again... >>>>>> At the end of this chain debugger is opened by #openFullSuspendLabel: or >>>>>> #openNotifierContents:label: >>>>>> >>>>>> There are two places where opening debugger initiated differently: >>>>>> - Low space watcher calls SpecDebugger class>>openInterrupt:onProcess: >>>>>> - Warning default action calls SpecDebugger >>>>>> class>>openContext:label:contents: (And it not uses UIManager. I guess non >>>>>> interactive mode not working here). >>>>>> >>>>>> In latest Pharo image it is only users of this methods. Is anybody >>>>>> know anyone else? >>>>>> >>>>>> I almost cleaned basic errors debugging. And I want use it for this >>>>>> two cases too. But they implements very specific logic. They both contains >>>>>> primitive simulation guard 19 and some kind of recursion tracking. >>>>>> I understand that low space watcher requires something clever. But why >>>>>> Warning not opens debugger with way Error does it? >>>>>> >>>>>> Any suggestions? >>>>>> >>>>>> Best regards, >>>>>> Denis >>>>> >>>>> >>>> >>> >> > |
In reply to this post by Denis Kudriashov
Fixed slice in inbox 2015-11-21 13:07 GMT+01:00 Denis Kudriashov <[hidden email]>:
|
In reply to this post by Ben Coman
Le 21/11/15 15:32, Ben Coman a écrit : > An auxiliary concern here this /nice/correct/ form of using self > makes it invisible to the usual "users-of" search tools. I've been > bitten by similar before. What can we do to make this use case more > visible? If I remember correctly the completion or something like that also use this trick. and registers to the tools. This is a rather ugly dependency. This is not good to me. I do not like this DNU trick because it blurs code > > A pragmatic option might be to de-tune the purity of form and use... > registry register: SyntaxErrorDebugger as: #syntaxErrorDebugger > > Probably this would probably additionally need a guard to ensure that > subclasses can't run this code. > I'm sure there'll be some adverse views to this suggestion, but I > wanted raise the question and learn something along the way. > > cheers -ben > > On Sat, Nov 21, 2015 at 5:55 PM, Nicolai Hess <[hidden email]> wrote: >> >> 2015-11-21 10:43 GMT+01:00 Max Leske <[hidden email]>: >>> >>> On 21 Nov 2015, at 10:22, Denis Kudriashov <[hidden email]> wrote: >>> >>> Ok. >>> I just read Nicolai comment. >>> So question: is SyntaxErrorDebugger used anywhere? I remove it because it >>> uses another way how to open debugger >>> >>> >>> >>> My quick check didn’t turn up anything. But to be sure, go and grab the >>> Moose development image. Maybe they use it t >> >> The SyntaxErrorDebugger registers itself for Smalltalk tools: >> >> registerToolsOn: registry >> "Add ourselves to registry. See [Smalltalk tools]" >> registry register: self as: #syntaxErrorDebugger >> >> And this is used by MorphicUIManager syntaxErrorNotificationDefaultAction: >> anException >> >> If you fileIn some code with syntactical error, this debugger pops up and >> (if if would work: issue 16961 ) you could fix that error manually. >> >> >>> here in some way (though I doubt it). >>> >>> 21 нояб. 2015 г. 10:15 AM пользователь "Max Leske" <[hidden email]> >>> написал: >>>> >>>> On 21 Nov 2015, at 09:34, Denis Kudriashov <[hidden email]> wrote: >>>> >>>> Slice was declined because I remove SyntaxErrorDebugger. I not found any >>>> reference to it. And there was no instances of it. Can anybody show me where >>>> it is used? >>>> >>>> >>>> >>>> Are you sure? The validation says that it failed due to “subclass >>>> responsibility not defined” (two messages of UIManager that aren’t >>>> implemented in all of its subclasses). It doesn’t say anything abut >>>> SyntaxErrorDebugger. >>>> >>>> Cheers, >>>> Max >>>> >>>> 20 нояб. 2015 г. 19:27 пользователь "Andrei Chis" >>>> <[hidden email]> написал: >>>>> Very nice. I remember when I made GTDebugger that there were way to many >>>>> ways to open the debugger. I ended up just copy-pasting things. >>>>> Would be very useful to have a small doc with what one needs to do to >>>>> replace SpecDebugger with another debugger (e.g. what are the entry points >>>>> of the debugger in the system) >>>>> >>>>> Cheers, >>>>> Andrei >>>>> >>>>> On Fri, Nov 20, 2015 at 6:48 PM, Denis Kudriashov <[hidden email]> >>>>> wrote: >>>>>> I clean and refactor all but lowSpaceWatcher. >>>>>> It is in slice 17069. >>>>>> In my image it is not broke stuff. So I hope it is safe change. >>>>>> >>>>>> 2015-11-20 12:18 GMT+01:00 Denis Kudriashov <[hidden email]>: >>>>>>> Hi >>>>>>> >>>>>>> I try to investigate how debugger opens and who initiates it. >>>>>>> I want to cleanup this logic and simplify current debugger API. >>>>>>> >>>>>>> I found that basic error debugging starts with UIManager then >>>>>>> UIManager calls SpecDebugger, then SpecDebugger calls UIManager and again... >>>>>>> At the end of this chain debugger is opened by #openFullSuspendLabel: or >>>>>>> #openNotifierContents:label: >>>>>>> >>>>>>> There are two places where opening debugger initiated differently: >>>>>>> - Low space watcher calls SpecDebugger class>>openInterrupt:onProcess: >>>>>>> - Warning default action calls SpecDebugger >>>>>>> class>>openContext:label:contents: (And it not uses UIManager. I guess non >>>>>>> interactive mode not working here). >>>>>>> >>>>>>> In latest Pharo image it is only users of this methods. Is anybody >>>>>>> know anyone else? >>>>>>> >>>>>>> I almost cleaned basic errors debugging. And I want use it for this >>>>>>> two cases too. But they implements very specific logic. They both contains >>>>>>> primitive simulation guard 19 and some kind of recursion tracking. >>>>>>> I understand that low space watcher requires something clever. But why >>>>>>> Warning not opens debugger with way Error does it? >>>>>>> >>>>>>> Any suggestions? >>>>>>> >>>>>>> Best regards, >>>>>>> Denis >>>>>> > |
Hi,
In updating the debuggers from moose to the new API just one small issue came up: - Process>>newDebugSessionNamed:startedAt: hardcodes DebugSession. However we are using different debugging sessions. The class side method #sessionClass of a debugger returns the debugging session's class. That could be used instead of DebugSession. Cheers, Andrei |
2015-11-25 17:16 GMT+01:00 Andrei Chis <[hidden email]>:
To provide fast fix we can rewrite process method with: Process>>newDebugSessionNamed: aString startedAt: aContext ^Smalltalk tools debugger sessionClass named: aString on: self startedAt: aContext Could you publish issue and slice? In my fixes I try to put single point for debugging. I removed some old methods and clean places where they was used. Session is actual debugger model. And I was think that it is better to always create debugger on it. Now I think that maybe debug session should be internal object for debugger. But it's seems strange. My main target is remote debugger. So I try to investigate all related stuff. What subclasses of DebugSession implement specifically? For what they needed? If we move to GTDebugger completely can we have only debug session class? |
On Wed, Nov 25, 2015 at 6:29 PM, Denis Kudriashov <[hidden email]> wrote:
We can postpone this for the moment. I'll look a bit more at how this fits with the debuggers from moose as I'd like a more general solution where the debugger can be dynamically selected.
When I added the session I viewed it as a model for the debugger. SpecDebugger and GTStackDebugger are just two different user interfaces for the same model (DebugSession).
Cool target :)
For example, GTBytecodeDebugger uses GTBytecodeDebuggerSession which makes sure step instructions only go over one bytecode (so no usage of #stepToSendOrReturn which are needed in the normal debugger). Apart from this other sessions store more information. For example GTSUnitDebugSession stores the context with the failing assertion.
GTGenericStackDebugger, the equivalent of SpecDebugger, uses also DebugSession (it just adds a few extension methods). All other debuggers have sessions that just inherit from DebugSession and they can be loaded separately. Cheers, Andrei |
Free forum by Nabble | Edit this page |