Opening two debuggers in a single doit

Opening two debuggers in a single doit

Hi All,

I'm comparing two close copies of a class in attempting a complex refactoring, comparing the original code with the close copy. In doing this I need to open up two debuggers to step through the two computations simultaneously. If I try it this way, where the two JITs break at a particular bytecode:

[:m :opts|

[StackToRegisterMappingCogit cog: m options: opts] fork.

Processor yield.

AltStackToRegisterMappingCogit cog: m options: opts]

value: TabbedPalette class>>#unload

value: #(ObjectMemory Spur64BitCoMemoryManager

debugBytecodePointers #(59)

compilationTrace 0).

I get an emergency evaluator :-(, and if I type restart I only ever get one debugger. What's the right way to do this?

To boil down the example I need this to work:

[1 halt] fork.

Processor yield.

2 halt

i.e. I want to be able to get two debuggers, one open on 1 halt, and the other on 2 halt.

Re: Opening two debuggers in a single doit

I tried this in 5.1 and it worked

Debugger class>>

morphicOpenOn: process context: context
label: title contents: contentsStringOrNil fullView: full
"Open a notifier in response to an error, halt, or notify. A
notifier view just shows a short view of the sender stack and
provides a menu that lets the user open a full debugger."

I'm comparing two close copies of a class in attempting
a complex refactoring, comparing the original code with the
close copy. In doing this I need to open up two debuggers to
step through the two computations simultaneously. If I try it
this way, where the two JITs break at a particular bytecode:

[:m :opts|

[StackToRegisterMappingCogit cog: m options: opts] fork.

Processor yield.

AltStackToRegisterMappingCogit cog: m options: opts]

value:
TabbedPalette class>>#unload

value:
#(ObjectMemory Spur64BitCoMemoryManager

debugBytecodePointers
#(59)

compilationTrace
0).

I get an emergency evaluator :-(, and if I type restart I
only ever get one debugger. What's the right way to do this?

To boil down the example I need this to work:

[1 halt] fork.

Processor yield.

2 halt

i.e. I want to be able to get two debuggers, one open on 1
halt, and the other on 2 halt.

Re: Opening two debuggers in a single doit

I'm comparing two close copies of a class in attempting
a complex refactoring, comparing the original code with the
close copy. In doing this I need to open up two debuggers to
step through the two computations simultaneously. If I try it
this way, where the two JITs break at a particular bytecode:

[:m :opts|

[StackToRegisterMappingCogit cog: m options: opts] fork.

Processor yield.

AltStackToRegisterMappingCogit cog: m options: opts]

value:
TabbedPalette class>>#unload

value:
#(ObjectMemory Spur64BitCoMemoryManager

debugBytecodePointers
#(59)

compilationTrace
0).

I get an emergency evaluator :-(, and if I type restart I
only ever get one debugger. What's the right way to do this?

To boil down the example I need this to work:

[1 halt] fork.

Processor yield.

2 halt

i.e. I want to be able to get two debuggers, one open on 1
halt, and the other on 2 halt.

Re: Opening two debuggers in a single doit

thank you!! morphicOpenOn:context:label:contents:fullView: is indeed the method in question. So if one moves the ErrorRecursion := false outside of the addDeferredUIMessage: block everything works. i.e. now the code reads:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely].

ErrorRecursion := false ].

and the old code doesn't work:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely.

ErrorRecursion := false ]].

So there question is, what are the tests for the ErrorGuard and ErrorRecursion? I need to run these before committing the fix above.

morphicOpenOn: process context: context
label: title contents: contentsStringOrNil fullView: full
"Open a notifier in response to an error, halt, or notify. A
notifier view just shows a short view of the sender stack and
provides a menu that lets the user open a full debugger."

I'm comparing two close copies of a class in attempting
a complex refactoring, comparing the original code with the
close copy. In doing this I need to open up two debuggers to
step through the two computations simultaneously. If I try it
this way, where the two JITs break at a particular bytecode:

[:m :opts|

[StackToRegisterMappingCogit cog: m options: opts] fork.

Processor yield.

AltStackToRegisterMappingCogit cog: m options: opts]

value:
TabbedPalette class>>#unload

value:
#(ObjectMemory Spur64BitCoMemoryManager

debugBytecodePointers
#(59)

compilationTrace
0).

I get an emergency evaluator :-(, and if I type restart I
only ever get one debugger. What's the right way to do this?

To boil down the example I need this to work:

[1 halt] fork.

Processor yield.

2 halt

i.e. I want to be able to get two debuggers, one open on 1
halt, and the other on 2 halt.

Re: Opening two debuggers in a single doit

While we’re fixing that it might be a good idea to get rid of (or otherwise fix) Debugger class>>#morphicOpenContext:label:contents: There are no senders in the image, it uses a simulation guard prim, it generally looks like a partial version of morphicOpenOn:context:label:contents:fullView: that got abandoned.

Re: Opening two debuggers in a single doit

> On 25.01.2018, at 01:20, tim Rowledge <[hidden email]> wrote:
>
>
>> On 24-01-2018, at 4:05 PM, Eliot Miranda <[hidden email]> wrote:
>>
>> Bob,
>>
>> thank you!! morphicOpenOn:context:label:contents:fullView: is indeed the method in question.
>
> While we’re fixing that it might be a good idea to get rid of (or otherwise fix) Debugger class>>#morphicOpenContext:label:contents: There are no senders in the image, it uses a simulation guard prim, it generally looks like a partial version of morphicOpenOn:context:label:contents:fullView: that got abandoned.
>

Hold your horses :D
It _is_ sent, indirectly, via:

openContext: aContext label: aString contents: contentsStringOrNil
"Open a notifier in response to an error, halt, or notify. A notifier view just shows a short view of the sender stack and provides a menu that lets the user open a full debugger."

The original #flag: methods were in Project>>dispatchTo:addPrefixAndSend:withArguments:
and the replacement mechanism is to use <hasLiteralTest: #isDispatchSelector:
to identify the target methods. I guess I left this one out when I converted to
the (much nicer) pragmas.

>
> Good grief. What an excellent way to confuse our tools. Most definitely not a technique I???d ever suggest teaching.

Indeed, please do not include this in your curriculum.

I felt badly about inventing this in the first place, but it was the best
I could come up with, and I checked with Andreas and he said that it was
not too horrible, so we went with it.

thank you!! morphicOpenOn:context:label:contents:fullView: is indeed the method in question. So if one moves the ErrorRecursion := false outside of the addDeferredUIMessage: block everything works. i.e. now the code reads:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely].

ErrorRecursion := false ].

and the old code doesn't work:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely.

ErrorRecursion := false ]].

So there question is, what are the tests for the ErrorGuard and ErrorRecursion? I need to run these before committing the fix above.

morphicOpenOn: process context: context
label: title contents: contentsStringOrNil fullView: full
"Open a notifier in response to an error, halt, or notify. A
notifier view just shows a short view of the sender stack and
provides a menu that lets the user open a full debugger."

I'm comparing two close copies of a class in attempting
a complex refactoring, comparing the original code with the
close copy. In doing this I need to open up two debuggers to
step through the two computations simultaneously. If I try it
this way, where the two JITs break at a particular bytecode:

[:m :opts|

[StackToRegisterMappingCogit cog: m options: opts] fork.

Processor yield.

AltStackToRegisterMappingCogit cog: m options: opts]

value:
TabbedPalette class>>#unload

value:
#(ObjectMemory Spur64BitCoMemoryManager

debugBytecodePointers
#(59)

compilationTrace
0).

I get an emergency evaluator :-(, and if I type restart I
only ever get one debugger. What's the right way to do this?

To boil down the example I need this to work:

[1 halt] fork.

Processor yield.

2 halt

i.e. I want to be able to get two debuggers, one open on 1
halt, and the other on 2 halt.

thank you!! morphicOpenOn:context:label:contents:fullView: is indeed the method in question. So if one moves the ErrorRecursion := false outside of the addDeferredUIMessage: block everything works. i.e. now the code reads:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely].

ErrorRecursion := false ].

and the old code doesn't work:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely.

ErrorRecursion := false ]].

So there question is, what are the tests for the ErrorGuard and ErrorRecursion? I need to run these before committing the fix above.

morphicOpenOn: process context: context
label: title contents: contentsStringOrNil fullView: full
"Open a notifier in response to an error, halt, or notify. A
notifier view just shows a short view of the sender stack and
provides a menu that lets the user open a full debugger."

I'm comparing two close copies of a class in attempting
a complex refactoring, comparing the original code with the
close copy. In doing this I need to open up two debuggers to
step through the two computations simultaneously. If I try it
this way, where the two JITs break at a particular bytecode:

[:m :opts|

[StackToRegisterMappingCogit cog: m options: opts] fork.

Processor yield.

AltStackToRegisterMappingCogit cog: m options: opts]

value:
TabbedPalette class>>#unload

value:
#(ObjectMemory Spur64BitCoMemoryManager

debugBytecodePointers
#(59)

compilationTrace
0).

I get an emergency evaluator :-(, and if I type restart I
only ever get one debugger. What's the right way to do this?

To boil down the example I need this to work:

[1 halt] fork.

Processor yield.

2 halt

i.e. I want to be able to get two debuggers, one open on 1
halt, and the other on 2 halt.

thank you!! morphicOpenOn:context:label:contents:fullView: is indeed the method in question. So if one moves the ErrorRecursion := false outside of the addDeferredUIMessage: block everything works. i.e. now the code reads:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely].

ErrorRecursion := false ].

and the old code doesn't work:

Project current addDeferredUIMessage:

[ debugger := self new

process: process

controller: nil

context: context.

full

ifTrue: [ debugger openFullNoSuspendLabel: title ]

ifFalse:

[ debugger

openNotifierContents: contentsStringOrNil

label: title ].

debugger errorWasInUIProcess: errorWasInUIProcess.

"Try drawing the debugger tool at least once to avoid freeze."

Project current world displayWorldSafely.

ErrorRecursion := false ]].

So there question is, what are the tests for the ErrorGuard and ErrorRecursion? I need to run these before committing the fix above.

morphicOpenOn: process context: context
label: title contents: contentsStringOrNil fullView: full
"Open a notifier in response to an error, halt, or notify. A
notifier view just shows a short view of the sender stack and
provides a menu that lets the user open a full debugger."

I'm comparing two close copies of a class in attempting
a complex refactoring, comparing the original code with the
close copy. In doing this I need to open up two debuggers to
step through the two computations simultaneously. If I try it
this way, where the two JITs break at a particular bytecode:

[:m :opts|

[StackToRegisterMappingCogit cog: m options: opts] fork.

Processor yield.

AltStackToRegisterMappingCogit cog: m options: opts]

value:
TabbedPalette class>>#unload

value:
#(ObjectMemory Spur64BitCoMemoryManager

debugBytecodePointers
#(59)

compilationTrace
0).

I get an emergency evaluator :-(, and if I type restart I
only ever get one debugger. What's the right way to do this?

To boil down the example I need this to work:

[1 halt] fork.

Processor yield.

2 halt

i.e. I want to be able to get two debuggers, one open on 1
halt, and the other on 2 halt.

Re: Opening two debuggers in a single doit

On Thu, Jan 25, 2018 at 05:00:01PM +0100, Bert Freudenberg wrote:

> On 25 January 2018 at 02:51, David T. Lewis <[hidden email]> wrote:
> > On Wed, Jan 24, 2018 at 04:35:11PM -0800, Chris Cunningham wrote:
> >
> > See the method comment in #dispatchTo:addPrefixAndSend:withArguments:
> >
> > The mechanism is this pragma:
> >
> > <hasLiteralTest: #isDispatchSelector:>
> >
> > Implementation is in Project class>>isDispatchSelector: which identifies
> > the
> > target selectors. Apparently I left one of the selectors out of the list,
> > hence the confusion here.
> >
>
> ???See if you like what I put in System-bf.997, and if so, move it from Inbox
> to Trunk????
>
> Gets rid of the hard-coded list, but might have a few false positives.
>