Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.289.mcz
==================== Summary ====================
Name: Compiler-eem.289
Author: eem
Time: 6 October 2014, 11:58:50.62 am
UUID: 7d67c48c-4a2f-4445-83e8-1f8f931801e3
Ancestors: Compiler-eem.288
Fix doits in the codePane of a debugger opened from
another debugger. e.g. before this fix
1. debug 3+4.
2. in code pane of debugger #1 debug 4+5
3. in code pane of debugger #2 debug 5+6, boom.
The bug was that when the encoder creates temp names for temp vars in the debugged context, which
it does by creating messages to DoItIn:'s argument
'ThisContext', if this is a level 3 debug, then the
original expression would have a temp var called
'ThisContext' already and that would overwrite the
'ThisContext' argument for this level with a
message send, and boom.
The fix is merely to filter-out these temps and
hence never overwrite DoItIn:'s 'ThisContext'
argument in the scope table.
=============== Diff against Compiler-eem.288 ===============
Item was changed:
----- Method: Encoder>>init:notifying: (in category 'initialize-release') -----
init: aCue notifying: anObject
"The use of the variable requestor is a bit confusing here. This is
*not* the original requestor, which is available through the cue.
It's the Parser instance that is using the encoder."
self setCue: aCue.
requestor := anObject.
nTemps := 0.
supered := false.
self initScopeAndLiteralTables.
cue getClass variablesAndOffsetsDo:
[:variable "<String|CFieldDefinition>" :offset "<Integer|nil>" |
offset isNil
ifTrue: [scopeTable at: variable name put: (FieldNode new fieldDefinition: variable)]
ifFalse: [scopeTable
at: variable
put: (offset >= 0
ifTrue: [InstanceVariableNode new
name: variable index: offset]
ifFalse: [MaybeContextInstanceVariableNode new
name: variable index: offset negated])]].
cue context ~~ nil ifTrue:
[| homeNode |
homeNode := self bindTemp: self doItInContextName.
"0th temp = aContext passed as arg"
cue context tempNames withIndexDo:
[:variable :index|
+ variable ~= self doItInContextName ifTrue:
+ [scopeTable
+ at: variable
+ put: (MessageAsTempNode new
+ receiver: homeNode
+ selector: #namedTempAt:
+ arguments: (Array with: (self encodeLiteral: index))
+ precedence: 3
+ from: self)]]].
- scopeTable
- at: variable
- put: (MessageAsTempNode new
- receiver: homeNode
- selector: #namedTempAt:
- arguments: (Array with: (self encodeLiteral: index))
- precedence: 3
- from: self)]].
sourceRanges := Dictionary new: 32.
globalSourceRanges := OrderedCollection new: 32
!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.289.mcz
==================== Summary ====================
Name: Compiler-eem.289
Author: eem
Time: 6 October 2014, 11:58:50.62 am
UUID: 7d67c48c-4a2f-4445-83e8-1f8f931801e3
Ancestors: Compiler-eem.288
Fix doits in the codePane of a debugger opened from
another debugger. e.g. before this fix
1. debug 3+4.
2. in code pane of debugger #1 debug 4+5
3. in code pane of debugger #2 debug 5+6, boom.
The bug was that when the encoder creates temp names for temp vars in the debugged context, which
it does by creating messages to DoItIn:'s argument
'ThisContext', if this is a level 3 debug, then the
original expression would have a temp var called
'ThisContext' already and that would overwrite the
'ThisContext' argument for this level with a
message send, and boom.
The fix is merely to filter-out these temps and
hence never overwrite DoItIn:'s 'ThisContext'
argument in the scope table.
=============== Diff against Compiler-eem.288 ===============
Item was changed:
----- Method: Encoder>>init:notifying: (in category 'initialize-release') -----
init: aCue notifying: anObject
"The use of the variable requestor is a bit confusing here. This is
*not* the original requestor, which is available through the cue.
It's the Parser instance that is using the encoder."
self setCue: aCue.
requestor := anObject.
nTemps := 0.
supered := false.
self initScopeAndLiteralTables.
cue getClass variablesAndOffsetsDo:
[:variable "<String|CFieldDefinition>" :offset "<Integer|nil>" |
offset isNil
ifTrue: [scopeTable at: variable name put: (FieldNode new fieldDefinition: variable)]
ifFalse: [scopeTable
at: variable
put: (offset >= 0
ifTrue: [InstanceVariableNode new
name: variable index: offset]
ifFalse: [MaybeContextInstanceVariableNode new
name: variable index: offset negated])]].
cue context ~~ nil ifTrue:
[| homeNode |
homeNode := self bindTemp: self doItInContextName.
"0th temp = aContext passed as arg"
cue context tempNames withIndexDo:
[:variable :index|
+ variable ~= self doItInContextName ifTrue:
+ [scopeTable
+ at: variable
+ put: (MessageAsTempNode new
+ receiver: homeNode
+ selector: #namedTempAt:
+ arguments: (Array with: (self encodeLiteral: index))
+ precedence: 3
+ from: self)]]].
- scopeTable
- at: variable
- put: (MessageAsTempNode new
- receiver: homeNode
- selector: #namedTempAt:
- arguments: (Array with: (self encodeLiteral: index))
- precedence: 3
- from: self)]].
sourceRanges := Dictionary new: 32.
globalSourceRanges := OrderedCollection new: 32
!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.289.mcz
==================== Summary ====================
Name: Compiler-eem.289
Author: eem
Time: 6 October 2014, 11:58:50.62 am
UUID: 7d67c48c-4a2f-4445-83e8-1f8f931801e3
Ancestors: Compiler-eem.288
Fix doits in the codePane of a debugger opened from
another debugger. e.g. before this fix
1. debug 3+4.
2. in code pane of debugger #1 debug 4+5
3. in code pane of debugger #2 debug 5+6, boom.
The bug was that when the encoder creates temp names for temp vars in the debugged context, which
it does by creating messages to DoItIn:'s argument
'ThisContext', if this is a level 3 debug, then the
original expression would have a temp var called
'ThisContext' already and that would overwrite the
'ThisContext' argument for this level with a
message send, and boom.
The fix is merely to filter-out these temps and
hence never overwrite DoItIn:'s 'ThisContext'
argument in the scope table.
=============== Diff against Compiler-eem.288 ===============
Item was changed:
----- Method: Encoder>>init:notifying: (in category 'initialize-release') -----
init: aCue notifying: anObject
"The use of the variable requestor is a bit confusing here. This is
*not* the original requestor, which is available through the cue.
It's the Parser instance that is using the encoder."
self setCue: aCue.
requestor := anObject.
nTemps := 0.
supered := false.
self initScopeAndLiteralTables.
cue getClass variablesAndOffsetsDo:
[:variable "<String|CFieldDefinition>" :offset "<Integer|nil>" |
offset isNil
ifTrue: [scopeTable at: variable name put: (FieldNode new fieldDefinition: variable)]
ifFalse: [scopeTable
at: variable
put: (offset >= 0
ifTrue: [InstanceVariableNode new
name: variable index: offset]
ifFalse: [MaybeContextInstanceVariableNode new
name: variable index: offset negated])]].
cue context ~~ nil ifTrue:
[| homeNode |
homeNode := self bindTemp: self doItInContextName.
"0th temp = aContext passed as arg"
cue context tempNames withIndexDo:
[:variable :index|
+ variable ~= self doItInContextName ifTrue:
+ [scopeTable
+ at: variable
+ put: (MessageAsTempNode new
+ receiver: homeNode
+ selector: #namedTempAt:
+ arguments: (Array with: (self encodeLiteral: index))
+ precedence: 3
+ from: self)]]].
- scopeTable
- at: variable
- put: (MessageAsTempNode new
- receiver: homeNode
- selector: #namedTempAt:
- arguments: (Array with: (self encodeLiteral: index))
- precedence: 3
- from: self)]].
sourceRanges := Dictionary new: 32.
globalSourceRanges := OrderedCollection new: 32
!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.529.mcz
==================== Summary ====================
Name: Tools-eem.529
Author: eem
Time: 6 October 2014, 12:57:06.915 pm
UUID: 3c226418-51a9-4b8a-9edc-9015b15b27cb
Ancestors: Tools-cmm.528
Have Debugger>>openFullNoSuspendLabel: et al
answer the windows they create. Hence also change
Debugger class>>openInterrupt:onProcess: to answer
the debugger, not the window.
=============== Diff against Tools-cmm.528 ===============
Item was changed:
----- Method: Debugger class>>openInterrupt:onProcess: (in category 'opening') -----
openInterrupt: aString onProcess: interruptedProcess
"Open a notifier in response to an interrupt. An interrupt occurs when the user types the interrupt key (cmd-. on Macs, ctrl-c or alt-. on other systems) or when the low-space watcher detects that memory is low."
| debugger |
<primitive: 19> "Simulation guard"
debugger := self new.
debugger
process: interruptedProcess
controller: ((Smalltalk isMorphic not
and: [ScheduledControllers activeControllerProcess == interruptedProcess])
ifTrue: [ScheduledControllers activeController])
context: interruptedProcess suspendedContext.
debugger externalInterrupt: true.
Preferences logDebuggerStackToFile ifTrue:
[(aString includesSubString: 'Space') & (aString includesSubString: 'low')
ifTrue: [Smalltalk logError: aString inContext: debugger interruptedContext to: 'LowSpaceDebug.log']
"logging disabled for 4.3 release, see
http://lists.squeak.org/pipermail/squeak-dev/2011-December/162503.html"
"ifFalse: [Smalltalk logSqueakError: aString inContext: debugger interruptedContext]"].
Preferences eToyFriendly ifTrue: [World stopRunningAll].
+ ^debugger
+ openNotifierContents: nil label: aString;
+ yourself
- ^ debugger
- openNotifierContents: nil
- label: aString
!
Item was changed:
----- Method: Debugger>>openFullNoSuspendFrom: (in category 'initialize') -----
openFullNoSuspendFrom: topView
+ "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process."
- "Create and schedule a full debugger with the given label. Do not terminate the current active process."
| oldContextStackIndex |
oldContextStackIndex := contextStackIndex.
self expandStack. "Sets contextStackIndex to zero."
+ ^[ToolBuilder default openDebugger: self label: topView label closing: topView] ensure:
+ [self toggleContextStackIndex: oldContextStackIndex]!
- ToolBuilder default openDebugger: self label: topView label closing: topView.
- self toggleContextStackIndex: oldContextStackIndex.!
Item was changed:
----- Method: Debugger>>openFullNoSuspendLabel: (in category 'initialize') -----
openFullNoSuspendLabel: aString
+ "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process."
- "Create and schedule a full debugger with the given label. Do not terminate the current active process."
| oldContextStackIndex |
oldContextStackIndex := contextStackIndex.
self expandStack. "Sets contextStackIndex to zero."
+ ^[ToolBuilder default openDebugger: self label: aString] ensure:
+ [self toggleContextStackIndex: oldContextStackIndex]!
- ToolBuilder default openDebugger: self label: aString.
- self toggleContextStackIndex: oldContextStackIndex.!
Item was changed:
----- Method: Debugger>>openNotifierContents:label: (in category 'initialize') -----
openNotifierContents: msgString label: label
+ "Create, schedule and answer a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired."
- "Create and schedule a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired."
"NOTE: When this method returns, a new process has been scheduled to run the windows, and thus this notifier, but the previous active process has not been suspended. The sender will do this."
| msg builder spec |
Sensor flushKeyboard.
savedCursor := Cursor currentCursor.
Cursor currentCursor: Cursor normal.
(label beginsWith: 'Space is low')
ifTrue: [msg := self lowSpaceChoices, (msgString ifNil: [''])]
ifFalse: [msg := msgString].
builder := ToolBuilder default.
spec := self buildNotifierWith: builder label: label message: msg.
self expandStack.
+ ^[builder openDebugger: spec] ensure:
+ [errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: interruptedProcess]
- builder openDebugger: spec.
- errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: interruptedProcess.
!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.529.mcz
==================== Summary ====================
Name: Tools-eem.529
Author: eem
Time: 6 October 2014, 12:57:06.915 pm
UUID: 3c226418-51a9-4b8a-9edc-9015b15b27cb
Ancestors: Tools-cmm.528
Have Debugger>>openFullNoSuspendLabel: et al
answer the windows they create. Hence also change
Debugger class>>openInterrupt:onProcess: to answer
the debugger, not the window.
=============== Diff against Tools-cmm.528 ===============
Item was changed:
----- Method: Debugger class>>openInterrupt:onProcess: (in category 'opening') -----
openInterrupt: aString onProcess: interruptedProcess
"Open a notifier in response to an interrupt. An interrupt occurs when the user types the interrupt key (cmd-. on Macs, ctrl-c or alt-. on other systems) or when the low-space watcher detects that memory is low."
| debugger |
<primitive: 19> "Simulation guard"
debugger := self new.
debugger
process: interruptedProcess
controller: ((Smalltalk isMorphic not
and: [ScheduledControllers activeControllerProcess == interruptedProcess])
ifTrue: [ScheduledControllers activeController])
context: interruptedProcess suspendedContext.
debugger externalInterrupt: true.
Preferences logDebuggerStackToFile ifTrue:
[(aString includesSubString: 'Space') & (aString includesSubString: 'low')
ifTrue: [Smalltalk logError: aString inContext: debugger interruptedContext to: 'LowSpaceDebug.log']
"logging disabled for 4.3 release, see
http://lists.squeak.org/pipermail/squeak-dev/2011-December/162503.html"
"ifFalse: [Smalltalk logSqueakError: aString inContext: debugger interruptedContext]"].
Preferences eToyFriendly ifTrue: [World stopRunningAll].
+ ^debugger
+ openNotifierContents: nil label: aString;
+ yourself
- ^ debugger
- openNotifierContents: nil
- label: aString
!
Item was changed:
----- Method: Debugger>>openFullNoSuspendFrom: (in category 'initialize') -----
openFullNoSuspendFrom: topView
+ "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process."
- "Create and schedule a full debugger with the given label. Do not terminate the current active process."
| oldContextStackIndex |
oldContextStackIndex := contextStackIndex.
self expandStack. "Sets contextStackIndex to zero."
+ ^[ToolBuilder default openDebugger: self label: topView label closing: topView] ensure:
+ [self toggleContextStackIndex: oldContextStackIndex]!
- ToolBuilder default openDebugger: self label: topView label closing: topView.
- self toggleContextStackIndex: oldContextStackIndex.!
Item was changed:
----- Method: Debugger>>openFullNoSuspendLabel: (in category 'initialize') -----
openFullNoSuspendLabel: aString
+ "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process."
- "Create and schedule a full debugger with the given label. Do not terminate the current active process."
| oldContextStackIndex |
oldContextStackIndex := contextStackIndex.
self expandStack. "Sets contextStackIndex to zero."
+ ^[ToolBuilder default openDebugger: self label: aString] ensure:
+ [self toggleContextStackIndex: oldContextStackIndex]!
- ToolBuilder default openDebugger: self label: aString.
- self toggleContextStackIndex: oldContextStackIndex.!
Item was changed:
----- Method: Debugger>>openNotifierContents:label: (in category 'initialize') -----
openNotifierContents: msgString label: label
+ "Create, schedule and answer a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired."
- "Create and schedule a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired."
"NOTE: When this method returns, a new process has been scheduled to run the windows, and thus this notifier, but the previous active process has not been suspended. The sender will do this."
| msg builder spec |
Sensor flushKeyboard.
savedCursor := Cursor currentCursor.
Cursor currentCursor: Cursor normal.
(label beginsWith: 'Space is low')
ifTrue: [msg := self lowSpaceChoices, (msgString ifNil: [''])]
ifFalse: [msg := msgString].
builder := ToolBuilder default.
spec := self buildNotifierWith: builder label: label message: msg.
self expandStack.
+ ^[builder openDebugger: spec] ensure:
+ [errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: interruptedProcess]
- builder openDebugger: spec.
- errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: interruptedProcess.
!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.529.mcz
==================== Summary ====================
Name: Tools-eem.529
Author: eem
Time: 6 October 2014, 12:57:06.915 pm
UUID: 3c226418-51a9-4b8a-9edc-9015b15b27cb
Ancestors: Tools-cmm.528
Have Debugger>>openFullNoSuspendLabel: et al
answer the windows they create. Hence also change
Debugger class>>openInterrupt:onProcess: to answer
the debugger, not the window.
=============== Diff against Tools-cmm.528 ===============
Item was changed:
----- Method: Debugger class>>openInterrupt:onProcess: (in category 'opening') -----
openInterrupt: aString onProcess: interruptedProcess
"Open a notifier in response to an interrupt. An interrupt occurs when the user types the interrupt key (cmd-. on Macs, ctrl-c or alt-. on other systems) or when the low-space watcher detects that memory is low."
| debugger |
<primitive: 19> "Simulation guard"
debugger := self new.
debugger
process: interruptedProcess
controller: ((Smalltalk isMorphic not
and: [ScheduledControllers activeControllerProcess == interruptedProcess])
ifTrue: [ScheduledControllers activeController])
context: interruptedProcess suspendedContext.
debugger externalInterrupt: true.
Preferences logDebuggerStackToFile ifTrue:
[(aString includesSubString: 'Space') & (aString includesSubString: 'low')
ifTrue: [Smalltalk logError: aString inContext: debugger interruptedContext to: 'LowSpaceDebug.log']
"logging disabled for 4.3 release, see
http://lists.squeak.org/pipermail/squeak-dev/2011-December/162503.html"
"ifFalse: [Smalltalk logSqueakError: aString inContext: debugger interruptedContext]"].
Preferences eToyFriendly ifTrue: [World stopRunningAll].
+ ^debugger
+ openNotifierContents: nil label: aString;
+ yourself
- ^ debugger
- openNotifierContents: nil
- label: aString
!
Item was changed:
----- Method: Debugger>>openFullNoSuspendFrom: (in category 'initialize') -----
openFullNoSuspendFrom: topView
+ "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process."
- "Create and schedule a full debugger with the given label. Do not terminate the current active process."
| oldContextStackIndex |
oldContextStackIndex := contextStackIndex.
self expandStack. "Sets contextStackIndex to zero."
+ ^[ToolBuilder default openDebugger: self label: topView label closing: topView] ensure:
+ [self toggleContextStackIndex: oldContextStackIndex]!
- ToolBuilder default openDebugger: self label: topView label closing: topView.
- self toggleContextStackIndex: oldContextStackIndex.!
Item was changed:
----- Method: Debugger>>openFullNoSuspendLabel: (in category 'initialize') -----
openFullNoSuspendLabel: aString
+ "Create, schedule and answer a full debugger with the given label. Do not terminate the current active process."
- "Create and schedule a full debugger with the given label. Do not terminate the current active process."
| oldContextStackIndex |
oldContextStackIndex := contextStackIndex.
self expandStack. "Sets contextStackIndex to zero."
+ ^[ToolBuilder default openDebugger: self label: aString] ensure:
+ [self toggleContextStackIndex: oldContextStackIndex]!
- ToolBuilder default openDebugger: self label: aString.
- self toggleContextStackIndex: oldContextStackIndex.!
Item was changed:
----- Method: Debugger>>openNotifierContents:label: (in category 'initialize') -----
openNotifierContents: msgString label: label
+ "Create, schedule and answer a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired."
- "Create and schedule a notifier view with the given label and message. A notifier view shows just the message or the first several lines of the stack, with a menu that allows the user to open a full debugger if so desired."
"NOTE: When this method returns, a new process has been scheduled to run the windows, and thus this notifier, but the previous active process has not been suspended. The sender will do this."
| msg builder spec |
Sensor flushKeyboard.
savedCursor := Cursor currentCursor.
Cursor currentCursor: Cursor normal.
(label beginsWith: 'Space is low')
ifTrue: [msg := self lowSpaceChoices, (msgString ifNil: [''])]
ifFalse: [msg := msgString].
builder := ToolBuilder default.
spec := self buildNotifierWith: builder label: label message: msg.
self expandStack.
+ ^[builder openDebugger: spec] ensure:
+ [errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: interruptedProcess]
- builder openDebugger: spec.
- errorWasInUIProcess := Project current spawnNewProcessIfThisIsUI: interruptedProcess.
!
Eliot Miranda uploaded a new version of ToolBuilder-Kernel to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Kernel-eem.63.mcz
==================== Summary ====================
Name: ToolBuilder-Kernel-eem.63
Author: eem
Time: 6 October 2014, 12:46:57.26 pm
UUID: 2a80d908-62c0-4502-92a2-cd3a15f90f3c
Ancestors: ToolBuilder-Kernel-mt.62
The method that opens a debugger does need to
answer the window created, as its comment says.
=============== Diff against ToolBuilder-Kernel-mt.62 ===============
Item was changed:
----- Method: ToolBuilder>>openDebugger:label: (in category 'opening') -----
openDebugger: aSpec label: aString
"Build and open a debugger from the given spec, labeling it appropriately.
Answer the widget opened. Subclasses can override this
method if opening a debugger has specific requirements
different from opening other widgets."
+ ^self open: aSpec label: aString
- self open: aSpec label: aString
!