[Newbies] Debuggig or answering my own questions

Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Thu Jul 31 09:58:53 UTC 2008


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




More information about the Beginners mailing list