Open Debugger, Save and Quit
In a headless image, I'd like to do the following: if there's any error, arrange to have a debugger open on the next (headful) launch, and then save and quit. I'm drawing a blank - how would I do that? I explored various dead ends, the culmination of which was the image-breaking: actualWorkBlock on: Error do: [ [ Smalltalk snapshot: true andQuit: true ] fork. Halt now ] Thanks! ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
On Wed, Nov 8, 2017 at 10:16 AM, Sean P. DeNigris <sean@clipperadams.com> wrote:
In a headless image, I'd like to do the following: if there's any error, arrange to have a debugger open on the next (headful) launch, and then save and quit.
I'm drawing a blank - how would I do that?
I explored various dead ends, the culmination of which was the image-breaking: actualWorkBlock on: Error do: [ [ Smalltalk snapshot: true andQuit: true ] fork. Halt now ]
Thanks!
Sorry not a solution, but you sparked a side-thought... To avoid sometimes being swamped by Pre-Debug windows. Instead of an error bringing up an individual Pre-Debug window, we could have error go into a queue which a singleton Pre-Debug window could have a view into. This "Error Queue Viewer" would have on row per error, and you click on a row to open a normal debugger, much like you click <Debug> button in the existing Pre-Debug window. In a headless image, the Error Queue Viewer would not appear, but the error would keep being queued until the next time the Error Queue Viewer is manually opened. The same error-queue might provide a similar interface point for Pharo Remote Tools, so you can see errors that occurred while you were not connected. cheers -ben
Some of this can be seen in VA Smalltalk. Errors during start up are captured and can be debugged after the start up has completed. The idea of an Error Queue Viewer is a nice touch, along with the possibility of remote debugging. On Nov 7, 2017 6:55 PM, "Ben Coman" <btc@openinworld.com> wrote: On Wed, Nov 8, 2017 at 10:16 AM, Sean P. DeNigris <sean@clipperadams.com> wrote:
In a headless image, I'd like to do the following: if there's any error, arrange to have a debugger open on the next (headful) launch, and then save and quit.
I'm drawing a blank - how would I do that?
I explored various dead ends, the culmination of which was the image-breaking: actualWorkBlock on: Error do: [ [ Smalltalk snapshot: true andQuit: true ] fork. Halt now ]
Thanks!
Sorry not a solution, but you sparked a side-thought... To avoid sometimes being swamped by Pre-Debug windows. Instead of an error bringing up an individual Pre-Debug window, we could have error go into a queue which a singleton Pre-Debug window could have a view into. This "Error Queue Viewer" would have on row per error, and you click on a row to open a normal debugger, much like you click <Debug> button in the existing Pre-Debug window. In a headless image, the Error Queue Viewer would not appear, but the error would keep being queued until the next time the Error Queue Viewer is manually opened. The same error-queue might provide a similar interface point for Pharo Remote Tools, so you can see errors that occurred while you were not connected. cheers -ben
Sean P. DeNigris wrote
In a headless image, I'd like to do the following: if there's any error, arrange to have a debugger open on the next (headful) launch, and then save and quit.
Bump :) I can't believe no one knows how to do this! ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Hi Sean - not sure if this is exactly what you are after, but there is a method in the debugger that is invoked when you need to debug, you can override this and Fuel out the debug context to a file (or I guess even a variable in the image if you are also saving the image when it gets an error). When the the image relaunches in a headful state you could check if that file exists (or variable is not null) and then open a debugger on the Fueled back in state? Marianoâs article gave me all of the hints for doing something like this for PharoLamda - (although I am reading the file from S3 and then creating the debugger in a different image) - but I could imagine you doing this for what you want? If you need specific code I can dig it out for you tonight. Tim
On 12 Nov 2017, at 23:15, Sean P. DeNigris <sean@clipperadams.com> wrote:
Sean P. DeNigris wrote
In a headless image, I'd like to do the following: if there's any error, arrange to have a debugger open on the next (headful) launch, and then save and quit.
Bump :) I can't believe no one knows how to do this!
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
I do something similar, in my WAHtmlHaltAndErrorHandler subclass fuelOutException: exception | filename context | filename := 't3-seaside-exception-{1}.fuel' format: { ZTimestamp now format: '20010203T160506' }. context := exception signalerContext. [ FuelOutStackDebugAction serializeTestFailureContext: context toFileNamed: filename ] on: Error do: [ ] But like Tim says, it works via a .fuel file, it does not change the image state. You then open the .fuel file in a similar image.
On 13 Nov 2017, at 15:48, Tim Mackinnon <tim@testit.works> wrote:
Hi Sean - not sure if this is exactly what you are after, but there is a method in the debugger that is invoked when you need to debug, you can override this and Fuel out the debug context to a file (or I guess even a variable in the image if you are also saving the image when it gets an error). When the the image relaunches in a headful state you could check if that file exists (or variable is not null) and then open a debugger on the Fueled back in state?
Marianoâs article gave me all of the hints for doing something like this for PharoLamda - (although I am reading the file from S3 and then creating the debugger in a different image) - but I could imagine you doing this for what you want?
If you need specific code I can dig it out for you tonight.
Tim
On 12 Nov 2017, at 23:15, Sean P. DeNigris <sean@clipperadams.com> wrote:
Sean P. DeNigris wrote
In a headless image, I'd like to do the following: if there's any error, arrange to have a debugger open on the next (headful) launch, and then save and quit.
Bump :) I can't believe no one knows how to do this!
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Tim Mackinnon wrote
you can override this and Fuel out the debug context to a file
Thanks, Tim! I do know about that, but I was thinking/hoping that maybe there was a way to keep the debug context alive without fueling out⦠----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Hi Sean, You can always try: exception freeze. freeze will copy the stack so it is usable in a posterior debug session even if the original contexts died. exception debug. Opens a debugger :) On Mon, Nov 13, 2017 at 5:20 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Tim Mackinnon wrote
you can override this and Fuel out the debug context to a file
Thanks, Tim! I do know about that, but I was thinking/hoping that maybe there was a way to keep the debug context alive without fueling outâ¦
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
-- Guille Polito Research Engineer Centre de Recherche en Informatique, Signal et Automatique de Lille CRIStAL - UMR 9189 French National Center for Scientific Research - *http://www.cnrs.fr <http://www.cnrs.fr>* *Web:* *http://guillep.github.io* <http://guillep.github.io> *Phone: *+33 06 52 70 66 13
participants (6)
-
Ben Coman -
Guillermo Polito -
Richard Sargent -
Sean P. DeNigris -
Sven Van Caekenberghe -
Tim Mackinnon