The Trunk: Tools-eem.817.mcz

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

The Trunk: Tools-eem.817.mcz

commits-2
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.817.mcz

==================== Summary ====================

Name: Tools-eem.817
Author: eem
Time: 3 June 2018, 11:30:18.12214 am
UUID: e29d1a74-c6b6-4752-b4d0-b735061f4c9f
Ancestors: Tools-mt.816

In the absence of proper support from RealEstateAgent and the tool builder, provide a memory of the debugger's last extent, and use it when opening a full debugger.

=============== Diff against Tools-mt.816 ===============

Item was changed:
  CodeHolder subclass: #Debugger
  instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject errorWasInUIProcess labelString message untilExpression'
+ classVariableNames: 'ContextStackKeystrokes ErrorRecursion ErrorRecursionGuard ErrorReportServer InterruptUIProcessIfBlockedOnErrorInBackgroundProcess SavedExtent WantsAnnotationPane'
- classVariableNames: 'ContextStackKeystrokes ErrorRecursion ErrorRecursionGuard ErrorReportServer InterruptUIProcessIfBlockedOnErrorInBackgroundProcess WantsAnnotationPane'
  poolDictionaries: ''
  category: 'Tools-Debugger'!
 
  !Debugger commentStamp: '<historical>' prior: 0!
  I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.
 
  Special note on recursive errors:
  Some errors affect Squeak's ability to present a debugger.  This is normally an unrecoverable situation.  However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger.  Here is the chain of events in such a recovery.
 
  * A recursive error is detected.
  * The current project is queried for an isolationHead
  * Changes in the isolationHead are revoked
  * The parent project of isolated project is returned to
  * The debugger is opened there and execution resumes.
 
  If the user closes that debugger, execution continues in the outer project and layer.  If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world. !

Item was changed:
  ----- Method: Debugger>>buildFullWith: (in category 'toolbuilder') -----
  buildFullWith: builder
  | windowSpec listSpec textSpec |
  windowSpec := builder pluggableWindowSpec new
  model: self;
  label: 'Debugger';
  children: OrderedCollection new.
+ SavedExtent ifNotNil:
+ [windowSpec extent: SavedExtent].
 
  listSpec := builder pluggableListSpec new.
  listSpec
  model: self;
  list: #contextStackList;
  getIndex: #contextStackIndex;
  setIndex: #toggleContextStackIndex:;
  menu: #contextStackMenu:shifted:;
  icon: #messageIconAt:;
  helpItem: #messageHelpAt:;
  keyPress: #contextStackKey:from:;
  frame: (0@0 corner: 1@0.22).
  windowSpec children add: listSpec.
 
 
  textSpec := self buildCodePaneWith: builder.
  textSpec frame: (0@0.22corner: 1@0.8).
  windowSpec children add: textSpec.
 
  listSpec := builder pluggableListSpec new.
  listSpec
  model: self receiverInspector;
  list: #fieldList;
  getIndex: #selectionIndex;
  setIndex: #toggleIndex:;
  menu: #fieldListMenu:;
  keyPress: #inspectorKey:from:;
  frame: (0@0.8 corner: 0.2@1);
  help: 'Receiver''s\Instance\Variables' withCRs.
  windowSpec children add: listSpec.
 
  textSpec := builder pluggableTextSpec new.
  textSpec
  model: self receiverInspector;
  getText: #contents;
  setText: #accept:;
  help: '<- Select receiver''s field' translated;
  selection: #contentsSelection;
  menu: #codePaneMenu:shifted:;
  frame: (0.2@0.8 corner: 0.5@1).
  windowSpec children add: textSpec.
 
  listSpec := builder pluggableListSpec new.
  listSpec
  model: self contextVariablesInspector;
  list: #fieldList;
  getIndex: #selectionIndex;
  setIndex: #toggleIndex:;
  menu: #fieldListMenu:;
  keyPress: #inspectorKey:from:;
  frame: (0.5@0.8 corner: 0.7@1);
  help: 'Other\Context\Bindings' withCRs.
  windowSpec children add: listSpec.
 
  textSpec := builder pluggableTextSpec new.
  textSpec
  model: self contextVariablesInspector;
  getText: #contents;
  setText: #accept:;
  help: '<- Select context''s field' translated;
  selection: #contentsSelection;
  menu: #codePaneMenu:shifted:;
  frame: (0.7@0.8 corner: 1@1).
  windowSpec children add: textSpec.
 
  ^builder build: windowSpec!

Item was changed:
  ----- Method: Debugger>>windowIsClosing (in category 'initialize') -----
  windowIsClosing
+ "My window is being closed; if debugging save its extent.
+ Clean up.  Restart the low space watcher."
- "My window is being closed; clean up. Restart the low space watcher."
 
+ interruptedProcess ifNil: [^self].
+ (self dependents detect: [:m| m isWindowForModel: self] ifNone: []) ifNotNil:
+ [:topWindow| | isDebuggerNotNotifier |
+ isDebuggerNotNotifier := self dependents anySatisfy: [:m| m isTextView].
+ isDebuggerNotNotifier ifTrue:
+ [SavedExtent := topWindow extent]].
- interruptedProcess == nil ifTrue: [^ self].
  interruptedProcess terminate.
  interruptedProcess := nil.
  interruptedController := nil.
  contextStack := nil.
  receiverInspector := nil.
  contextVariablesInspector := nil.
+ Smalltalk installLowSpaceWatcher  "restart low space handler"
- Smalltalk installLowSpaceWatcher.  "restart low space handler"
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-eem.817.mcz

Chris Muller-3
Hey Eliot, this change doesn't seem to be working as designed.  I have
no idea why, but my debugger keeps opening larger and larger every
time, instead of the extent it was when it was last closed...

On Sun, Jun 3, 2018 at 1:30 PM <[hidden email]> wrote:

>
> Eliot Miranda uploaded a new version of Tools to project The Trunk:
> http://source.squeak.org/trunk/Tools-eem.817.mcz
>
> ==================== Summary ====================
>
> Name: Tools-eem.817
> Author: eem
> Time: 3 June 2018, 11:30:18.12214 am
> UUID: e29d1a74-c6b6-4752-b4d0-b735061f4c9f
> Ancestors: Tools-mt.816
>
> In the absence of proper support from RealEstateAgent and the tool builder, provide a memory of the debugger's last extent, and use it when opening a full debugger.
>
> =============== Diff against Tools-mt.816 ===============
>
> Item was changed:
>   CodeHolder subclass: #Debugger
>         instanceVariableNames: 'interruptedProcess interruptedController contextStack contextStackIndex contextStackList receiverInspector contextVariablesInspector externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject errorWasInUIProcess labelString message untilExpression'
> +       classVariableNames: 'ContextStackKeystrokes ErrorRecursion ErrorRecursionGuard ErrorReportServer InterruptUIProcessIfBlockedOnErrorInBackgroundProcess SavedExtent WantsAnnotationPane'
> -       classVariableNames: 'ContextStackKeystrokes ErrorRecursion ErrorRecursionGuard ErrorReportServer InterruptUIProcessIfBlockedOnErrorInBackgroundProcess WantsAnnotationPane'
>         poolDictionaries: ''
>         category: 'Tools-Debugger'!
>
>   !Debugger commentStamp: '<historical>' prior: 0!
>   I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.
>
>   Special note on recursive errors:
>   Some errors affect Squeak's ability to present a debugger.  This is normally an unrecoverable situation.  However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger.  Here is the chain of events in such a recovery.
>
>         * A recursive error is detected.
>         * The current project is queried for an isolationHead
>         * Changes in the isolationHead are revoked
>         * The parent project of isolated project is returned to
>         * The debugger is opened there and execution resumes.
>
>   If the user closes that debugger, execution continues in the outer project and layer.  If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world. !
>
> Item was changed:
>   ----- Method: Debugger>>buildFullWith: (in category 'toolbuilder') -----
>   buildFullWith: builder
>         | windowSpec listSpec textSpec |
>         windowSpec := builder pluggableWindowSpec new
>                 model: self;
>                 label: 'Debugger';
>                 children: OrderedCollection new.
> +       SavedExtent ifNotNil:
> +               [windowSpec extent: SavedExtent].
>
>         listSpec := builder pluggableListSpec new.
>         listSpec
>                 model: self;
>                 list: #contextStackList;
>                 getIndex: #contextStackIndex;
>                 setIndex: #toggleContextStackIndex:;
>                 menu: #contextStackMenu:shifted:;
>                 icon: #messageIconAt:;
>                 helpItem: #messageHelpAt:;
>                 keyPress: #contextStackKey:from:;
>                 frame: (0@0 corner: 1@0.22).
>         windowSpec children add: listSpec.
>
>
>         textSpec := self buildCodePaneWith: builder.
>         textSpec frame: (0@0.22corner: 1@0.8).
>         windowSpec children add: textSpec.
>
>         listSpec := builder pluggableListSpec new.
>         listSpec
>                 model: self receiverInspector;
>                 list: #fieldList;
>                 getIndex: #selectionIndex;
>                 setIndex: #toggleIndex:;
>                 menu: #fieldListMenu:;
>                 keyPress: #inspectorKey:from:;
>                 frame: (0@0.8 corner: 0.2@1);
>                 help: 'Receiver''s\Instance\Variables' withCRs.
>         windowSpec children add: listSpec.
>
>         textSpec := builder pluggableTextSpec new.
>         textSpec
>                 model: self receiverInspector;
>                 getText: #contents;
>                 setText: #accept:;
>                 help: '<- Select receiver''s field' translated;
>                 selection: #contentsSelection;
>                 menu: #codePaneMenu:shifted:;
>                 frame: (0.2@0.8 corner: 0.5@1).
>         windowSpec children add: textSpec.
>
>         listSpec := builder pluggableListSpec new.
>         listSpec
>                 model: self contextVariablesInspector;
>                 list: #fieldList;
>                 getIndex: #selectionIndex;
>                 setIndex: #toggleIndex:;
>                 menu: #fieldListMenu:;
>                 keyPress: #inspectorKey:from:;
>                 frame: (0.5@0.8 corner: 0.7@1);
>                 help: 'Other\Context\Bindings' withCRs.
>         windowSpec children add: listSpec.
>
>         textSpec := builder pluggableTextSpec new.
>         textSpec
>                 model: self contextVariablesInspector;
>                 getText: #contents;
>                 setText: #accept:;
>                 help: '<- Select context''s field' translated;
>                 selection: #contentsSelection;
>                 menu: #codePaneMenu:shifted:;
>                 frame: (0.7@0.8 corner: 1@1).
>         windowSpec children add: textSpec.
>
>         ^builder build: windowSpec!
>
> Item was changed:
>   ----- Method: Debugger>>windowIsClosing (in category 'initialize') -----
>   windowIsClosing
> +       "My window is being closed; if debugging save its extent.
> +        Clean up.  Restart the low space watcher."
> -       "My window is being closed; clean up. Restart the low space watcher."
>
> +       interruptedProcess ifNil: [^self].
> +       (self dependents detect: [:m| m isWindowForModel: self] ifNone: []) ifNotNil:
> +               [:topWindow| | isDebuggerNotNotifier |
> +                isDebuggerNotNotifier := self dependents anySatisfy: [:m| m isTextView].
> +                isDebuggerNotNotifier ifTrue:
> +                       [SavedExtent := topWindow extent]].
> -       interruptedProcess == nil ifTrue: [^ self].
>         interruptedProcess terminate.
>         interruptedProcess := nil.
>         interruptedController := nil.
>         contextStack := nil.
>         receiverInspector := nil.
>         contextVariablesInspector := nil.
> +       Smalltalk installLowSpaceWatcher  "restart low space handler"
> -       Smalltalk installLowSpaceWatcher.  "restart low space handler"
>   !
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-eem.817.mcz

David T. Lewis
On Tue, Jun 12, 2018 at 01:17:39PM -0500, Chris Muller wrote:
> Hey Eliot, this change doesn't seem to be working as designed.  I have
> no idea why, but my debugger keeps opening larger and larger every
> time, instead of the extent it was when it was last closed...

Hi Chris,

Can you say something about how to reproduce this condition? I understand
that there has been follow up discussion in another thread, but I do not
know how to recreate the problem.

I am guessing that it is related to preference settings, but I am not
sure which preferences might be involved.

Thanks!

Dave


>
> On Sun, Jun 3, 2018 at 1:30 PM <[hidden email]> wrote:
> >
> > Eliot Miranda uploaded a new version of Tools to project The Trunk:
> > http://source.squeak.org/trunk/Tools-eem.817.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Tools-eem.817
> > Author: eem
> > Time: 3 June 2018, 11:30:18.12214 am
> > UUID: e29d1a74-c6b6-4752-b4d0-b735061f4c9f
> > Ancestors: Tools-mt.816
> >
> > In the absence of proper support from RealEstateAgent and the tool builder, provide a memory of the debugger's last extent, and use it when opening a full debugger.
> >
> > =============== Diff against Tools-mt.816 ===============

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-eem.817.mcz

Chris Muller-4
Just try to make it work once, Dave!   Are you saying you tested it
and it worked for you?  I just restored all preferences to default,
and it still fails for me.

For goodness' sake, let me write out the most basic unit test script
one would use to test this..  Here:

  step 1)   3+4   "Command+Shift+D ---  debug it"
  step 2)   Size the debugger to one quarter the screen size.
  step 3)   Close the debugger opened in step 2.
  step 4)   3+4   "Command+Shift+D ---  debug it"
  step 5)   Verify the debugger is still exactly one quarter of the screen size.

I don't see the problem with Eliots code, but I've already wasted 30X
more time on this than the 5 minutes originally spent to slam it into
trunk and neuter the years-old RealEstateAgent.  On top of that, I'm
feeling majorly dis'ed.  I don't care to spend any more time trying to
find out why abusing the Listener pattern resulted in a bug, I'll let
you take it from here.

Have fun!    :/

 - Chris

On Tue, Jun 26, 2018 at 7:23 AM, David T. Lewis <[hidden email]> wrote:

> On Tue, Jun 12, 2018 at 01:17:39PM -0500, Chris Muller wrote:
>> Hey Eliot, this change doesn't seem to be working as designed.  I have
>> no idea why, but my debugger keeps opening larger and larger every
>> time, instead of the extent it was when it was last closed...
>
> Hi Chris,
>
> Can you say something about how to reproduce this condition? I understand
> that there has been follow up discussion in another thread, but I do not
> know how to recreate the problem.
>
> I am guessing that it is related to preference settings, but I am not
> sure which preferences might be involved.
>
> Thanks!
>
> Dave
>
>
>>
>> On Sun, Jun 3, 2018 at 1:30 PM <[hidden email]> wrote:
>> >
>> > Eliot Miranda uploaded a new version of Tools to project The Trunk:
>> > http://source.squeak.org/trunk/Tools-eem.817.mcz
>> >
>> > ==================== Summary ====================
>> >
>> > Name: Tools-eem.817
>> > Author: eem
>> > Time: 3 June 2018, 11:30:18.12214 am
>> > UUID: e29d1a74-c6b6-4752-b4d0-b735061f4c9f
>> > Ancestors: Tools-mt.816
>> >
>> > In the absence of proper support from RealEstateAgent and the tool builder, provide a memory of the debugger's last extent, and use it when opening a full debugger.
>> >
>> > =============== Diff against Tools-mt.816 ===============

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-eem.817.mcz

David T. Lewis
Yes, I am saying I tested it and it worked for me. I tried it several
times using self halt it a workspace. Debuggers consistently open with the
size as of the last one closed.

My working image is 64-bit spur that is kept up to date with trunk, and
that has various other packages loaded.

I'll try following your recipe exactly when I get home.

Dave

> Just try to make it work once, Dave!   Are you saying you tested it
> and it worked for you?  I just restored all preferences to default,
> and it still fails for me.
>
> For goodness' sake, let me write out the most basic unit test script
> one would use to test this..  Here:
>
>   step 1)   3+4   "Command+Shift+D ---  debug it"
>   step 2)   Size the debugger to one quarter the screen size.
>   step 3)   Close the debugger opened in step 2.
>   step 4)   3+4   "Command+Shift+D ---  debug it"
>   step 5)   Verify the debugger is still exactly one quarter of the screen
> size.
>
> I don't see the problem with Eliots code, but I've already wasted 30X
> more time on this than the 5 minutes originally spent to slam it into
> trunk and neuter the years-old RealEstateAgent.  On top of that, I'm
> feeling majorly dis'ed.  I don't care to spend any more time trying to
> find out why abusing the Listener pattern resulted in a bug, I'll let
> you take it from here.
>
> Have fun!    :/
>
>  - Chris
>
> On Tue, Jun 26, 2018 at 7:23 AM, David T. Lewis <[hidden email]>
> wrote:
>> On Tue, Jun 12, 2018 at 01:17:39PM -0500, Chris Muller wrote:
>>> Hey Eliot, this change doesn't seem to be working as designed.  I have
>>> no idea why, but my debugger keeps opening larger and larger every
>>> time, instead of the extent it was when it was last closed...
>>
>> Hi Chris,
>>
>> Can you say something about how to reproduce this condition? I
>> understand
>> that there has been follow up discussion in another thread, but I do not
>> know how to recreate the problem.
>>
>> I am guessing that it is related to preference settings, but I am not
>> sure which preferences might be involved.
>>
>> Thanks!
>>
>> Dave
>>
>>
>>>
>>> On Sun, Jun 3, 2018 at 1:30 PM <[hidden email]> wrote:
>>> >
>>> > Eliot Miranda uploaded a new version of Tools to project The Trunk:
>>> > http://source.squeak.org/trunk/Tools-eem.817.mcz
>>> >
>>> > ==================== Summary ====================
>>> >
>>> > Name: Tools-eem.817
>>> > Author: eem
>>> > Time: 3 June 2018, 11:30:18.12214 am
>>> > UUID: e29d1a74-c6b6-4752-b4d0-b735061f4c9f
>>> > Ancestors: Tools-mt.816
>>> >
>>> > In the absence of proper support from RealEstateAgent and the tool
>>> builder, provide a memory of the debugger's last extent, and use it
>>> when opening a full debugger.
>>> >
>>> > =============== Diff against Tools-mt.816 ===============
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Tools-eem.817.mcz

David T. Lewis
OK, following up now: I tried the test case exactly as Chris describes
below. The saved extents are working as expected.

However, I do now see one inconsistency. I have been closing the debugger
window using the red X "close this window" button to close the system
window.  In these cases, the SavedExtent works as expected - the next
debugger window uses the extent that was saved when I closed the previous
one.

But I notice now that if I proceed through the debugger so that the
debugger window closes after resuming the process, then the SavedExtent
is not updated.  I don't know if this is a bug or a feature, although I
could probably be convinced either way ;-)

Bottom line - I still cannot reproduce the problem that Chris originally
reported. The debugger window behavior seems fine to me in my working
trunk image.

Dave


On Tue, Jun 26, 2018 at 04:14:29PM -0400, David T. Lewis wrote:

> Yes, I am saying I tested it and it worked for me. I tried it several
> times using self halt it a workspace. Debuggers consistently open with the
> size as of the last one closed.
>
> My working image is 64-bit spur that is kept up to date with trunk, and
> that has various other packages loaded.
>
> I'll try following your recipe exactly when I get home.
>
> Dave
>
> > Just try to make it work once, Dave!   Are you saying you tested it
> > and it worked for you?  I just restored all preferences to default,
> > and it still fails for me.
> >
> > For goodness' sake, let me write out the most basic unit test script
> > one would use to test this..  Here:
> >
> >   step 1)   3+4   "Command+Shift+D ---  debug it"
> >   step 2)   Size the debugger to one quarter the screen size.
> >   step 3)   Close the debugger opened in step 2.
> >   step 4)   3+4   "Command+Shift+D ---  debug it"
> >   step 5)   Verify the debugger is still exactly one quarter of the screen
> > size.
> >
> > I don't see the problem with Eliots code, but I've already wasted 30X
> > more time on this than the 5 minutes originally spent to slam it into
> > trunk and neuter the years-old RealEstateAgent.  On top of that, I'm
> > feeling majorly dis'ed.  I don't care to spend any more time trying to
> > find out why abusing the Listener pattern resulted in a bug, I'll let
> > you take it from here.
> >
> > Have fun!    :/
> >
> >  - Chris
> >
> > On Tue, Jun 26, 2018 at 7:23 AM, David T. Lewis <[hidden email]>
> > wrote:
> >> On Tue, Jun 12, 2018 at 01:17:39PM -0500, Chris Muller wrote:
> >>> Hey Eliot, this change doesn't seem to be working as designed.  I have
> >>> no idea why, but my debugger keeps opening larger and larger every
> >>> time, instead of the extent it was when it was last closed...
> >>
> >> Hi Chris,
> >>
> >> Can you say something about how to reproduce this condition? I
> >> understand
> >> that there has been follow up discussion in another thread, but I do not
> >> know how to recreate the problem.
> >>
> >> I am guessing that it is related to preference settings, but I am not
> >> sure which preferences might be involved.
> >>
> >> Thanks!
> >>
> >> Dave
> >>
> >>
> >>>
> >>> On Sun, Jun 3, 2018 at 1:30 PM <[hidden email]> wrote:
> >>> >
> >>> > Eliot Miranda uploaded a new version of Tools to project The Trunk:
> >>> > http://source.squeak.org/trunk/Tools-eem.817.mcz
> >>> >
> >>> > ==================== Summary ====================
> >>> >
> >>> > Name: Tools-eem.817
> >>> > Author: eem
> >>> > Time: 3 June 2018, 11:30:18.12214 am
> >>> > UUID: e29d1a74-c6b6-4752-b4d0-b735061f4c9f
> >>> > Ancestors: Tools-mt.816
> >>> >
> >>> > In the absence of proper support from RealEstateAgent and the tool
> >>> builder, provide a memory of the debugger's last extent, and use it
> >>> when opening a full debugger.
> >>> >
> >>> > =============== Diff against Tools-mt.816 ===============
> >
> >
>
>
>