Eclipse中断点调试j2me程序方法

来源:互联网 发布:淘宝知识产权注册流程 编辑:程序博客网 时间:2024/05/29 09:15

使用EclipseMe插件,在preference   里边把Java--Debug的Debuger   timeout   调到15000ms,同时确认suspend   execution   on   uncaught   exceptions   和suspend   executioen   on   complication   errors没有被选中,然后debug的时候,debug   as   Emulated   midlet,然后就可以调试了。

debugging   with   eclipse   2.1.1   windows   works   fine   if   you   allow   the   debugged   VM   to   exit.   Otherwise,   mine   just   crashed   the   moment   when   eclipse   attached.

1.   for   wtkrun   use   debug= "3452 "   or   some   other   port   you   like
2.   make   a   debugger   config   for   remote   debugging
3.   enable   "Allow   termination   of   remote   VM "
4.   specify   the   same   port   in   debugger   config
5.   just   leave   the   host   name   blank
6.   never   start   the   debugger   before   the   emulator

Step   6   is   important,   otherwise   you   make   your   eclipse   hang   up   on   you   and   block.   Wait   for   the   emulator   to   get   ready   (it   won 't   start   execution   though)   and   then   connect   from   eclipse.   Interestingly   enough,   it   seems   to   be   ready   when   it   prints   "VM   not   ready ".

If   the   emulator   complains   about   address   already   in   use,   move   on   to   a   different   port.   Be   sure   to   change   the   port   both   in   wtkrun   and   debug   config.   Sometimes   it   seems   that   a   locked   debugger   or   crashed   emulator   wastes   a   port.   Maybe   something   with   windows.   Just   move   on   to   another.   Or   reboot...

Once   the   connection   is   up   it   works   like   a   charm,   source   level   debugging   and   local   variables   are   as   you   expect   them   to   be.


原创粉丝点击