Debuggig or answering my own questions

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

Debuggig or answering my own questions

Edgar J. De Cleene
I was asking about how to trace some until top procedure
Now I wish share my solution to all, just in case some need do know.

(HttpService on: 8080 named: 'Debug1')
        onRequestDo: [ :httpRequest | HttpResponse fromString:  'SqueakRos
Greet You'.
            self dpsTraceUntilRoot: httpRequest  ];
        start

'From SqueakLight|II of 31 May 2008 [latest update: #7198] on 31 July 2008
at 6:41:26 am'!

!Object methodsFor: 'error handling' stamp: 'edc 7/31/2008 06:39'!
dpsTraceUntilRoot: anObject
    | reportString context count |
   
    Transcript open.
   
    reportString := (anObject respondsTo: #asString)
            ifTrue: [anObject asString] ifFalse: [anObject printString].
    (Smalltalk at: #Decompiler ifAbsent: [nil])
    ifNil:
        [Transcript cr; show: reportString]
    ifNotNil:
        [context := thisContext.
        count := 1.
        [Transcript cr.
            Transcript show: count printString, ': '.
           
            reportString notNil
            ifTrue:
                [Transcript show: context home class name
            , '/' , context sender selector,  ' (' , reportString , ')'.
                context := context sender.
                reportString := nil]
            ifFalse:
                [(context notNil and: [(context := context sender) notNil])
                ifTrue: [Transcript show: context receiver class name , '/'
, context selector.
                    count := count + 1]].
    context sender notNil]whileTrue]! !


I try to cook a micro image using Alejandro Reimondo technique into
SqueakLightII.
The goal is the micro image could greet to Firefox web browser and quit.
I afraid as size is 76 k on first try, can't be send here as attached
because is too big :=)

So thanks to all and wait Fenix ponga un Huevo (the Fenix laid an Egg).

Edgar