在eclipse中怎么样设置断点并调试

在eclipse中怎么样设置断点,并调试啊~


//===============================

用EclipseMe插件,在preference   里边把Java--Debug的Debuger   timeout   调到15000ms,同时确认

suspend   execution   on   uncaught   exceptions   和suspend   executioen   on   complication

  errors没有被选中,然后debug的时候,debug   as   Emulated   midlet,然后就可以调试了。

为什么这个debug总是进入一些基础类库,而且这些基础类库还提示没有找到,这是为什么?我不想进入这

些基础类库,太多了。调试的我晕头转向。

//-----------------------

断点简单的解释就是告诉编译器在执行到该点(该句)的时候,停一下,方便用户看看当前的情况,包括

变量等等。

Eclipse的设置断点很简单的啊,在java视图下,直接在你要设置断点的那行的最左边,双击即可,右键也

有这个选项的。

调式 选择debug即可,自动进入debug视图,F6单步调式

//-----------------------

在你想调试的程序前的地方双击左键,就出现了断电.程序运行到断电的时候会进入DEBUG模式,可以查看个

个变量的变化,从观察程序的正确与否

//-----------------------  窗口焦点定位在eclipse,进去后我找不到F5,F6那些调试功能。  
在   debug   视图下你   应该会发现   step   into   ,step   over   ..等功能  

一般都是设置在获取值的地方,看得到值没有或者值有改变没有
或者还有设置在一个语句处,看能不能运行到这一句
设置了断点后,eclipse运行程序会到debug界面

断点信息和变量值都会在debug视图中显示,调试的时候,eclipse会自动的将视图切换到debug视图的。
如要调试jsp,需要你设置好应用服务器,也可以调试的,很方便。 


//============================

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.  
   

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值