Thanks for your mail. Unfortunately CLDC won't let me do any of this.
The only methods available on CLDC Throwable are: getMessage,
printStackTrace and toString (apart from inherited Object methods).
I too use various methods to grab the stack trace in J2SE. It's just
that none of those options are available with CLDC.
You are correct that I can print out debug data to the screen, but the
printStackTrace won't go there. The printStackTrace also can't be sent
to the application trace by setting AppTrace in the jam file. The only
place I can view it is on the command line when I run the emulator, i.e.
not on the handset.
Anyways I'm not so interested in printing the debug info to the screen,
I'm more interested in being able to send it over the wire so I can
batch test/benchmark many different phone types without having to
tediously view their screens one at a time. As I mentioned I have code
to do this already, i.e. send debug data back over http from unit-tests
running on multiple phones. What I'm looking for is some way to send the
stack trace info as well as the debug/benchmarking info, but it seems
like it will be impossible to display that in any form outside of the
Paul Lester wrote:
> It may not be supported in CLDC but you can get the stack trace from the
>Throwable object. I do this in regular java to create custom stack traces.
>(I don't do much CLDC dev just CLDC testing).
> Here's an excerpt from a windows program I am working on for fun.
> Assume err is an Exception that extends Throwable.
> CR is a windows Carriage return (or unix or mac..whatever I feel like)
> StackTraceElement elements = err.getStackTrace();
> String output =err.getClass()+":"+err.getMessage()+CR;
> for(int erri=0;erri<elements.length;erri++)
> output += elements[erri].getClassName()+":"+elements[erri].getLineNumber() + CR;
> As for debugging with applis... you can print debug data straight on top of your app to the screen.
>That's the standard method.... (usually before the error occurs and often checking the memory remaining).
>Sam Joseph wrote:
>>So I'm working on a unit test package for Doja phones and I'm trying to
>>get the results of the unit-tests sent back over the wire. I've managed
>>to do this on the emulator at least, but now I'm trying to send back the
>>output of the printStackTrace() operations - that most useful of
>>However it seems that CLDC 1.0 at least is of no help here since the
>>printStackTrace() operations cannot point anywhere except System.err and
>>System.err is final. CLDC 1.1 looks no different.
>>I guess that means there is no way to redirect that output at all ...
>>Any ideas on ways round this?
>>Many thanks in advance.
>>This mail was sent to address paul_at_thetamusic.com
>>Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/
>Paul B. Lester
>personal homepage: http://pbl1.tripod.com/
>personal EMAIL: pbl1_at_cornell.edu
>This mail was sent to address gaijin_at_yha.att.ne.jp
>Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/
Received on Fri Jan 7 07:05:39 2005