<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On 9/8/2010 1:54 AM, Andreas Raab wrote:
<blockquote cite="mid:4C8724FC.6070705@gmx.de" type="cite">On
9/7/2010 7:57 PM, David T. Lewis wrote:
<br>
<blockquote type="cite">I can't reproduce this. Are you able to
get a debugger to open under
<br>
MVC at this point?
<br>
</blockquote>
<br>
Yes. I would have posted this earlier but I had an unexpected
dinner and don't feel quite capable of doing this now (hick!).
<br>
<br>
<blockquote type="cite">Specifically, I changed Debugger
class>>openOn:context:label:contents:fullView:
<br>
to call #searchForActiveControllerNoTerminate, where
#searchForActiveControllerNoTerminate
<br>
is a copy of #searchForActiveController with the
#terminateActive removed.
<br>
I'm not seeing any difference in behavior, so I must be missing
a step
<br>
in the recipe.
<br>
</blockquote>
<br>
All right, I'm attaching the changes I have so far unreviewed.
With these changes I've been able to debug just fine except from
the case of handling a user interrupt which doesn't quite work
yet. If you want to try this out, give it a shot, if not, I'll try
to make headway tomorrow night. Right now I need some sleep :-)
<br>
<br>
Cheers,
<br>
- Andreas
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
</pre>
</blockquote>
<br>
I also did a little debugging, and I now think that the two main
issues are:<br>
1 the code to open the debugger is inside WorldState
addDeferredUiMessage: [], even for MVC, which will probably never
get executed<br>
2 MVCTooBuilder was supposed to openNoTerminate (not open, which
terminates the previous UI process) when called from the debugger
code<br>
<br>
With these two addressed, I get the debugger as well (but also not
from the user interrupt) - these are as hacks only (I named the
openNoTerminate methods in the ToolBuilders 'open1'), but I post
them as part of the conversation.<br>
I am not sure if these changes are identical to Andreas', but I also
have to go to bed now :)<br>
<br>
Florin<br>
<br>
<br>
<br>
'From Squeak4.1 of 17 April 2010 [latest update: #9957] on 8
September 2010 at 2:34:52 am'!<br>
<br>
!Debugger methodsFor: 'initialize' stamp: 'fm 9/8/2010 01:42'!<br>
openFullNoSuspendLabel: aString<br>
"Create and schedule a full debugger with the given label. Do
not terminate the current active process."<br>
<br>
| oldContextStackIndex |<br>
oldContextStackIndex := contextStackIndex.<br>
self expandStack. "Sets contextStackIndex to zero."<br>
ToolBuilder open1: self label: aString.<br>
self toggleContextStackIndex: oldContextStackIndex.! !<br>
<br>
!Debugger methodsFor: 'initialize' stamp: 'fm 9/8/2010 01:39'!<br>
openNotifierContents: msgString label: label<br>
"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."<br>
"NOTE: When this method returns, a new process has been
scheduled to run the windows, and thus this notifier, but the
previous active porcess has not been suspended. The sender will do
this."<br>
| msg builder spec |<br>
Sensor flushKeyboard.<br>
savedCursor := Sensor currentCursor.<br>
Sensor currentCursor: Cursor normal.<br>
(label beginsWith: 'Space is low')<br>
ifTrue: [msg := self lowSpaceChoices, (msgString ifNil:
[''])]<br>
ifFalse: [msg := msgString].<br>
builder := ToolBuilder default.<br>
spec := self buildNotifierWith: builder label: label message:
msg.<br>
self expandStack.<br>
builder open1: spec.<br>
errorWasInUIProcess := Project spawnNewProcessIfThisIsUI:
interruptedProcess.<br>
! !<br>
<br>
<br>
!Debugger class methodsFor: 'opening' stamp: 'fm 9/8/2010 02:02'!<br>
openOn: process context: context label: title contents:
contentsStringOrNil fullView: bool<br>
"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."<br>
<br>
| controller errorWasInUIProcess debugger |<br>
Smalltalk isMorphic<br>
ifTrue: [errorWasInUIProcess := Project
spawnNewProcessIfThisIsUI: process]<br>
ifFalse: [controller := ScheduledControllers
activeControllerProcess == process<br>
ifTrue: [ScheduledControllers activeController].<br>
debugger := self new process: process controller:
controller context: context.<br>
bool<br>
ifTrue: [debugger openFullNoSuspendLabel:
title]<br>
ifFalse: [debugger openNotifierContents:
contentsStringOrNil label: title]].<br>
WorldState addDeferredUIMessage: [ <br>
[<br>
debugger := self new process: process controller:
controller context: context.<br>
Smalltalk isMorphic<br>
ifTrue: ["schedule debugger in deferred UI message
to address redraw<br>
problems after opening a debugger e.g. from
the testrunner."<br>
"WorldState addDeferredUIMessage: "<br>
bool<br>
ifTrue: [debugger openFullNoSuspendLabel:
title]<br>
ifFalse: [debugger openNotifierContents:
contentsStringOrNil label: title]]<br>
ifFalse: ["deferred UI message would require special
controller in MVC"<br>
bool<br>
ifTrue: [debugger openFullNoSuspendLabel:
title]<br>
ifFalse: [debugger openNotifierContents:
contentsStringOrNil label: title]].<br>
debugger errorWasInUIProcess: errorWasInUIProcess.<br>
Preferences logDebuggerStackToFile ifTrue: [<br>
Smalltalk logError: title inContext: context to:
'SqueakDebug.log'].<br>
Smalltalk isMorphic<br>
ifFalse: [ScheduledControllers
searchForActiveController "needed since openNoTerminate (see
debugger #open...) does not set up activeControllerProcess if
activeProcess (this fork) is not the current activeControllerProcess
(see #scheduled:from:)"].<br>
] on: Error do: [:ex |<br>
self primitiveError: <br>
'Orginal error: ', <br>
title asString, '.<br>
Debugger error: ', <br>
([ex description] on: Error do: ['a ', ex class
printString]), ':'<br>
]<br>
].<br>
process suspend.<br>
! !<br>
<br>
<br>
!MVCToolBuilder methodsFor: 'opening' stamp: 'fm 9/8/2010 01:39'!<br>
open1: anObject<br>
"Build and open the object. Answer the widget opened."<br>
| window |<br>
window := self build: anObject.<br>
window controller openNoTerminate.<br>
^window! !<br>
<br>
!MVCToolBuilder methodsFor: 'opening' stamp: 'fm 9/8/2010 01:41'!<br>
open1: anObject label: aString<br>
"Build an open the object, labeling it appropriately. Answer
the widget opened."<br>
| window |<br>
window := self build: anObject.<br>
window label: aString.<br>
window controller openNoTerminate.<br>
^window! !<br>
<br>
!MVCToolBuilder methodsFor: 'opening' stamp: 'fm 9/8/2010 01:22'!<br>
open: anObject<br>
"Build and open the object. Answer the widget opened."<br>
| window |<br>
window := self build: anObject.<br>
window controller open.<br>
^window! !<br>
<br>
!MVCToolBuilder methodsFor: 'opening' stamp: 'fm 9/8/2010 01:23'!<br>
open: anObject label: aString<br>
"Build an open the object, labeling it appropriately. Answer
the widget opened."<br>
| window |<br>
window := self build: anObject.<br>
window label: aString.<br>
window controller open.<br>
^window! !<br>
<br>
<br>
!MorphicToolBuilder methodsFor: 'opening' stamp: 'fm 9/8/2010
01:39'!<br>
open1: anObject<br>
"Build and open the object. Answer the widget opened."<br>
| morph |<br>
anObject isMorph <br>
ifTrue:[morph := anObject]<br>
ifFalse:[morph := self build: anObject].<br>
(morph isKindOf: MenuMorph)<br>
ifTrue:[morph popUpInWorld: World].<br>
(morph isKindOf: SystemWindow)<br>
ifTrue:[morph openInWorldExtent: morph extent]<br>
ifFalse:[morph openInWorld].<br>
^morph! !<br>
<br>
!MorphicToolBuilder methodsFor: 'opening' stamp: 'fm 9/8/2010
01:41'!<br>
open1: anObject label: aString<br>
"Build an open the object, labeling it appropriately. Answer
the widget opened."<br>
| window |<br>
window := self open: anObject.<br>
window setLabel: aString.<br>
^window! !<br>
<br>
<br>
!ToolBuilder class methodsFor: 'accessing' stamp: 'fm 9/8/2010
02:28'!<br>
default: aToolBuilder<br>
"Set a new default tool builder"<br>
aToolBuilder isNil ifTrue: [Processor activeProcess debug].<br>
Default := aToolBuilder.! !<br>
<br>
!ToolBuilder class methodsFor: 'instance creation' stamp: 'fm
9/8/2010 02:10'!<br>
open1: aClass label: aString<br>
^self default open1: aClass label: aString! !<br>
<br>
<br>
</body>
</html>