随笔 - 2, 文章 - 73, 评论 - 60, 引用 - 0
数据加载中……

Eclispe中调试J2ME程序(Debug)

在Eclipse中,使用模拟器调试kvm时控制台显示如下:
Connecting to 127.0.0.1 on port 2800
Connecting to debugger at localhost:3170
Waiting for KVM...
正在通过存储根 temp.DefaultColorPhone1111472185125 来运行
Connection received.
Connected to KVM
Method............: 101657ec 'com/sun/cldc/i18n/j2me/UTF_8_Reader.read (virtual)'
Stack Chunk.......: ec37e4
Frame Pointer.....: ec3814
Current IP........: 101e4b6c = 101e4b50 + offset 28
Previous Frame....: e70714
Previous IP.......: 1021a866 (offset 11)
Frame size........: 10 (4 arguments, 6 local variables)
Argument[0].......: ea5494
Argument[1].......: ea4d68
Argument[2].......: 0
Argument[3].......: 1
Local[4]..........: 0
Local[5]..........: 0
Local[6]..........: 0
Local[7]..........: 0
Local[8]..........: 0
Local[9]..........: 0
Operand[1]........: 72

Method............: 10188c50 'java/io/Reader.read (virtual)'
Stack Chunk.......: e7056c
Frame Pointer.....: e70714
Current IP........: 1021a866 = 1021a85b + offset 11
Previous Frame....: e706f4
Previous IP.......: 101e2b1f (offset 11)
Frame size........: 2 (1 arguments, 1 local variables)
Argument[0].......: ea5494
Local[1]..........: ea4d68

Method............: 10163e1c 'java/io/InputStreamReader.read (virtual)'
Stack Chunk.......: e7056c
Frame Pointer.....: e706f4
Current IP........: 101e2b1f = 101e2b14 + offset 11
Previous Frame....: e706d8
Previous IP.......: 101fbc3a (offset 15)
Frame size........: 1 (1 arguments, 0 local variables)
Argument[0].......: ea5710

Method............: 10174edc 'com/sun/midp/midletsuite/JadProperties.readLine (virtual)'
Stack Chunk.......: e7056c
Frame Pointer.....: e706d8
Current IP........: 101fbc3a = 101fbc2b + offset 15
Previous Frame....: e706a8
Previous IP.......: 101fbb43 (offset 63)
Frame size........: 6 (2 arguments, 4 local variables)
Argument[0].......: ea5c60
Argument[1].......: ea5710
Local[2]..........: 1fd
Local[3]..........: 3
Local[4]..........: 63
Local[5]..........: 0

Method............: 10174e7c 'com/sun/midp/midletsuite/JadProperties.partialLoad (virtual)'
Stack Chunk.......: e7056c
Frame Pointer.....: e706a8
Current IP........: 101fbb43 = 101fbb04 + offset 63
Previous Frame....: e70660
Previous IP.......: 101fbb03 (offset 8)
Frame size........: 12 (4 arguments, 8 local variables)
Argument[0].......: ea5c60
Argument[1].......: ea5728
Argument[2].......: 0
Argument[3].......: 7fffffff
Local[4]..........: ea5710
Local[5]..........: ea4e84
Local[6]..........: e
Local[7]..........: ea4e30
Local[8]..........: f
Local[9]..........: ea4dd4
Local[10]..........: 0
Local[11]..........: 1

Method............: 10174e5c 'com/sun/midp/midletsuite/JadProperties.load (virtual)'
Stack Chunk.......: e7056c
Frame Pointer.....: e70660
Current IP........: 101fbb03 = 101fbafb + offset 8
Previous Frame....: e7063c
Previous IP.......: 101f1596 (offset 190)
Frame size........: 3 (3 arguments, 0 local variables)
Argument[0].......: ea5c60
Argument[1].......: ea5728
Argument[2].......: 0

Method............: 1016d8b0 'com/sun/midp/dev/DevMIDletSuiteImpl.create (static)'
Stack Chunk.......: e7056c
Frame Pointer.....: e7063c
Current IP........: 101f1596 = 101f14d8 + offset 190
Previous Frame....: e705d0
Previous IP.......: 101f14d7 (offset 62)
Frame size........: 21 (10 arguments, 11 local variables)
Argument[0].......: ec183c
Argument[1].......: ebae20
Argument[2].......: ebaea8
Argument[3].......: 10115c10
Argument[4].......: 0
Argument[5].......: 0
Argument[6].......: 1010aa68
Argument[7].......: 0
Argument[8].......: 0
Argument[9].......: 0
Local[10]..........: ea5cc8
Local[11]..........: ea5b9c
Local[12]..........: 0
Local[13]..........: ea5d1c
Local[14]..........: 8
Local[15]..........: ea576c
Local[16]..........: 3e1
Local[17]..........: ea577c
Local[18]..........: ea5728
Local[19]..........: 0
Local[20]..........: 0

Method............: 1016d890 'com/sun/midp/dev/DevMIDletSuiteImpl.create (static)'
Stack Chunk.......: e7056c
Frame Pointer.....: e705d0
Current IP........: 101f14d7 = 101f1499 + offset 62
Previous Frame....: e705a4
Previous IP.......: 101dec7d (offset 20)
Frame size........: 5 (5 arguments, 0 local variables)
Argument[0].......: ec183c
Argument[1].......: ebae20
Argument[2].......: ebaea8
Argument[3].......: 10115c10
Argument[4].......: 0

Method............: 1016224c 'com/sun/midp/main/Main.runLocalClass (static)'
Stack Chunk.......: e7056c
Frame Pointer.....: e705a4
Current IP........: 101dec7d = 101dec69 + offset 20
Previous Frame....: e70580
Previous IP.......: 101de6fc (offset 116)
Frame size........: 3 (1 arguments, 2 local variables)
Argument[0].......: ec2028
Local[1]..........: 0
Local[2]..........: 0

Method............: 101621ac 'com/sun/midp/main/Main.main (static)'
Stack Chunk.......: e7056c
Frame Pointer.....: e70580
Current IP........: 101de6fc = 101de688 + offset 116
Previous Frame....: 0
Previous IP.......: 1
Frame size........: 3 (1 arguments, 2 local variables)
Argument[0].......: e70858
Local[1]..........: ec2028
Local[2]..........: ebaefc

VM status:
Instruction pointer.: 101e4b6c (offset within invoking method: 28)
Next instruction....: 0x36
Frame pointer.......: ec3814
Local pointer.......: ec37ec
Stack size..........: 256; sp: ec382c; ranges: e70574-e70774;ec37ec-ec39ec;
Contents of the current stack frame:
    ec37ec: ea5494 (lp)
    ec37f0: ea4d68
    ec37f4: 0
    ec37f8: 1
    ec37fc: 0
    ec3800: 0
    ec3804: 0
    ec3808: 0
    ec380c: 0
    ec3810: 0
    ec3814: e70714 (fp)
    ec3818: 1021a866
    ec381c: e70728
    ec3820: 101657ec
    ec3824: ec37e4
    ec3828: 0 (end of frame)
    ec382c: 72 (sp)
Execution stack contains 580 items:
e70858  
ec2028  
ebaefc  
0  
1  
e70570  
101621ac  
e7056c  
0  
ec2028  
0  
0  
e70580  
101de6fc  
e70594  
1016224c  
e7056c  
0  
ec183c  
ebae20  
ebaea8  
10115c10  
0  
e705a4  
101dec7d  
e705b8  
1016d890  
e7056c  
0  
ec183c  
ebae20  
ebaea8  
10115c10  
0  
0  
1010aa68  
0  
0  
0  
ea5cc8  
ea5b9c  
0  
ea5d1c  
8  
ea576c  
3e1  
ea577c  
ea5728  
0  
0  
e705d0  
101f14d7  
e705e4  
1016d8b0  
e7056c  
0  
ea5c60  
ea5728  
0  
e7063c  
101f1596  
e70650  
10174e5c  
e7056c  
ea5c60  
ea5c60  
ea5728  
0  
7fffffff  
ea5710  
ea4e84  
e  
ea4e30  
f  
ea4dd4  
0  
1  
e70660  
101fbb03  
e70674  
10174e7c  
e7056c  
0  
ea5c60  
ea5710  
1fd  
3  
63  
0  
e706a8  
101fbb43  
e706bc  
10174edc  
e7056c  
0  
ea5710  
e706d8  
101fbc3a  
e706ec  
10163e1c  
e7056c  
0  
ea5494  
ea4d68  
e706f4  
101e2b1f  
e70708  
10188c50  
e7056c  
0  
ea5494  
ea4d68  
0  
1  
ea4dd4  
1  
1  
e7072c  
10162008  
e7056c  
ea5c48  
ffffffff  
0  
10116528  
b  
0  
0  
0  
ea5494  
ea4d68  
0  
1  
0  
0  
0  
0  
0  
0  
e70714  
1021a866  
e70728  
101657ec  
ec37e4  
0  
72  

Execution completed.
ALERT: Attempting to resume current thread
653306 bytecodes executed
3 thread switches
738 classes in the system (including system classes)
16084 dynamic objects allocated (821916 bytes)
3 garbage collections (539264 bytes collected)
Execution completed.
653306 bytecodes executed
3 thread switches
738 classes in the system (including system classes)
16084 dynamic objects allocated (821916 bytes)
3 garbage collections (539264 bytes collected)

模拟器一闪就没了。

要解决这个问题,需要做如下工作:

安装好EclipseME之后,我们要对原有的Eclipse配置做一点小小的改动。由于开发J2ME时我们需要首先启动手机模拟器,那么在Debug模式的Eclipse默认设置不等到模拟器启动就会失败。修改这点很简单,在Window ->Preference->Java->Debug中,把超时时间提高到 20000 毫秒。


在运行调试的时候经常会出现classnotfound的问题, 出现这种问题首先要检查是否在Java Build Path - order and export中包括了需要的jar.

posted on 2007-11-07 20:52 郭天文 阅读(1915) 评论(0)  编辑 收藏 引用 所属分类: J2ME


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理