2011-12-20 28 views
4

當前指令指針。當我將調試器放在特定位置時,它開始調試其前一步,然後到達當前位置。在調試器啓動時,我可以看到當前指令指針與另一個位置上的調試器圖標。如何擺脫調試當前指令指針

請幫幫我我一直試圖擺脫它的最後兩天。

這是情景:

我已經把調試器上viewattachmentopenattachment。其中說到。 但是當我點擊openattachment這開始變得調試,然後當我點擊viewattachment調試開始吧..

爲什麼要openattachment?它對我來說是一個開銷。任何人都可以幫助我嗎?

如果我的問題不清楚,請讓我知道。

的代碼是爲下..........

else if (getParameters().get("type") != null && getParameters().get("type")[0].equals("**viewattachment**")){ 
      String elementUid = getParameters().get("elementUid")[0]; 
      String target = "failure"; 
      JSONObject obj = new JSONObject(); 
      if (!isUserLoggedIn()){ 
       target="session"; 
       obj.put("result", target); 
      } 
      else{ 
       if (!isValidUid(cardUid) || !isValidUid(elementUid)){ 
        //return "fail"; 
        obj.put("result", "fail"); 
       } 
       else { 
        setMessages(msgService.WSIGetAttachments(elementUid)); 
        if (!isAccountManager()) { 
         Message msg = getMessages().get(0); 
         HttpServletResponse response = ServletActionContext.getResponse(); 
         try{ 
          response.getOutputStream().print(obj.toString());     
         } 
         catch(IOException e){ 
          log.error(e); 
         }   
         response.setContentType(msg.getAttachmentcontentType()); 
         response.setHeader("filename", msg.getAttachmentName()); 
         response.getWriter().print(obj); 
         response.getWriter().flush(); 
         response.getWriter().close(); 


        } 
        return null; 
       } 
      } 
     } 
     else if (getParameters().get("type") != null && getParameters().get("type")[0].equals("**openattachment**")){ 
      String elementUid = getParameters().get("elementUid")[0]; 
      if (elementUid != null) {//Conversion detail request 
       JSONArray array = new JSONArray(); 
       JSONObject obj = new JSONObject(); 
       if (!isValidUid(elementUid)){ 
        obj.put("result", "fail"); 
        obj.put("message", "Not a valid element"); 
       } 
       else{ 
        setMessages(msgService.WSIGetAttachments(elementUid)); 
        obj.put("result","success"); 
        if (getMessages() != null && getMessages().size() > 0){     
         for (Message m : getMessages()){      
          JSONObject obj1 = new JSONObject(); 
          obj1.put("attachmentname", m.getAttachmentName()); 
          obj1.put("elementUid", m.getElementUID()); 
          array.add(obj1); 
         } 
        } 
        obj.put("messages", array); 
        HttpServletResponse httpResponse = ServletActionContext.getResponse(); 
        try{ 
         httpResponse.getOutputStream().print(obj.toString());     
        } 
        catch(IOException e){ 
         log.error(e); 
        }   
        return null; 
       } 
      } 
     } 
+0

這只是在代碼中,我得到這個問題的地方....我想知道如何刪除當前位置指針..當調試其他行,而斷點放置在其他地方的其他行類..... – Deepmala 2011-12-21 15:52:37

回答

0

據我所知,你不能當你在Eclipse調試移動當前位置。如果更改當前正在調試的方法源(並且正在調試熱代碼替換),則調試器將返回到方法的開始處,以允許您使用更改的方法繼續執行。

我還是看不出您提供的代碼中的「viewattachment」和「openattachment」。

我希望這能回答你的問題。

+0

@FrancisUpton我也堅持這一點,一行強調,我不知道如何擺脫它。爲什麼它不會消失?我沒有調試任何東西。我一遍又一遍關閉了所有的東西。我已經從webapp以及主要方法運行了這個類。我只是不明白。 – Xonatron 2012-02-10 20:31:31

2

只需右鍵點擊源文件,你就可以選擇一個「Execute」選項,當它運行時,在控制檯窗口中你可以點擊停止按鈕(紅色按鈕),這將刪除「調試當前指令指針」