Skip to main content

Capturing stack trace

8 replies [Last post]
Anonymous

Is there any way to catch the stack trace from a thrown exception? I was reading
http://archives.java.sun.com/cgi-bin/wa?A2=ind0204&L=kvm-interest&P=35330
Was this ever sorted?

How am I going to debug a generalised nullpointerexception: 0 which I'm getting on the phone without seeing the stack?

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Roger Brinkley

Does exception.printStackTrace() do what you need?

Binky

Chris B wrote:
> Is there any way to catch the stack trace from a thrown exception? I was
> reading
> http://archives.java.sun.com/cgi-bin/wa?A2=ind0204&L=kvm-interest&P=35330
>
> Was this ever sorted?
>
> How am I going to debug a generalised nullpointerexception: 0 which I'm
> getting on the phone without seeing the stack?
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body of the message "signoff KVM-INTEREST". For general help, send email
> to listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Hartti Suomela

Don't know the situation with the thread you pointed to, however the
specs for 139 only list printStackTrace() - so I am guessing it did not
go forward...

Alternative solution:
Some devices allow on-device debugging (like Nokia S60 3rd Edition
devices)
Unfortunately I do not know which devices from other manufacturers
support this

See this video for guidance how to do ODD on Nokia devices using
Carbide.j
http://forum.nokia.com/info/sw.nokia.com/id/d3d31fa8-ec3e-454a-afe3-c9e3
5525c2b1/Carbide.j_ODD_v1_0_en.exe.html

best regards,
Hartti Suomela
Forum Nokia Americas

________________________________

From: A mailing list for KVM discussion
[mailto:KVM-INTEREST@JAVA.SUN.COM] On Behalf Of ext Chris B
Sent: Tuesday, January 09, 2007 1:41 AM
To: KVM-INTEREST@JAVA.SUN.COM
Subject: Capturing stack trace

Is there any way to catch the stack trace from a thrown exception? I was
reading
http://archives.java.sun.com/cgi-bin/wa?A2=ind0204&L=kvm-interest&P=3533
0
Was this ever sorted?

How am I going to debug a generalised nullpointerexception: 0 which I'm
getting on the phone without seeing the stack?
========================================================================
=== To unsubscribe, send email to listserv@java.sun.com and include in
the body of the message "signoff KVM-INTEREST". For general help, send
email to listserv@java.sun.com and include in the body of the message
"help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

Borut Dagarin, Cocoasoft

[att1.html]

Vince Batchelor

Newer Sony Ericsson devices allow you to get console output over
bluetooth. You just need the SE sdk and a bluetooth adapter.

At 11:22 AM 1/9/2007, you wrote:
>Hi
>
>You can try this on newer S40 devices (it works for me):
>
>http://blogs.forum.nokia.com/view_entry.html?id=247
>
>Best regards
>Borut
>
>Hartti Suomela wrote:
>>Don't know the situation with the thread you pointed to, however the
>>specs for 139 only list printStackTrace() - so I am guessing it did not
>>go forward...
>>
>>Alternative solution:
>>Some devices allow on-device debugging (like Nokia S60 3rd Edition devices)
>>Unfortunately I do not know which devices from other manufacturers
>>support this
>>
>>See this video for guidance how to do ODD on Nokia devices using Carbide.j
>>http://forum.nokia.com/info/sw.nokia.com/id/d3d31fa8-ec3e-454a-afe3-c9e35525c2b1/Carbide.j_ODD_v1_0_en.exe.html
>>
>>best regards,
>>Hartti Suomela
>>Forum Nokia Americas
>>
>>
>>----------
>>From: A mailing list for KVM discussion
>>[mailto:KVM-INTEREST@JAVA.SUN.COM] On
>>Behalf Of ext Chris B
>>Sent: Tuesday, January 09, 2007 1:41 AM
>>To: KVM-INTEREST@JAVA.SUN.COM
>>Subject: Capturing stack trace
>>
>>Is there any way to catch the stack trace from a thrown exception? I was
>>reading
>>http://archives.java.sun.com/cgi-bin/wa?A2=ind0204&L=kvm-interest&P=35330
>>Was this ever sorted?
>>
>>How am I going to debug a generalised nullpointerexception: 0 which I'm
>>getting on the phone without seeing the stack?
>>===========================================================================
>>To unsubscribe, send email to
>>listserv@java.sun.com and include in the
>>body of the message "signoff KVM-INTEREST". For general help, send email
>>to listserv@java.sun.com and include in the
>>body of the message "help".
>>==========================================================================
>>= To unsubscribe, send email to
>>listserv@java.sun.com and include in the
>>body of the message "signoff KVM-INTEREST". For general help, send email
>>to listserv@java.sun.com and include in the
>>body of the message "help".
>===========================================================================
>To unsubscribe, send email to listserv@java.sun.com and include in the
>body of the message "signoff KVM-INTEREST". For general help, send email
>to listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Robin Chaddock

SonyEricssons allow much more than capturing console output, you can attach
a debugger to the handset, and perform on-device debugging.

The same goes for most Motorolas - though it requires the capability is
unlocked on the handset, and is more complicated to setup.

For handsets without any facility for capturing console output (or ones that
don't report exception traces), bytecode manipulation can be used to inject
try/catch blocks to track Exception sources, and synthesize a stack trace.
Obviously this technique has a significant cost in code size & execution
speed.

----- Original Message -----
From: "Vince Batchelor"
To:
Sent: Wednesday, January 10, 2007 6:54 AM
Subject: Re: Capturing stack trace

> Newer Sony Ericsson devices allow you to get console output over
> bluetooth. You just need the SE sdk and a bluetooth adapter.
>
> At 11:22 AM 1/9/2007, you wrote:
>>Hi
>>
>>You can try this on newer S40 devices (it works for me):
>>
>>http://blogs.forum.nokia.com/view_entry.html?id=247
>>
>>Best regards
>>Borut
>>
>>Hartti Suomela wrote:
>>>Don't know the situation with the thread you pointed to, however the
>>>specs for 139 only list printStackTrace() - so I am guessing it did not
>>>go forward...
>>>
>>>Alternative solution:
>>>Some devices allow on-device debugging (like Nokia S60 3rd Edition
>>>devices)
>>>Unfortunately I do not know which devices from other manufacturers
>>>support this
>>>
>>>See this video for guidance how to do ODD on Nokia devices using
>>>Carbide.j
>>>http://forum.nokia.com/info/sw.nokia.com/id/d3d31fa8-ec3e-454a-afe3-c9e35525c2b1/Carbide.j_ODD_v1_0_en.exe.html
>>>
>>>best regards,
>>>Hartti Suomela
>>>Forum Nokia Americas
>>>
>>>
>>>----------
>>>From: A mailing list for KVM discussion
>>>[mailto:KVM-INTEREST@JAVA.SUN.COM] On
>>>Behalf Of ext Chris B
>>>Sent: Tuesday, January 09, 2007 1:41 AM
>>>To: KVM-INTEREST@JAVA.SUN.COM
>>>Subject: Capturing stack trace
>>>
>>>Is there any way to catch the stack trace from a thrown exception? I was
>>>reading
>>>http://archives.java.sun.com/cgi-bin/wa?A2=ind0204&L=kvm-interest&P=35330
>>>Was this ever sorted?
>>>
>>>How am I going to debug a generalised nullpointerexception: 0 which I'm
>>>getting on the phone without seeing the stack?
>>>===========================================================================
>>>To unsubscribe, send email to
>>>listserv@java.sun.com and include in the
>>>body of the message "signoff KVM-INTEREST". For general help, send email
>>>to listserv@java.sun.com and include in the
>>>body of the message "help".
>>>==========================================================================
>>>= To unsubscribe, send email to
>>>listserv@java.sun.com and include in the
>>>body of the message "signoff KVM-INTEREST". For general help, send email
>>>to listserv@java.sun.com and include in the
>>>body of the message "help".
>>===========================================================================
>>To unsubscribe, send email to listserv@java.sun.com and include in the
>>body of the message "signoff KVM-INTEREST". For general help, send email
>>to listserv@java.sun.com and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

________________________________________________________________________
E-mail is an informal method of communication and may be subject to data corruption, interception and unauthorised amendment for which I-play, a trading name of Digital Bridges Ltd will accept no liability. Therefore, it will normally be inappropriate to rely on information contained on e-mail without obtaining written confirmation.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

(C) 2005. I-play is a trademark and trading name of Digital Bridges Limited. All Rights Reserved.
________________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Chris B

What's wrong with using standard java api to dump it into
ByteArrayOutputSteam or the like?

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Robin Chaddock

In CLDC java.lang.Throwable contains only the no-args printStackTrace()
method.
Also in CLDC, there is no way of reassigning System.out or System.err.

A monumental oversight when considering CLDC's primary target has always
been embedded devices.

----- Original Message -----
From: "Chris B"
To:
Sent: Wednesday, January 10, 2007 3:11 PM
Subject: Re: Capturing stack trace

> What's wrong with using standard java api to dump it into
> ByteArrayOutputSteam or the like?
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

________________________________________________________________________
E-mail is an informal method of communication and may be subject to data corruption, interception and unauthorised amendment for which I-play, a trading name of Digital Bridges Ltd will accept no liability. Therefore, it will normally be inappropriate to rely on information contained on e-mail without obtaining written confirmation.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

(C) 2005. I-play is a trademark and trading name of Digital Bridges Limited. All Rights Reserved.
________________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Adrian Valentin Dan

The best and probably the most complicated way of debugging any CLDC
application on the device is injecting the code with debug information,
at a minor performance expense.

I have developed a framework that performs this on compiled code, allowing :

Method call trace, (debug information persists even on obfuscated code).
Application Breakpoints.
Watches on field or local values, thread and lock states.

Because all the captured information is delivered using network access
to a server component the framework allows for on device debugging be
performed on any MIDP/CLDC.

For more information on this framework, please contact me.

Robin Chaddock wrote:
> In CLDC java.lang.Throwable contains only the no-args printStackTrace()
> method.
> Also in CLDC, there is no way of reassigning System.out or System.err.
>
> A monumental oversight when considering CLDC's primary target has always
> been embedded devices.
>
> ----- Original Message -----
> From: "Chris B"
> To:
> Sent: Wednesday, January 10, 2007 3:11 PM
> Subject: Re: Capturing stack trace
>
>
>> What's wrong with using standard java api to dump it into
>> ByteArrayOutputSteam or the like?
>>
>> ===========================================================================
>>
>> To unsubscribe, send email to listserv@java.sun.com and include in the
>> body
>> of the message "signoff KVM-INTEREST". For general help, send email to
>> listserv@java.sun.com and include in the body of the message "help".
>>
>
>
> ________________________________________________________________________
> E-mail is an informal method of communication and may be subject to
> data corruption, interception and unauthorised amendment for which
> I-play, a trading name of Digital Bridges Ltd will accept no
> liability. Therefore, it will normally be inappropriate to rely on
> information contained on e-mail without obtaining written confirmation.
>
> This e-mail may contain confidential and/or privileged information. If
> you are not the intended recipient (or have received this e-mail in
> error) please notify the sender immediately and destroy this e-mail.
> Any unauthorized copying, disclosure or distribution of the material
> in this e-mail is strictly forbidden.
>
> (C) 2005. I-play is a trademark and trading name of Digital Bridges
> Limited. All Rights Reserved.
> ________________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Scanning Service. For further information visit
> http://www.messagelabs.com/stats.asp
>
> ===========================================================================
>
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".