How to get rid of the pointer of the current Debug statement

The current instruction pointer. When I put the debugger in a specific place, it starts debugging its previous step, and then goes to its current location. I see a pointer to the current instruction with a debugger icon elsewhere when the debugger starts.

Please help me, I tried to get rid of him in the last two days.

This is the scenario:

I put off the debugger in the viewattachment that comes after openattachment . But when I click openattachment , it starts to debug, and then when I click viewattachment , debugging starts.

Why is this going to open? This is overhead for me. can anyone help me with this?

Please let me know if my question is not clear.

The code matters ..........

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; } } } 
+4
source share
2 answers

right-click on the source file, and you will use the "Run" option, select that at startup in the console window you can click the "Stop" button (red button), this will delete the "Debug the current instruction pointer"

+2
source

As far as I know, you cannot move the current location when debugging in Eclipse. If you change the source of the method (and hot code replacement works) that is currently being debugged, the debugger will return to the beginning of the method so that you can continue execution using the changed method.

I still don't see where the "viewattachment" and "openattachment" are in the code you provided.

Hope this answers your question.

0
source

Source: https://habr.com/ru/post/1387268/


All Articles