Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

newbe question: stack trace in j2me

 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks! i'll try checking if the plugin uses obfuscation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic