On 10/28/2009 09:20 PM, Roland Plüss wrote:
What exactly does #open do? Assuming I use a c function as #open in the
base class do I then get this function called whenever there is a
run-time problem?

It is #open: actually. The function will be passed an error message and it can print it + invoke gst_show_backtrace. However, the function should also terminate the active process, so it's better if you write it in Smalltalk.

A better choice is that you write in C a "print"-like function, and then do

    TextCollector extend [
        primWrite: aString [
            <cCall: 'roland_write_string' returning: #void args:
                   #(#string)>
        ]
    ]

    Eval [
        Transcript message: Transcript -> #primWrite:
    ]

to connect the transcript to your function.

Then you do not need a #debuggerClass at all, because you can use the default implementation of UnhandledException. You also get more flexibility, for example backtraces will include file names and line numbers instead of bytecode indices (much better!)

Regarding nil, using eval_expr is a solution, yes.

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to