1、設(shè)置斷點(diǎn) 2、啟動(dòng)servers端的debug模式 3、運(yùn)行程序,在后臺(tái)遇到斷點(diǎn)時(shí),進(jìn)入debug調(diào)試狀態(tài)
============================= 作用域 功能 快捷鍵 全局 單步返回 F7 全局 單步跳過(guò) F6 全局 單步跳入 F5 全局 單步跳入選擇 Ctrl+F5 全局 調(diào)試上次啟動(dòng) F11 全局 繼續(xù) F8 全局 使用過(guò)濾器單步執(zhí)行 Shift+F5 全局 添加/去除斷點(diǎn) Ctrl+Shift+B 全局 顯示 Ctrl+D 全局 運(yùn)行上次啟動(dòng) Ctrl+F11 全局 運(yùn)行至行 Ctrl+R 全局 執(zhí)行 Ctrl+U
============================= 1.Step Into (also F5) 跳入 2.Step Over (also F6) 跳過(guò) 3.Step Return (also F7) 執(zhí)行完當(dāng)前method,然后return跳出此method 4.step Filter 逐步過(guò)濾 一直執(zhí)行直到遇到未經(jīng)過(guò)濾的位置或斷點(diǎn)(設(shè)置Filter:window-PReferences-java-Debug-step Filtering) 5.resume 重新開(kāi)始執(zhí)行debug,一直運(yùn)行直到遇到breakpoint。 例如 :A和B兩個(gè)斷點(diǎn),debug過(guò)程中發(fā)現(xiàn)A斷點(diǎn)已經(jīng)無(wú)用,去除A斷點(diǎn),運(yùn)行resume就會(huì)跳過(guò)A直接到達(dá)B斷點(diǎn)。 6.hit count 設(shè)置執(zhí)行次數(shù) 適合程序中的for循環(huán)(設(shè)置 breakpoint view-右鍵hit count) 7.inspect 檢查 運(yùn)算。執(zhí)行一個(gè)表達(dá)式顯示執(zhí)行值 8.watch 實(shí)時(shí)地監(jiān)視對(duì)象、方法或變量的變化 9. 我們常說(shuō)的斷點(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)成員變量被讀取或修改時(shí)暫掛 11.添加method breakpoint 進(jìn)入/離開(kāi)此方法時(shí)暫掛(Run-method breakpoint) 12.添加Exception breakpoint 捕抓到Execption時(shí)暫掛(待續(xù)…) 斷點(diǎn)屬性: 1.hit count 執(zhí)行多少次數(shù)后暫掛 用于循環(huán) 2.enable condition 遇到符合你輸入條件(為ture/改變時(shí))就暫掛 3.suspend thread 多線程時(shí)暫掛此線程 4.suspend VM 暫掛虛擬機(jī) 13.variables 視圖里的變量可以改變變量值,在variables 視圖選擇變量點(diǎn)擊右鍵–change value.一次來(lái)進(jìn)行快速調(diào)試。 14.debug 過(guò)程中修改了某些code后–〉save&build–>resume–>重新暫掛于斷點(diǎn) 15.resume 當(dāng)debug調(diào)試跑出異常時(shí),運(yùn)行resume,重新從斷點(diǎn)開(kāi)始調(diào)試 16.如果一行有很多方法, 當(dāng)?shù)谝淮伟碏5鍵就跳入這一行第一個(gè)方法,F6一步一步調(diào)試,F7跳出這方法. 當(dāng)?shù)诙伟碏5鍵就跳入這一行第二個(gè)方法,F6一步一步調(diào)試,F7跳出這方法. 以此類推.想進(jìn)入這一行第幾個(gè)方法,就按幾次F5和F7.
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注