The Trunk: System-mt.1222.mcz

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

The Trunk: System-mt.1222.mcz

commits-2
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1222.mcz

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

Name: System-mt.1222
Author: mt
Time: 15 March 2021, 11:20:11.977586 am
UUID: 6148616b-707b-654f-8306-990a1e3f3bf6
Ancestors: System-mt.1221

Complements Kernel-mt.1381

Fixes for debugger invocation during code simulation. See  http://forum.world.st/Please-try-out-Fixes-for-debugger-invocation-during-code-simulation-td5127684.html

=============== Diff against System-mt.1221 ===============

Item was changed:
  ----- Method: Process>>debug (in category '*System-debugging') -----
  debug
+ "See the comment in #debugWithTitle:full:contents:."
 
+ ^ self debugWithTitle: nil!
- ^ self debugWithTitle: 'Debug'!

Item was removed:
- ----- Method: Process>>debug: (in category '*System-debugging') -----
- debug: context
-
- ^ self debug: context title: 'Debug'!

Item was removed:
- ----- Method: Process>>debug:title: (in category '*System-debugging') -----
- debug: context title: title
- "Open debugger on self with context shown on top"
-
- ^ self debug: context title: title full: false
- !

Item was removed:
- ----- Method: Process>>debug:title:full: (in category '*System-debugging') -----
- debug: context title: title full: bool
-
- ^ self
- debug: context
- title: title
- full: bool
- contents: nil!

Item was removed:
- ----- Method: Process>>debug:title:full:contents: (in category '*System-debugging') -----
- debug: context title: title full: bool contents: contents
- "Open debugger on self with context shown on top"
-
- | topCtxt |
- topCtxt := self isActiveProcess ifTrue: [thisContext] ifFalse: [self suspendedContext].
- (topCtxt hasContext: context) ifFalse: [^ self error: 'context not in process'].
- ^ ToolSet debugProcess: self context: context label: title contents: contents fullView: bool!

Item was changed:
  ----- Method: Process>>debugWithTitle: (in category '*System-debugging') -----
  debugWithTitle: title
+ "See the comment in #debugWithTitle:full:contents:."
 
  ^ self debugWithTitle: title full: true!

Item was changed:
  ----- Method: Process>>debugWithTitle:full: (in category '*System-debugging') -----
  debugWithTitle: title full: aBoolean
+ "See the comment in #debugWithTitle:full:contents:."
 
  ^ self debugWithTitle: title full: aBoolean contents: nil!

Item was changed:
  ----- Method: Process>>debugWithTitle:full:contents: (in category '*System-debugging') -----
  debugWithTitle: title full: bool contents: contents
+ "BEWARE!! Open a debugger on the receiver, which must neither be running nor be simulated. Examples include workspace do-its, test execution, and helper processes. If you want to begin with a certain context, use #runUntil: before calling to here.
+
+ [ 3 + 4 ] newProcess debug.
+ (Process forBlock: [ 3 + 4 ]) debug.
+
+ Note that for debugging the currently running process, which might currently simulate the receiver, use ProcessorScheduler >> #debugWithTitle:.
+
+ (IMPLEMENTATION NOTE: The debugger interface is capable of debugging the active process correctly. However, unconditionally sending debug messages to the active process, in the past, led to a very tedious number of infinite debugger chains in an edge case when the effectiveProcess differs from the genuineProcess being executed by the VM (see ProcessorScheduler >> #activeProcess). This edge case occurs when a debugger is raised while another process is being simulated (aka process-faithful debugging, see #evaluate:onBehalfOf:), so at the very least Kernel methods should never send this message to the active process. For more information, see  http://forum.world.st/I-broke-the-debugger-td5110752.html)"
- "Automatically choose the top context."
 
+ self assert: [self suspendedContext notNil "= not running"].
+ self assert: [self isActiveProcess not "= not even simulated"].
+
+ ^ ToolSet
+ debugProcess: self
+ context: self suspendedContext
+ label: title
+ contents: contents
+ fullView: bool!
- ^ self
- debug: (self isActiveProcess ifTrue: [thisContext] ifFalse: [self suspendedContext])
- title: title
- full: bool
- contents: contents!

Item was added:
+ ----- Method: ProcessorScheduler>>debugContext:title:full:contents: (in category '*System-Applications-debugging') -----
+ debugContext: aContext title: title full: aBoolean contents: contents
+ "Open a debugger on the currently running (i.e. genuine) process. Note that that process might actually simulate another process, which ends up here by checking #isActiveProcess. If no code simulation is involved, the genuine process will be suspended along the way -- and hopefully replaced to keep the system responsive. For the simulated case, an existing debugger should take over and leave the genuine process running, that is, simulating. Examples include (a) handling unhandled errors in a tool set and (b) introspecting thisContext to reveal dialog invocation.
+
+ Processor debugWithTitle: 'Debug' full: false contents: 'Carpe Squeak!!'
+
+ Note that, outside code simulation, suspended processes can be debugged directly via Process >> #debugWithTitle:. "
+
+ self assert: [thisContext hasSender: aContext].
+
+ ^ ToolSet
+ debugProcess: genuineProcess
+ context: aContext
+ label: title
+ contents: contents
+ fullView: aBoolean!

Item was added:
+ ----- Method: ProcessorScheduler>>debugContextThat:title: (in category '*System-Applications-debugging') -----
+ debugContextThat: aBlock title: title
+ "See the comment in #debugContext:title:full:contents:."
+
+ ^ self
+ debugContext: (thisContext sender findContextSuchThat: aBlock)
+ title: title
+ full: true
+ contents: nil!

Item was added:
+ ----- Method: ProcessorScheduler>>debugContextThat:title:full: (in category '*System-Applications-debugging') -----
+ debugContextThat: aBlock title: title full: aBoolean
+ "See the comment in #debugContext:title:full:contents:."
+
+ ^ self
+ debugContext: (thisContext sender findContextSuchThat: aBlock)
+ title: title
+ full: aBoolean
+ contents: nil!

Item was added:
+ ----- Method: ProcessorScheduler>>debugContextThat:title:full:contents: (in category '*System-Applications-debugging') -----
+ debugContextThat: aBlock title: title full: aBoolean contents: contents
+ "See the comment in #debugContext:title:full:contents:."
+
+ ^ self
+ debugContext: (thisContext sender findContextSuchThat: aBlock)
+ title: title
+ full: aBoolean
+ contents: contents!

Item was added:
+ ----- Method: ProcessorScheduler>>debugWithTitle: (in category '*System-Applications-debugging') -----
+ debugWithTitle: title
+ "See the comment in #debugContext:title:full:contents:."
+
+ ^ self
+ debugContext: thisContext sender
+ title: title
+ full: true
+ contents: nil!

Item was added:
+ ----- Method: ProcessorScheduler>>debugWithTitle:full: (in category '*System-Applications-debugging') -----
+ debugWithTitle: title full: aBoolean
+ "See the comment in #debugContext:title:full:contents:."
+
+ ^ self
+ debugContext: thisContext sender
+ title: title
+ full: aBoolean
+ contents: nil!

Item was added:
+ ----- Method: ProcessorScheduler>>debugWithTitle:full:contents: (in category '*System-Applications-debugging') -----
+ debugWithTitle: title full: aBoolean contents: contents
+ "See the comment in #debugContext:title:full:contents:."
+
+ ^ self
+ debugContext: thisContext sender
+ title: title
+ full: aBoolean
+ contents: contents!

Item was changed:
  ----- Method: ToolSet class>>debugProcess:context:label:contents:fullView: (in category 'debugging') -----
  debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool
+ "Open a debugger on the given process, which might be active, suspended, or terminated. You can also use the convenience protocol for debugging on Process and ProcessorScheduler. NOTE that you should not pass Processor activeProcess directly to this method. Always use the indirection via ProcessorScheduler >>#debug... See also the comment in Process >> #debugWithTitle:full:contents:."
- "Open a debugger on the given process, which might be active, suspended, or terminated."
 
  ^ self default
+ ifNil: [(self confirm: 'Debugger request -- proceed?' translated) ifFalse: [Processor terminateActive]]
- ifNil: [(self confirm: 'Debugger request -- proceed?') ifFalse: [Processor terminateActive]]
  ifNotNil: [:ts | ts debugProcess: aProcess context: aContext label: aString contents: contents fullView: aBool]!

Item was changed:
  ----- Method: WrappedBreakpoint>>run:with:in: (in category 'evaluation') -----
  run: aSelector with: anArray in: aReceiver
  | process |
  process := Process
  forContext: (Context
  sender: thisContext sender
  receiver: aReceiver
  method: method
  arguments: anArray)
  priority: Processor activeProcess priority.
+ process
+ debugWithTitle:  'Breakpoint in ' , method methodClass name , '>>#' , method selector.
- ToolSet
- debugProcess: process
- context: process suspendedContext
- label:  'Breakpoint in ' , method methodClass name , '>>#' , method selector
- contents: nil
- fullView: true.
  Project current spawnNewProcessIfThisIsUI: Processor activeProcess.
  thisContext swapSender: nil.
  Processor activeProcess terminate!