gbk

          eclipse debug

          怎樣在Eclipse中使用debug調(diào)試程序?

          最基本的操作是:
          1, 首先在一個java文件中設(shè)斷點(diǎn),然后運(yùn)行,當(dāng)程序走到斷點(diǎn)處就會轉(zhuǎn)到debug視圖下,
          2, F5鍵與F6鍵均為單步調(diào)試,F(xiàn)5是step into,也就是進(jìn)入本行代碼中執(zhí)行,F(xiàn)6是step over,
          也就是執(zhí)行本行代碼,跳到下一行,
          3,F7是跳出函數(shù)
          4,F8是執(zhí)行到最后。
          ////////////////////////////////////////////////
          1.Step Into (also F5) 跳入
          2.Step Over (also F6) 跳過
          3.Step Return (also F7) 執(zhí)行完當(dāng)前method,然后return跳出此method
          4.step Filter 逐步過濾 一直執(zhí)行直到遇到未經(jīng)過濾的位置或斷點(diǎn)(設(shè)置Filter:window-preferences-java-Debug-step Filtering)
          5.resume 重新開始執(zhí)行debug,一直運(yùn)行直到遇到breakpoint
          6.hit count 設(shè)置執(zhí)行次數(shù) 適合程序中的for循環(huán)(設(shè)置 breakpoint view-右鍵hit count)
          7.inspect 檢查 運(yùn)算。執(zhí)行一個表達(dá)式顯示執(zhí)行值
          8.watch 實(shí)時地監(jiān)視變量的變化
          9.我們常說的斷點(diǎn)(breakpoints)是指line breakpoints,除了line breakpoints,還有其他的斷點(diǎn)類型:field(watchpoint)breakpoint,method breakpoint,exception breakpoint.
          10.field breakpoint 也叫watchpoint(監(jiān)視點(diǎn)) 當(dāng)成員變量被讀取或修改時暫掛
          11.添加method breakpoint 進(jìn)入/離開此方法時暫掛(Run-method breakpoint)
          12.添加Exception breakpoint 捕抓到Execption時暫掛(待續(xù)...)
          斷點(diǎn)屬性:
          1.hit count 執(zhí)行多少次數(shù)后暫掛 用于循環(huán)
          2.enable condition 遇到符合你輸入條件(為ture"改變時)就暫掛
          3.suspend thread 多線程時暫掛此線程
          4.suspend VM 暫掛虛擬機(jī)
          13.variables 視圖里的變量可以改變變量值,在variables 視圖選擇變量點(diǎn)擊右鍵--change value.一次來進(jìn)行快速調(diào)試。
          14.debug 過程中修改了某些code后--〉save&build-->resume-->重新暫掛于斷點(diǎn)

          posted on 2008-01-17 11:46 百科 閱讀(310) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          My Links

          Blog Stats

          常用鏈接

          留言簿(2)

          隨筆檔案

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 湟源县| 色达县| 沂源县| 博湖县| 左贡县| 资中县| 东港市| 赫章县| 贵溪市| 恩施市| 清河县| 金平| 贵德县| 万山特区| 成武县| 景洪市| 宜黄县| 泗水县| 五峰| 驻马店市| 叶城县| 井研县| 綦江县| 江津市| 溆浦县| 修武县| 洞头县| 科技| 凤冈县| 公安县| 澳门| 鲜城| 崇明县| 寻甸| 泸水县| 凤城市| 姚安县| 恭城| 鄄城县| 周至县| 吴桥县|