This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes newbe question: stack trace in j2me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "newbe question: stack trace in j2me" Watch "newbe question: stack trace in j2me" New topic
Author

newbe question: stack trace in j2me

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,

I'm new to j2me, and noticed a strange behaviour with excpetion stack traces (printed into the console, in emulation mode): Line numbers are incorrect, and are marked with "+" signs.
Why is that so ?

I'm not sure whether it matters, but I use Sun's J2me Wireless Kit (2.2),
the "eclipseme" plugin, and run in simple emulation mode (not OTA).

Simple example: following is a midlet with an intentional "division by zero" exception on the startApp() method:


Then the following stack trace is shown... note the "+38" (while my exception is actually around line 13):


Thanks
Kirk Bateman
Greenhorn

Joined: Oct 13, 2004
Posts: 9
Stack traces show bytecode offsets NOT line numbers :-)

Your +38 means 38 bytes into the bytecode for that method (think its bytes).

Cheers

Kirk Bateman
Synaptic Technologies Limited
Kirk Bateman
Greenhorn

Joined: Oct 13, 2004
Posts: 9
Actually, that might not have been correct ... I'll just shut up now :-)

I was under the impression that + was bytecode offset, and : was line numbers.

So, infact I might be completely wrong... I know there are issues with obfuscated code and stack traces, which have line numbers which won't match your original code, but then you can get tools that work with most to decrypt them..

Cheers Kirk
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
thanks! i'll try checking if the plugin uses obfuscation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: newbe question: stack trace in j2me
 
Similar Threads
How to invoke the MIDlet ?
Horizantal image scroll in J2ME form
Problem in basics
IllegalAccessException
Getting Battery Level